CN108681514A - Equipment detection method, device, storage medium and electronic equipment - Google Patents
Equipment detection method, device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN108681514A CN108681514A CN201810411563.8A CN201810411563A CN108681514A CN 108681514 A CN108681514 A CN 108681514A CN 201810411563 A CN201810411563 A CN 201810411563A CN 108681514 A CN108681514 A CN 108681514A
- Authority
- CN
- China
- Prior art keywords
- voltage
- pin
- serial bus
- universal serial
- bus interface
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4063—Device-to-bus coupling
- G06F13/4068—Electrical coupling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0042—Universal serial bus [USB]
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)
- Power Sources (AREA)
Abstract
Description
技术领域technical field
本申请涉及电子设备技术领域,具体涉及一种设备检测方法、装置、存储介质及电子设备。The present application relates to the technical field of electronic equipment, and in particular to an equipment detection method, device, storage medium and electronic equipment.
背景技术Background technique
目前,通用串行总线接口已经成为平板电脑、手机等电子设备的标配接口。电子设备可以通过通用串行总线接口与外部设备进行连接,实现设备间的交互。为此,首先就要进行外部设备的接入检测。相关技术在实现外部设备的接入检测时,会持续向通用串行总线接口的ID引脚提供检测电压。At present, the universal serial bus interface has become a standard interface of electronic devices such as tablet computers and mobile phones. Electronic devices can be connected with external devices through a universal serial bus interface to realize interaction between devices. For this reason, it is necessary to carry out the access detection of the external equipment at first. When the related technology implements the access detection of the external device, it will continuously provide the detection voltage to the ID pin of the universal serial bus interface.
然而,为了便于用户使用,电子设备的通用串行总线接口通常是外露设置的,这就使得通用串行总线接口容易接触到腐蚀性的液体(比如汗液),而ID引脚上是持续带电的,将加速通用串行总线接口的腐蚀,从而影响通用串行总线接口的使用寿命。However, for the convenience of users, the universal serial bus interface of electronic equipment is usually exposed, which makes the universal serial bus interface easy to contact with corrosive liquid (such as sweat), while the ID pin is continuously charged , will accelerate the corrosion of the universal serial bus interface, thereby affecting the service life of the universal serial bus interface.
发明内容Contents of the invention
本申请实施例提供了一种设备检测方法、装置、存储介质及电子设备,可以提高通用串行总线接口的使用寿命。Embodiments of the present application provide a device detection method, device, storage medium and electronic device, which can improve the service life of a universal serial bus interface.
第一方面,本申请实施例了提供了的一种设备检测方法,包括:In the first aspect, the embodiment of the present application provides a device detection method, including:
为通用串行总线接口的ID引脚提供第一电压;providing a first voltage for the ID pin of the universal serial bus interface;
检测所述ID引脚的电压变化值是否达到预设值;Detecting whether the voltage change value of the ID pin reaches a preset value;
在所述电压变化值达到所述预设值时,为所述ID引脚提供用于外部设备接入检测的第二电压,其中,所述第一电压小于所述第二电压;When the voltage change value reaches the preset value, provide the ID pin with a second voltage for external device access detection, wherein the first voltage is smaller than the second voltage;
根据所述ID引脚的当前状态,确定是否有外部设备接入所述通用串行总线接口。According to the current state of the ID pin, determine whether there is an external device connected to the universal serial bus interface.
第二方面,本申请实施例提供了的一种设备检测装置,包括:In the second aspect, an equipment detection device provided in an embodiment of the present application includes:
电压提供模块,用于为通用串行总线接口的ID引脚提供第一电压;A voltage supply module, used to provide the first voltage for the ID pin of the universal serial bus interface;
电压检测模块,用于检测所述ID引脚的电压变化值是否达到预设值;A voltage detection module, configured to detect whether the voltage change value of the ID pin reaches a preset value;
所述电压提供模块还用于在所述电压变化值达到所述预设值时,为所述ID引脚提供用于外部设备接入检测的第二电压,其中,所述第一电压小于所述第二电压;The voltage supply module is further configured to provide the ID pin with a second voltage for external device access detection when the voltage change value reaches the preset value, wherein the first voltage is less than the preset value. the second voltage;
设备识别模块,用于根据所述ID引脚,确定是否有外部设备接入所述通用串行总线接口。The device identification module is used to determine whether an external device is connected to the universal serial bus interface according to the ID pin.
第三方面,本申请实施例提供的存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如本申请任一实施例提供的设备检测方法。In the third aspect, the storage medium provided by the embodiment of the present application has a computer program stored thereon, and when the computer program is run on the computer, the computer is made to execute the device detection method provided in any embodiment of the present application.
第四方面,本申请实施例提供的电子设备,包括处理器和存储器,所述存储器有计算机程序,所述处理器通过调用所述计算机程序,用于执行如本申请任一实施例提供的设备检测方法。In a fourth aspect, the electronic device provided by the embodiment of the present application includes a processor and a memory, the memory has a computer program, and the processor is used to execute the device provided by any embodiment of the present application by calling the computer program Detection method.
本申请实施例通过为通用串行总线接口的ID引脚提供一个低电压,并根据ID引脚的电压变化值是否达到预设值,来判断通用串行总线接口是否可能接入了外部设备,进而在通用串行总线接口可能接入外部设备时,为ID引脚提供一个用于外部设备接入检测的高电压,以实现外部设备的接入检测。由此,只需要在较短的时间内为ID引脚提供高电压,而在较长的其他时间为ID引脚提供低电压,相较而言,低电压对通用串行总线接口带来的腐蚀,将远低于高电压对通用串行总线接口带来的腐蚀,几乎可以忽略不计。由此,可以达到提高通用串行总线接口使用寿命的目的。In the embodiment of the present application, by providing a low voltage for the ID pin of the universal serial bus interface, and judging whether the universal serial bus interface may be connected to an external device according to whether the voltage change value of the ID pin reaches a preset value, Furthermore, when the USB interface may be connected to an external device, a high voltage for detecting the connection of the external device is provided to the ID pin, so as to realize the detection of the connection of the external device. Therefore, it is only necessary to provide a high voltage for the ID pin in a short period of time, and provide a low voltage for the ID pin in a relatively long period of time. Corrosion will be much lower than the corrosion caused by high voltage to the universal serial bus interface, and it can be almost ignored. Thus, the purpose of improving the service life of the universal serial bus interface can be achieved.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为本申请实施例提供的设备检测方法的应用场景示意图。FIG. 1 is a schematic diagram of an application scenario of a device detection method provided in an embodiment of the present application.
图2是本申请实施例提供的设备检测方法的一个流程示意图。Fig. 2 is a schematic flowchart of a device detection method provided by an embodiment of the present application.
图3是本申请实施例中提供的设备检测电路的结构示意图。FIG. 3 is a schematic structural diagram of a device detection circuit provided in an embodiment of the present application.
图4是本申请实施例中为ID引脚提供第一电压的示例图。FIG. 4 is an example diagram of providing a first voltage for an ID pin in an embodiment of the present application.
图5是本申请实施例中有外部设备接入通用串行总线接口的示例图。FIG. 5 is an example diagram of an external device connected to a universal serial bus interface in the embodiment of the present application.
图6是本申请实施例中为ID引脚提供第二电压的示例图。FIG. 6 is an example diagram of providing a second voltage for the ID pin in the embodiment of the present application.
图7是本申请实施例中显示确认消息输入接口的示意图。FIG. 7 is a schematic diagram of an interface for displaying a confirmation message input in an embodiment of the present application.
图8是本申请实施例提供的设备检测方法的另一个流程示意图。FIG. 8 is another schematic flowchart of the device detection method provided by the embodiment of the present application.
图9是本申请实施例提供的设备检测装置的一结构示意图。FIG. 9 is a schematic structural diagram of an equipment detection device provided by an embodiment of the present application.
图10是本申请实施例提供的电子设备的一个结构示意图。FIG. 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
图11是本申请实施例提供的电子设备的另一结构示意图。FIG. 11 is another schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。Referring to the drawings, wherein the same reference numerals represent the same components, the principles of the present application are exemplified by being implemented in a suitable computing environment. The following description is based on illustrated specific embodiments of the present application, which should not be construed as limiting other specific embodiments of the present application that are not described in detail here.
在以下的说明中,本申请的具体实施例将参考由一部或多部计算机所执行的步骤及符号来说明,除非另有述明。因此,这些步骤及操作将有数次提到由计算机执行,本文所指的计算机执行包括了由代表了以一结构化型式中的数据的电子信号的计算机处理单元的操作。此操作转换该数据或将其维持在该计算机的内存系统中的位置处,其可重新配置或另外以本领域测试人员所熟知的方式来改变该计算机的运作。该数据所维持的数据结构为该内存的实体位置,其具有由该数据格式所定义的特定特性。但是,本申请原理以上述文字来说明,其并不代表为一种限制,本领域测试人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。In the following description, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise stated. Accordingly, these steps and operations will several times be referred to as being computer-implemented, which herein refers to operations by a computer processing unit of electronic signals representing data in a structured form. This operation transforms the data or maintains it at a location in the computer's memory system that can reconfigure or otherwise alter the operation of the computer in a manner well known to testers in the art. The data structures maintained by the data are physical locations in the memory that have certain characteristics defined by the data format. However, the principle of the present application is described in the above text, which is not meant to be a limitation, and testers in the field will understand that the various steps and operations described below can also be implemented in hardware.
本文所使用的术语“模块”可看做为在该运算系统上执行的软件对象。本文所述的不同组件、模块、引擎及服务可看做为在该运算系统上的实施对象。而本文所述的装置及方法可以以软件的方式进行实施,当然也可在硬件上进行实施,均在本申请保护范围之内。The term "module" as used herein may be considered a software object that executes on the computing system. The various components, modules, engines and services described herein can be considered as implementation objects on the computing system. The devices and methods described herein can be implemented in the form of software, and of course can also be implemented in hardware, all of which are within the protection scope of the present application.
本申请中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或模块的过程、方法、系统、产品或设备没有限定于已列出的步骤或模块,而是某些实施例还包括没有列出的步骤或模块,或某些实施例还包括对于这些过程、方法、产品或设备固有的其它步骤或模块。The terms "first", "second" and "third" in this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "include" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the listed steps or modules, but some embodiments also include steps or modules that are not listed, or some embodiments Other steps or modules inherent to these processes, methods, products or devices are also included.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.
本申请实施例提供一种设备检测方法,该设备检测方法的执行主体可以是本申请实施例提供的设备检测装置,或者集成了该设备检测装置的电子设备,其中该设备检测装置可以采用硬件或者软件的方式实现。其中,电子设备可以是智能手机、平板电脑、掌上电脑、笔记本电脑、或者台式电脑等计算机设备。An embodiment of the present application provides a device detection method. The execution body of the device detection method may be the device detection device provided in the embodiment of the present application, or an electronic device integrated with the device detection device. The device detection device may use hardware or realized by software. Wherein, the electronic device may be a computer device such as a smart phone, a tablet computer, a palmtop computer, a notebook computer, or a desktop computer.
请参照图1,图1为本申请实施例提供的设备检测方法的应用场景示意图,以设备检测装置集成在电子设备中为例,电子设备可以为通用串行总线接口的ID引脚提供第一电压;检测ID引脚的电压变化值是否达到预设值;在ID引脚的电压变化值达到预设值时,为ID引脚提供用于外部设备接入检测的第二电压,其中,第一电压小于第二电压,比如,第二电压被配置为3.3V,第一电压被配置为0.5V;根据ID引脚的当前状态,确定是否有外部设备接入通用串行总线接口,得到外部设备接入通用串行总线接口或者外部设备未接入通用串行总线接口的检测结果。Please refer to Figure 1. Figure 1 is a schematic diagram of the application scene of the device detection method provided by the embodiment of the present application. Taking the device detection device integrated in the electronic device as an example, the electronic device can provide the first ID pin for the universal serial bus interface. Voltage; detect whether the voltage change value of the ID pin reaches a preset value; when the voltage change value of the ID pin reaches a preset value, provide the ID pin with a second voltage for external device access detection, wherein the first A voltage is lower than the second voltage, for example, the second voltage is configured as 3.3V, and the first voltage is configured as 0.5V; according to the current state of the ID pin, determine whether there is an external device connected to the USB interface, and obtain the external The detection result that the device is connected to the universal serial bus interface or the external device is not connected to the universal serial bus interface.
请参照图2,图2为本申请实施例提供的设备检测方法的流程示意图。本申请实施例提供的设备检测方法的流程可以如下:Please refer to FIG. 2 , which is a schematic flowchart of a device detection method provided in an embodiment of the present application. The flow of the device detection method provided in the embodiment of the present application may be as follows:
在步骤101中,为通用串行总线接口的ID引脚提供第一电压。In step 101, a first voltage is provided to an ID pin of a universal serial bus interface.
本申请实施例中,电子设备的通用串行总线接口在形式上为迷你通用串行总线接口或者微型通用串行总线接口,其支持OTG功能。利用OTG功能,电子设备可以“主机”和“外设”两种身份工作。In the embodiment of the present application, the USB interface of the electronic device is in the form of a mini USB interface or a micro USB interface, which supports the OTG function. With the OTG function, electronic devices can work in two identities, "host" and "peripheral".
需要说明的是,在本申请实施例中,外部设备以“外设”的身份接入电子设备,相应的,电子设备以“主机”身份工作,通过接入外部设备,电子设备可以与外部设备进行数据通信,或者利用外部设备来拓展自身的功能。其中,外部设备可以是U盘、鼠标、键盘、游戏手柄以及其他电子设备等。It should be noted that, in the embodiment of this application, the external device is connected to the electronic device as a "peripheral device", and correspondingly, the electronic device works as a "host". By connecting to the external device, the electronic device can communicate with the external device Perform data communication, or use external devices to expand its own functions. Wherein, the external device may be a USB flash drive, a mouse, a keyboard, a game controller, and other electronic devices.
比如,以电子设备为手机为例,用户可以将鼠标接入至手机的通用串行总线接口,通过鼠标对电子设备进行操作;用户还可以将U盘接入至手机的通用串行总线接口,通过手机来读取U盘中的音视频文件,进行音视频文件的播放,或者,将手机中的文件存储至U盘中,实现文件备份等。For example, taking the electronic device as a mobile phone as an example, the user can connect the mouse to the universal serial bus interface of the mobile phone to operate the electronic device through the mouse; the user can also connect the USB flash drive to the universal serial bus interface of the mobile phone, Read the audio and video files in the U disk through the mobile phone, play the audio and video files, or store the files in the mobile phone to the U disk to realize file backup, etc.
为实现OTG功能,电子设备的通用串行总线接口设置有5个引脚,其引脚定义如下表1所示:In order to realize the OTG function, the universal serial bus interface of the electronic device has 5 pins, and its pin definitions are shown in Table 1 below:
表1Table 1
其中,VBUS为电源引脚,用于向接入的外部设备提供电源,D-、D+为信号引脚,用于与接入的外部设备进行数据传输,GND为接地引脚,ID引脚用于识别不同的电缆端点,实现外部设备的接入检测、角色区分等。Among them, VBUS is the power supply pin, which is used to provide power to the connected external equipment, D-, D+ are signal pins, used for data transmission with the connected external equipment, GND is the ground pin, and the ID pin is used for It is used to identify different cable end points, realize access detection of external equipment, role distinction, etc.
本申请实施例中,为实现对外部设备的接入检测,电子设备首先为通用串行总线接口的ID引脚提供第一电压。In the embodiment of the present application, in order to realize the access detection of the external device, the electronic device first provides the first voltage for the ID pin of the universal serial bus interface.
在步骤102中,检测ID引脚的电压变化值是否达到预设值。In step 102, it is detected whether the voltage change value of the ID pin reaches a preset value.
需要说明的是,作为“外设”的外部设备,其通用串行总线接口的ID引脚接地,比如,外部设备的ID引脚通过一下拉电阻接地,其中,下拉电阻可以是一个单独的电阻,也可以是多个电阻串联和/或并联组成。It should be noted that, as an external device as a "peripheral device", the ID pin of its universal serial bus interface is grounded. For example, the ID pin of the external device is grounded through a pull-down resistor, wherein the pull-down resistor can be a separate resistor , can also be composed of multiple resistors connected in series and/or in parallel.
这样,当外部设备接入电子设备时,电子设备ID引脚上的电压将被外部设备的ID引脚拉低。由此,本申请实施例中,电子设备可以在为ID引脚提供第一电压之后,根据检测ID引脚的电压变化值,来判断其通用串行总线接口是否接入了外部设备。In this way, when an external device is connected to the electronic device, the voltage on the ID pin of the electronic device will be pulled down by the ID pin of the external device. Therefore, in the embodiment of the present application, after the electronic device provides the first voltage to the ID pin, it can determine whether the USB interface of the electronic device is connected to an external device according to detecting the voltage change value of the ID pin.
本申请实施例中,在为通用串行总线接口的ID引脚提供第一电压之后,电子设备检测ID引脚的电压变化值是否达到预设值,其中,在检测到ID引脚的电压变化值达到预设值时,确定可能有外部设备接入其通用串行总线接口,在检测到ID引脚的电压变化值未达到预设值时,确定没有外部设备接入其通用串行总线接口。In the embodiment of the present application, after providing the first voltage to the ID pin of the universal serial bus interface, the electronic device detects whether the voltage change value of the ID pin reaches a preset value, wherein, after detecting the voltage change of the ID pin When the value reaches the preset value, it is determined that there may be an external device connected to its universal serial bus interface. When it is detected that the voltage change value of the ID pin does not reach the preset value, it is determined that no external device is connected to its universal serial bus interface. .
作为一种实施方式,电子设备在为其通用串行总线接口的ID引脚提供第一电压之后,实时对ID引脚进行电压检测,得到实时电压,并计算第一电压与该实时电压的电压差值,将计算得到的电压差值作为其ID引脚的电压变化值。As an implementation, after the electronic device provides the first voltage to the ID pin of its universal serial bus interface, it detects the voltage of the ID pin in real time to obtain the real-time voltage, and calculates the voltage between the first voltage and the real-time voltage Difference, the calculated voltage difference is used as the voltage change value of its ID pin.
需要说明的是,由于外部设备的ID引脚接地,当外部设备接入电子设备的通用串行总线接口时,将使得电子设备的ID引脚同样接地,将ID引脚的电压拉低为0V。因此,本申请实施例中,将用于判断通用串行总线接口是否可能接入外部设备的预设值设置为第一电压的电压值,比如,电子设备在为其通用串行总线接口的ID提供的第一电压为0.5V时,前述预设值同样被配置为0.5V。It should be noted that since the ID pin of the external device is grounded, when the external device is connected to the USB interface of the electronic device, the ID pin of the electronic device will also be grounded, and the voltage of the ID pin will be pulled down to 0V . Therefore, in the embodiment of the present application, the preset value for judging whether the USB interface may be connected to an external device is set as the voltage value of the first voltage, for example, the electronic device is using the ID of the USB interface. When the provided first voltage is 0.5V, the aforementioned preset value is also configured as 0.5V.
在步骤103中,在ID引脚的电压变化值达到预设值时,为ID引脚提供用于外部设备接入检测的第二电压,其中,第一电压小于第二电压。In step 103, when the voltage change value of the ID pin reaches a preset value, a second voltage for external device access detection is provided to the ID pin, wherein the first voltage is smaller than the second voltage.
本申请实施例中,电子设备在完成对其ID引脚上电压变化值的检测,且检测到该电压变化值达到预设值,也即是确定可能有外部设备接入其通用串行总线接口时,为ID引脚提供用于外部设备接入检测的第二电压,也即是将ID引脚上拉为高电压。In the embodiment of the present application, after the electronic device completes the detection of the voltage change value on its ID pin, and detects that the voltage change value reaches the preset value, it is determined that there may be an external device connected to its universal serial bus interface. , the ID pin is provided with a second voltage for external device access detection, that is, the ID pin is pulled up to a high voltage.
需要说明的是,本申请实施例中,之前为ID引脚所提供的第一电压,小于当前为ID引脚提供的第二电压,且该第一电压是远小于该第二电压。比如,电子设备为其ID引脚提供的第一电压为0.5V,而在检测到ID引脚的电压变化值达到预设值时,为其ID引脚提供的第二电压为3.3V。It should be noted that, in the embodiment of the present application, the first voltage previously provided for the ID pin is smaller than the second voltage currently provided for the ID pin, and the first voltage is much smaller than the second voltage. For example, the first voltage provided by the electronic device to its ID pin is 0.5V, and when it is detected that the voltage change value of the ID pin reaches a preset value, the second voltage provided to its ID pin is 3.3V.
在步骤104中,根据ID引脚的当前状态,确定是否有外部设备接入通用串行总线接口。In step 104, it is determined whether there is an external device connected to the USB interface according to the current state of the ID pin.
本申请实施例中,电子设备在为ID引脚提供第二电压之后,对其ID引脚的状态进行检测,获得ID引脚的当前状态。然后,根据获取到的该当前状态,确定是否有外部设备接入通用串行总线接口。In the embodiment of the present application, after the electronic device provides the second voltage for the ID pin, it detects the state of the ID pin to obtain the current state of the ID pin. Then, according to the obtained current state, it is determined whether there is an external device connected to the universal serial bus interface.
需要说明的是,由于外部设备的ID引脚接地,当外部设备接入电子设备的通用串行总线接口时,将使得电子设备的ID引脚同样接地,也即是说,在外部设备接入电子设备的通用串行总线接口时,电子设备的ID引脚将呈现为接地状态。It should be noted that since the ID pin of the external device is grounded, when the external device is connected to the USB interface of the electronic device, the ID pin of the electronic device will also be grounded. When the universal serial bus interface of the electronic device is connected, the ID pin of the electronic device will be in a ground state.
因此,在本申请实施例中,在根据ID引脚的当前状态,确定是否有外部设备接入通用串行总线接口时,可以检测ID引脚的当前状态是否接地状态;其中,在ID引脚的当前状态为接地状态时,确定有外部设备接入通用串行总线接口;在ID引脚的当前状态不为接地状态时,确定无外部设备接入通用串行总线接口。Therefore, in the embodiment of the present application, when determining whether an external device is connected to the universal serial bus interface according to the current state of the ID pin, it can be detected whether the current state of the ID pin is grounded; When the current state of the pin is grounded, it is determined that an external device is connected to the universal serial bus interface; when the current state of the ID pin is not in the grounded state, it is determined that no external device is connected to the universal serial bus interface.
由上可知,本申请实施例通过为通用串行总线接口的ID引脚提供一个低电压,并根据ID引脚的电压变化值是否达到预设值,来判断通用串行总线接口是否可能接入了外部设备,进而在通用串行总线接口可能接入外部设备时,为ID引脚提供一个用于外部设备接入检测的高电压,以实现外部设备的接入检测。由此,只需要在较短的时间内为ID引脚提供高电压,而在较长的其他时间为ID引脚提供低电压,相较而言,低电压对通用串行总线接口带来的腐蚀,将远低于高电压对通用串行总线接口带来的腐蚀,几乎可以忽略不计。由此,可以达到提通用串行总线接口使用寿命的目的。As can be seen from the above, the embodiment of the present application provides a low voltage for the ID pin of the universal serial bus interface, and judges whether the universal serial bus interface may be connected according to whether the voltage change value of the ID pin reaches a preset value. The external device is connected, and then when the universal serial bus interface may be connected to the external device, a high voltage for the external device access detection is provided for the ID pin, so as to realize the external device access detection. Therefore, it is only necessary to provide a high voltage for the ID pin in a short period of time, and provide a low voltage for the ID pin in a relatively long period of time. Corrosion will be much lower than the corrosion caused by high voltage to the universal serial bus interface, and it can be almost ignored. Thus, the purpose of improving the service life of the universal serial bus interface can be achieved.
在一实施例中,提供了一种电子设备的设备检测电路,请参照图3,该设备检测电路包括通用串行总线接口、单刀双掷开关、第一电压提供模组、第二电压提供模组以及比较器。其中,通用串行总线接口的ID引脚与单刀双掷开关的输入端电连接,该单刀双掷开关的一输出端与比较器的一输入端电连接,还与第一电压提供模组电连接,该单刀双掷开关的另一输出端与第二电压提供模组电连接,比较器的另一输入端与参考电压提供模组电连接,该参考电压提供模组提供的参考电压小于第一电压提供模组提供的第一电压,第一电压提供模组所提供的第一电压小于第二电压提供模组所提供的第二电压。In one embodiment, a device detection circuit of an electronic device is provided. Please refer to FIG. groups and comparators. Wherein, the ID pin of the universal serial bus interface is electrically connected to the input end of the single-pole double-throw switch, and an output end of the single-pole double-throw switch is electrically connected to an input end of the comparator, and is also electrically connected to the first voltage supply module connected, the other output end of the single pole double throw switch is electrically connected to the second voltage supply module, the other input end of the comparator is electrically connected to the reference voltage supply module, and the reference voltage provided by the reference voltage supply module is lower than the first A first voltage provided by a voltage supply module, the first voltage provided by the first voltage supply module is lower than the second voltage provided by the second voltage supply module.
基于图3所示的设备检测电路,在一实施例中,为通用串行总线接口的ID引脚提供第一电压,包括:Based on the device detection circuit shown in FIG. 3, in one embodiment, providing the first voltage for the ID pin of the universal serial bus interface includes:
控制单刀双掷开关接通ID引脚与第一电压提供模组,由第一电压提供模组为ID引脚提供第一电压。The SPDT switch is controlled to connect the ID pin and the first voltage supply module, and the first voltage supply module supplies the ID pin with the first voltage.
其中,请参照图4,在为通用串行总线接口的ID引脚提供第一电压时,电子设备可以控制单刀双掷开关接通ID引脚与第一电压提供模组,由第一电压提供模组为ID引脚提供第一电压。Wherein, please refer to FIG. 4, when providing the first voltage for the ID pin of the universal serial bus interface, the electronic device can control the single-pole double-throw switch to connect the ID pin and the first voltage supply module, and the first voltage provides The module provides the first voltage for the ID pin.
比如,第一电压提供模组的输出电压为0.5V,在通过单刀双掷开关接通ID引脚与第一电压提供模组时,第一电压模组将为ID引脚提供0.5V的第一电压。For example, the output voltage of the first voltage supply module is 0.5V. When the ID pin and the first voltage supply module are connected through a single-pole double-throw switch, the first voltage module will provide the first voltage of 0.5V for the ID pin. a voltage.
在一可选的实施方式中,若单刀双掷开关与ID引脚连接的输出端与比较器的正极输入端连接,且参考电压提供模组与比较器的负极输入端连接时,请参照图3,如图3所示,在单刀双掷开关未将ID引脚与第二电源模块接通,也未将ID引脚与比较器的正极输入端接通时,第一电压提供模组为比较器的正极输入端提供第一电压,参考电压提供模组为比较器的负极输入端提供参考电压,由于第一电压大于参考电压,比较器的输出端将输出高电压。In an optional implementation, if the output end of the SPDT switch connected to the ID pin is connected to the positive input end of the comparator, and the reference voltage supply module is connected to the negative input end of the comparator, please refer to the figure 3. As shown in Figure 3, when the SPDT switch does not connect the ID pin to the second power supply module, nor connects the ID pin to the positive input terminal of the comparator, the first voltage supply module is The positive input terminal of the comparator provides a first voltage, and the reference voltage supply module provides a reference voltage for the negative input terminal of the comparator. Since the first voltage is greater than the reference voltage, the output terminal of the comparator will output a high voltage.
请参照图4,在单刀双掷开关将第一电压提供模组与ID引脚接通时,第一电压提供模组将同时为比较器的正极输入端、和ID引脚提供第一电压,此时,比较器的输出端将仍输出高电压。Please refer to FIG. 4, when the SPDT switch connects the first voltage supply module to the ID pin, the first voltage supply module will simultaneously provide the first voltage for the positive input terminal of the comparator and the ID pin, At this time, the output terminal of the comparator will still output a high voltage.
在另一可选的实施方式中,若单刀双掷开关与ID引脚连接的输出端与比较器的负极输入端连接,且参考电压提供模组与比较器的正极输入端连接时,请参照图3,如图3所示,在单刀双掷开关未将ID引脚与第二电源模块接通,也未将ID引脚与比较器的正极输入端接通时,第一电压提供模组为比较器的正极输入端提供第一电压,参考电压提供模组为比较器的负极输入端提供参考电压,由于第一电压大于参考电压,比较器的输出端将输出低电压。In another optional implementation, if the output end of the SPDT switch connected to the ID pin is connected to the negative input end of the comparator, and the reference voltage supply module is connected to the positive input end of the comparator, please refer to Figure 3, as shown in Figure 3, when the SPDT switch does not connect the ID pin to the second power supply module, nor connects the ID pin to the positive input terminal of the comparator, the first voltage supply module The first voltage is provided for the positive input terminal of the comparator, and the reference voltage supply module provides the reference voltage for the negative input terminal of the comparator. Since the first voltage is greater than the reference voltage, the output terminal of the comparator will output a low voltage.
请参照图4,在单刀双掷开关将第一电压提供模组与ID引脚接通时,第一电压提供模组将同时为比较器的正极输入端、和ID引脚提供第一电压,此时,比较器的输出端将仍输出低电压。Please refer to FIG. 4, when the SPDT switch connects the first voltage supply module to the ID pin, the first voltage supply module will simultaneously provide the first voltage for the positive input terminal of the comparator and the ID pin, At this time, the output terminal of the comparator will still output a low voltage.
基于图3所示的设备检测电路,在一实施例中,检测ID引脚的电压变化值是否达到预设值,包括:Based on the device detection circuit shown in Figure 3, in one embodiment, detecting whether the voltage change value of the ID pin reaches a preset value includes:
检测比较器输出端的输出电压是否发生变化,其中,在输出电压发生变化时,确定ID引脚的电压变化值达到预设值。Detecting whether the output voltage at the output terminal of the comparator changes, wherein, when the output voltage changes, it is determined that the voltage change value of the ID pin reaches a preset value.
在一可选的实施方式中,若单刀双掷开关与ID引脚连接的输出端与比较器的正极输入端连接,且参考电压提供模组与比较器的负极输入端连接时,请参照图3,如图3所示,在单刀双掷开关未将ID引脚与第二电源模块接通,也未将ID引脚与比较器的正极输入端接通时,第一电压提供模组为比较器的正极输入端提供第一电压,参考电压提供模组为比较器的负极输入端提供参考电压,由于第一电压大于参考电压,比较器的输出端将输出高电压。In an optional implementation, if the output end of the SPDT switch connected to the ID pin is connected to the positive input end of the comparator, and the reference voltage supply module is connected to the negative input end of the comparator, please refer to the figure 3. As shown in Figure 3, when the SPDT switch does not connect the ID pin to the second power supply module, nor connects the ID pin to the positive input terminal of the comparator, the first voltage supply module is The positive input terminal of the comparator provides a first voltage, and the reference voltage supply module provides a reference voltage for the negative input terminal of the comparator. Since the first voltage is greater than the reference voltage, the output terminal of the comparator will output a high voltage.
请结合参照图4,在单刀双掷开关将第一电压提供模组与ID引脚接通时,第一电压提供模组将同时为比较器的正极输入端、和ID引脚提供第一电压,此时,比较器的输出端将仍输出高电压。Please refer to Figure 4, when the SPDT switch connects the first voltage supply module to the ID pin, the first voltage supply module will simultaneously provide the first voltage to the positive input terminal of the comparator and the ID pin , at this time, the output terminal of the comparator will still output a high voltage.
若将预设值设置为第一电压的电压值本身,请参照图5,当有外部设备接入电子设备的通用串行总线接口时,通用串行总线接口的ID引脚以及比较器的正极输入端均被接地,此时,正极输入端的电压将由第一电压变化为0V(也即是ID引脚的电压变化值达到预设值),比较器的的输出电压将由高电压变化为低电压。因此,电子设备在检测到比较器输出端的输出电压由高电压变为低电压时,即可确定ID引脚的电压变化值达到预设值。If the preset value is set to the voltage value itself of the first voltage, please refer to Figure 5, when an external device is connected to the USB interface of the electronic device, the ID pin of the USB interface and the positive pole of the comparator The input terminals are all grounded. At this time, the voltage of the positive input terminal will change from the first voltage to 0V (that is, the voltage change value of the ID pin reaches the preset value), and the output voltage of the comparator will change from high voltage to low voltage. . Therefore, when the electronic device detects that the output voltage at the output terminal of the comparator changes from a high voltage to a low voltage, it can determine that the voltage change value of the ID pin reaches a preset value.
在另一可选的实施方式中,若单刀双掷开关与ID引脚连接的输出端与比较器的负极输入端连接,且参考电压提供模组与比较器的正极输入端连接时,请参照图3,如图3所示,在单刀双掷开关未将ID引脚与第二电源模块接通,也未将ID引脚与比较器的正极输入端接通时,第一电压提供模组为比较器的正极输入端提供第一电压,参考电压提供模组为比较器的负极输入端提供参考电压,由于第一电压大于参考电压,比较器的输出端将输出低电压。In another optional implementation, if the output end of the SPDT switch connected to the ID pin is connected to the negative input end of the comparator, and the reference voltage supply module is connected to the positive input end of the comparator, please refer to Figure 3, as shown in Figure 3, when the SPDT switch does not connect the ID pin to the second power supply module, nor connects the ID pin to the positive input terminal of the comparator, the first voltage supply module The first voltage is provided for the positive input terminal of the comparator, and the reference voltage supply module provides the reference voltage for the negative input terminal of the comparator. Since the first voltage is greater than the reference voltage, the output terminal of the comparator will output a low voltage.
请参照图4,在单刀双掷开关将第一电压提供模组与ID引脚接通时,第一电压提供模组将同时为比较器的正极输入端、和ID引脚提供第一电压,此时,比较器的输出端将仍输出低电压。Please refer to FIG. 4, when the SPDT switch connects the first voltage supply module to the ID pin, the first voltage supply module will simultaneously provide the first voltage for the positive input terminal of the comparator and the ID pin, At this time, the output terminal of the comparator will still output a low voltage.
若将预设值设置为第一电压的电压值本身,请参照图5,当有外部设备接入电子设备的通用串行总线接口时,通用串行总线接口的ID引脚以及比较器的正极输入端均被接地,此时,正极输入端的电压将由第一电压变化为0V(也即是ID引脚的电压变化值达到预设值),比较器的的输出电压将由低电压变化为高电压。因此,电子设备在检测到比较器输出端的输出电压由低电压变为高电压时,即可确定ID引脚的电压变化值达到预设值。If the preset value is set to the voltage value itself of the first voltage, please refer to Figure 5, when an external device is connected to the USB interface of the electronic device, the ID pin of the USB interface and the positive pole of the comparator The input terminals are all grounded. At this time, the voltage of the positive input terminal will change from the first voltage to 0V (that is, the voltage change value of the ID pin reaches the preset value), and the output voltage of the comparator will change from low voltage to high voltage. . Therefore, when the electronic device detects that the output voltage at the output terminal of the comparator changes from a low voltage to a high voltage, it can determine that the voltage change value of the ID pin reaches a preset value.
基于图3所述的设备检测电路,在一实施例中,为ID引脚提供用于外部设备接入检测的第二电压,包括:Based on the device detection circuit described in FIG. 3 , in an embodiment, providing the ID pin with a second voltage for external device access detection includes:
控制单刀双掷开关接通ID引脚与第二电压提供模组,由第二电压提供模组为ID引脚提供第二电压。The SPDT switch is controlled to connect the ID pin and the second voltage supply module, and the second voltage supply module provides the ID pin with a second voltage.
其中,请参照图6,在为通用串行总线接口的ID引脚提供第二电压时,电子设备可以控制单刀双掷开关接通ID引脚与第二电压提供模组,由第二电压提供模组为ID引脚提供第二电压。Wherein, please refer to FIG. 6, when providing the second voltage for the ID pin of the universal serial bus interface, the electronic device can control the single-pole double-throw switch to connect the ID pin and the second voltage supply module, and the second voltage provides The module provides the second voltage for the ID pin.
比如,第二电压提供模组的输出电压为3.3V,在通过单刀双掷开关接通ID引脚与第二电压提供模组时,第二电压模组将为ID引脚提供3.3V的第二电压,用于实现外部设备的接入检测。For example, the output voltage of the second voltage supply module is 3.3V. When the ID pin and the second voltage supply module are connected through a single-pole double-throw switch, the second voltage module will provide the first voltage of 3.3V for the ID pin. The second voltage is used to realize the access detection of the external equipment.
在一实施例中,为ID引脚提供用于外部设备接入检测的第二电压之后,还包括:In an embodiment, after providing the ID pin with the second voltage for external device access detection, it further includes:
在检测到ID引脚的当前状态不再为接地状态时,控制单刀双掷开关接通ID引脚与第一电压提供模组,由第一电压提供模组为ID引脚提供第一电压。When it is detected that the current state of the ID pin is no longer grounded, the SPDT switch is controlled to connect the ID pin and the first voltage supply module, and the first voltage supply module provides the first voltage for the ID pin.
本申请实施例中,电子设备在检测到ID引脚的当前状态不再为接地状态时,确定外部设备已经从其通用串行总线接口中拔出,此时控制单刀双掷开关接通ID引脚与第一电压提供模组,由第一电压提供模组为ID引脚提供第一电压,以对外部设备的下一次接入进行检测。In the embodiment of the present application, when the electronic device detects that the current state of the ID pin is no longer grounded, it determines that the external device has been pulled out from its universal serial bus interface, and at this time controls the SPDT switch to turn on the ID pin. pin and the first voltage supply module, and the first voltage supply module provides the first voltage for the ID pin to detect the next access of the external device.
在一实施例中,根据ID引脚的当前状态,确定是否有外部设备接入通用串行总线接口之后,还包括:In one embodiment, after determining whether an external device is connected to the universal serial bus interface according to the current state of the ID pin, it also includes:
在有外部设备接入通用串行总线接口时,通过通用串行总线接口向外部设备供电;When an external device is connected to the universal serial bus interface, power is supplied to the external device through the universal serial bus interface;
在向外部设备供电期间,获取通用串行总线接口的温度值;Obtain the temperature value of the universal serial bus interface during the period of power supply to the external device;
在获取到的温度值位于预设温度区间之内时,停止为外部设备供电。When the obtained temperature value is within the preset temperature range, power supply to the external device is stopped.
本申请实施例中,电子设备在确定有外部设备接入其通用串行总线接口时,与外部设备建立电连接,并通过其通用串行总线接口的电源引脚为外部设备供电。In the embodiment of the present application, when the electronic device determines that an external device is connected to its universal serial bus interface, it establishes an electrical connection with the external device, and supplies power to the external device through the power pin of its universal serial bus interface.
容易理解的是,若通用串行总线接口的温度过高,将有可能烧毁通用串行总线接口,甚至损坏整个电子设备。而在电子设备通过通用串行总线接口为外部设备供电时,将使得其通用串行总线接口的温度迅速升高。为避免对外部设备供电而造成电子设备的损坏,在本申请实施例中,电子设备在向外部设备提供供电电压期间,实时从设置在通用串行总线接口处的温度传感器处获取通用串行总线接口的温度值,并在获取到通用串行总线接口的温度值之后,判断该温度值是否位于预设温度区间之内,其中,在该温度值位于预设温度区间之内时,说明通用串行总线接口的温度过高,此时停止向外部设备供电,避免通用串行总线接口的温度继续升高。It is easy to understand that if the temperature of the USB interface is too high, it may burn the USB interface and even damage the entire electronic device. However, when the electronic device supplies power to external devices through the USB interface, the temperature of the USB interface will rise rapidly. In order to avoid damage to the electronic equipment caused by power supply to the external equipment, in the embodiment of the present application, the electronic equipment obtains the universal serial bus voltage from the temperature sensor provided at the universal serial bus interface in real time during the period of supplying the power supply voltage to the external equipment. The temperature value of the interface, and after obtaining the temperature value of the universal serial bus interface, judge whether the temperature value is within the preset temperature range, wherein, when the temperature value is within the preset temperature range, it means that the universal serial bus If the temperature of the serial bus interface is too high, stop supplying power to the external device at this time, so as to prevent the temperature of the universal serial bus interface from continuing to rise.
其中,可以将预设温度区间设置为[Tmin,+∞),Tmin表示可能造成电子设备损坏的最低温度值,具体可预先通过实验得到。Wherein, the preset temperature range can be set as [Tmin, +∞), and Tmin represents the lowest temperature value that may cause damage to the electronic device, which can be obtained through experiments in advance.
比如,预设温度区间被设置为[60℃,+∞),若获取到通用串行总线接口的温度值为37℃,则电子设备继续为外部设备供电;若获取到通用串行总线接口的温度值为67℃,则电子设备停止为外部设备供电。For example, the preset temperature range is set to [60°C, +∞), if the obtained temperature value of the universal serial bus interface is 37°C, the electronic device will continue to supply power to the external device; If the temperature value is 67°C, the electronic device stops supplying power to the external device.
在一实施例中,在获取到的温度值位于预设温度区间之内时,停止为外部设备供电,包括:In an embodiment, when the obtained temperature value is within the preset temperature range, power supply to the external device is stopped, including:
在获取到的温度值位于预设温度区间之内时,显示确认信息输入接口;When the obtained temperature value is within the preset temperature range, a confirmation message input interface is displayed;
在基于显示的确认信息输入接口接收到输入的确认信息时,停止为外部设备供电。Stop supplying power to the external device when the input interface receives the input confirmation information based on the displayed confirmation information.
本申请实施例中,由用户确定是否停止为外部设备供电。比如,请参照图7,电子设备在获取到通用串行总线接口的温度值,且判断该温度值位于预设温度区间之内时,在屏幕显示区域显示确认信息输入接口,该确认信息输入接口包括“是”控件和“否”控件,以及用于提示用户是否断开与外部设备的提示信息“当前温度过高,是否断开外设”,用户可通过点击“是”控件以输入确认信息,点击“否”控件输入否认信息。其中,电子设备若接收到用户输入的确认信息,则断开与外部设备的电连接,停止为外部设备供电;若接收到用户输入的否认信息,则不操作,继续为外部设备供电。In this embodiment of the present application, the user determines whether to stop supplying power to the external device. For example, please refer to FIG. 7, when the electronic device obtains the temperature value of the universal serial bus interface and judges that the temperature value is within the preset temperature range, it displays a confirmation information input interface in the screen display area, and the confirmation information input interface Including "Yes" control and "No" control, as well as the prompt message "The current temperature is too high, do you want to disconnect the peripheral device" for prompting the user whether to disconnect the external device. The user can click the "Yes" control to enter the confirmation information , click the "No" control to enter the denial information. Wherein, if the electronic device receives confirmation information input by the user, it disconnects the electrical connection with the external device, and stops supplying power to the external device;
下面将在上述实施例描述的方法基础上,对本申请的设备检测方法做进一步介绍。具体的,请参照图3,电子设备包括通用串行总线接口、单刀双掷开关、第一电压提供模组、第二电压提供模组以及比较器。其中,通用串行总线接口的ID引脚与单刀双掷开关的输入端电连接,该单刀双掷开关的一输出端与比较器的一输入端电连接,还与第一电压提供模组电连接,该单刀双掷开关的另一输出端与第二电压提供模组电连接,比较器的另一输入端与参考电压提供模组电连接,该参考电压提供模组提供的参考电压小于第一电压提供模组提供的第一电压,第一电压提供模组所提供的第一电压小于第二电压提供模组所提供的第二电压,请参照图8,该设备检测方法的具体流程如下:The device detection method of the present application will be further introduced below on the basis of the methods described in the above embodiments. Specifically, referring to FIG. 3 , the electronic device includes a universal serial bus interface, a single-pole double-throw switch, a first voltage supply module, a second voltage supply module, and a comparator. Wherein, the ID pin of the universal serial bus interface is electrically connected to the input end of the single-pole double-throw switch, and an output end of the single-pole double-throw switch is electrically connected to an input end of the comparator, and is also electrically connected to the first voltage supply module connected, the other output end of the single pole double throw switch is electrically connected to the second voltage supply module, the other input end of the comparator is electrically connected to the reference voltage supply module, and the reference voltage provided by the reference voltage supply module is lower than the first A first voltage provided by a voltage supply module, the first voltage provided by the first voltage supply module is lower than the second voltage provided by the second voltage supply module, please refer to Figure 8, the specific flow of the device detection method is as follows :
在步骤201中,控制单刀双掷开关接通ID引脚与第一电压提供模组,由第一电压提供模组为ID引脚提供第一电压。In step 201, the SPDT switch is controlled to connect the ID pin and the first voltage supply module, and the first voltage supply module provides the ID pin with a first voltage.
本申请实施例中,电子设备的通用串行总线接口在形式上为迷你通用串行总线接口或者微型通用串行总线接口,其支持OTG功能。利用OTG功能,电子设备可以“主机”和“外设”两种身份工作。In the embodiment of the present application, the USB interface of the electronic device is in the form of a mini USB interface or a micro USB interface, which supports the OTG function. With the OTG function, electronic devices can work in two identities, "host" and "peripheral".
需要说明的是,在本申请实施例中,外部设备以“外设”的身份接入电子设备,相应的,电子设备以“主机”身份工作,通过接入外部设备,电子设备可以与外部设备进行数据通信,或者利用外部设备来拓展自身的功能。其中,外部设备可以是U盘、鼠标、键盘、游戏手柄以及其他电子设备等。It should be noted that, in the embodiment of this application, the external device is connected to the electronic device as a "peripheral device", and correspondingly, the electronic device works as a "host". By connecting to the external device, the electronic device can communicate with the external device Perform data communication, or use external devices to expand its own functions. Wherein, the external device may be a USB flash drive, a mouse, a keyboard, a game controller, and other electronic devices.
比如,以电子设备为手机为例,用户可以将鼠标接入至手机的通用串行总线接口,通过鼠标对电子设备进行操作;用户还可以将U盘接入至手机的通用串行总线接口,通过手机来读取U盘中的音视频文件,进行音视频文件的播放,或者,将手机中的文件存储至U盘中,实现文件备份等。For example, taking the electronic device as a mobile phone as an example, the user can connect the mouse to the universal serial bus interface of the mobile phone to operate the electronic device through the mouse; the user can also connect the USB flash drive to the universal serial bus interface of the mobile phone, Read the audio and video files in the U disk through the mobile phone, play the audio and video files, or store the files in the mobile phone to the U disk to realize file backup, etc.
为实现OTG功能,电子设备的通用串行总线接口设置有5个引脚,其引脚定义如表1所示。In order to realize the OTG function, the universal serial bus interface of the electronic equipment is provided with 5 pins, and its pin definitions are shown in Table 1.
本申请实施例中,为实现对外部设备的接入检测,电子设备首先为通用串行总线接口的ID引脚提供第一电压。In the embodiment of the present application, in order to realize the access detection of the external device, the electronic device first provides the first voltage for the ID pin of the universal serial bus interface.
其中,请参照图4,在为通用串行总线接口的ID引脚提供第一电压时,电子设备可以控制单刀双掷开关接通ID引脚与第一电压提供模组,由第一电压提供模组为ID引脚提供第一电压。Wherein, please refer to FIG. 4, when providing the first voltage for the ID pin of the universal serial bus interface, the electronic device can control the single-pole double-throw switch to connect the ID pin and the first voltage supply module, and the first voltage provides The module provides the first voltage for the ID pin.
比如,第一电压提供模组的输出电压为0.5V,在通过单刀双掷开关接通ID引脚与第一电压提供模组时,第一电压模组将为ID引脚提供0.5V的第一电压。For example, the output voltage of the first voltage supply module is 0.5V. When the ID pin and the first voltage supply module are connected through a single-pole double-throw switch, the first voltage module will provide the first voltage of 0.5V for the ID pin. a voltage.
在一可选的实施方式中,若单刀双掷开关与ID引脚连接的输出端与比较器的正极输入端连接,且参考电压提供模组与比较器的负极输入端连接时,请参照图3,如图3所示,在单刀双掷开关未将ID引脚与第二电源模块接通,也未将ID引脚与比较器的正极输入端接通时,第一电压提供模组为比较器的正极输入端提供第一电压,参考电压提供模组为比较器的负极输入端提供参考电压,由于第一电压大于参考电压,比较器的输出端将输出高电压。In an optional implementation, if the output end of the SPDT switch connected to the ID pin is connected to the positive input end of the comparator, and the reference voltage supply module is connected to the negative input end of the comparator, please refer to the figure 3. As shown in Figure 3, when the SPDT switch does not connect the ID pin to the second power supply module, nor connects the ID pin to the positive input terminal of the comparator, the first voltage supply module is The positive input terminal of the comparator provides a first voltage, and the reference voltage supply module provides a reference voltage for the negative input terminal of the comparator. Since the first voltage is greater than the reference voltage, the output terminal of the comparator will output a high voltage.
请参照图4,在单刀双掷开关将第一电压提供模组与ID引脚接通时,第一电压提供模组将同时为比较器的正极输入端、和ID引脚提供第一电压,此时,比较器的输出端将仍输出高电压。Please refer to FIG. 4, when the SPDT switch connects the first voltage supply module to the ID pin, the first voltage supply module will simultaneously provide the first voltage for the positive input terminal of the comparator and the ID pin, At this time, the output terminal of the comparator will still output a high voltage.
在另一可选的实施方式中,若单刀双掷开关与ID引脚连接的输出端与比较器的负极输入端连接,且参考电压提供模组与比较器的正极输入端连接时,请参照图3,如图3所示,在单刀双掷开关未将ID引脚与第二电源模块接通,也未将ID引脚与比较器的正极输入端接通时,第一电压提供模组为比较器的正极输入端提供第一电压,参考电压提供模组为比较器的负极输入端提供参考电压,由于第一电压大于参考电压,比较器的输出端将输出低电压。In another optional implementation, if the output end of the SPDT switch connected to the ID pin is connected to the negative input end of the comparator, and the reference voltage supply module is connected to the positive input end of the comparator, please refer to Figure 3, as shown in Figure 3, when the SPDT switch does not connect the ID pin to the second power supply module, nor connects the ID pin to the positive input terminal of the comparator, the first voltage supply module The first voltage is provided for the positive input terminal of the comparator, and the reference voltage supply module provides the reference voltage for the negative input terminal of the comparator. Since the first voltage is greater than the reference voltage, the output terminal of the comparator will output a low voltage.
请参照图4,在单刀双掷开关将第一电压提供模组与ID引脚接通时,第一电压提供模组将同时为比较器的正极输入端、和ID引脚提供第一电压,此时,比较器的输出端将仍输出低电压。Please refer to FIG. 4, when the SPDT switch connects the first voltage supply module to the ID pin, the first voltage supply module will simultaneously provide the first voltage for the positive input terminal of the comparator and the ID pin, At this time, the output terminal of the comparator will still output a low voltage.
在步骤202中,检测比较器输出端的输出电压是否发生变化。In step 202, it is detected whether the output voltage at the output terminal of the comparator changes.
需要说明的是,作为“外设”的外部设备,其通用串行总线接口的ID引脚接地,比如,外部设备的ID引脚通过一下拉电阻接地,其中,下拉电阻可以是一个单独的电阻,也可以是多个电阻串联和/或并联组成。It should be noted that, as an external device as a "peripheral device", the ID pin of its universal serial bus interface is grounded. For example, the ID pin of the external device is grounded through a pull-down resistor, wherein the pull-down resistor can be a separate resistor , can also be composed of multiple resistors connected in series and/or in parallel.
这样,当外部设备接入电子设备时,电子设备ID引脚上的电压将被外部设备的ID引脚拉低。由此,本申请实施例中,电子设备可以在为ID引脚提供第一电压之后,根据检测ID引脚的电压变化值,来判断其通用串行总线接口是否接入了外部设备。In this way, when an external device is connected to the electronic device, the voltage on the ID pin of the electronic device will be pulled down by the ID pin of the external device. Therefore, in the embodiment of the present application, after the electronic device provides the first voltage to the ID pin, it can determine whether the USB interface of the electronic device is connected to an external device according to detecting the voltage change value of the ID pin.
本申请实施例中,在为通用串行总线接口的ID引脚提供第一电压之后,电子设备检测ID引脚的电压变化值是否达到预设值,其中,在检测到ID引脚的电压变化值达到预设值时,确定可能有外部设备接入其通用串行总线接口,在检测到ID引脚的电压变化值未达到预设值时,确定没有外部设备接入其通用串行总线接口。In the embodiment of the present application, after providing the first voltage to the ID pin of the universal serial bus interface, the electronic device detects whether the voltage change value of the ID pin reaches a preset value, wherein, after detecting the voltage change of the ID pin When the value reaches the preset value, it is determined that there may be an external device connected to its universal serial bus interface. When it is detected that the voltage change value of the ID pin does not reach the preset value, it is determined that no external device is connected to its universal serial bus interface. .
作为一种实施方式,电子设备在为其通用串行总线接口的ID引脚提供第一电压之后,实时对ID引脚进行电压检测,得到实时电压,并计算第一电压与该实时电压的电压差值,将计算得到的电压差值作为其ID引脚的电压变化值。As an implementation, after the electronic device provides the first voltage to the ID pin of its universal serial bus interface, it detects the voltage of the ID pin in real time to obtain the real-time voltage, and calculates the voltage between the first voltage and the real-time voltage Difference, the calculated voltage difference is used as the voltage change value of its ID pin.
需要说明的是,由于外部设备的ID引脚接地,当外部设备接入电子设备的通用串行总线接口时,将使得电子设备的ID引脚同样接地,将ID引脚的电压拉低为0V。因此,本申请实施例中,将用于判断通用串行总线接口是否可能接入外部设备的预设值设置为第一电压的电压值,比如,电子设备在为其通用串行总线接口的ID提供的第一电压为0.5V时,前述预设值同样被配置为0.5V。It should be noted that since the ID pin of the external device is grounded, when the external device is connected to the USB interface of the electronic device, the ID pin of the electronic device will also be grounded, and the voltage of the ID pin will be pulled down to 0V . Therefore, in the embodiment of the present application, the preset value for judging whether the USB interface may be connected to an external device is set as the voltage value of the first voltage, for example, the electronic device is using the ID of the USB interface. When the provided first voltage is 0.5V, the aforementioned preset value is also configured as 0.5V.
在一实施方式中,若单刀双掷开关与ID引脚连接的输出端与比较器的正极输入端连接,且参考电压提供模组与比较器的负极输入端连接时,请参照图3,如图3所示,在单刀双掷开关未将ID引脚与第二电源模块接通,也未将ID引脚与比较器的正极输入端接通时,第一电压提供模组为比较器的正极输入端提供第一电压,参考电压提供模组为比较器的负极输入端提供参考电压,由于第一电压大于参考电压,比较器的输出端将输出高电压。In one embodiment, if the output terminal of the SPDT switch connected to the ID pin is connected to the positive input terminal of the comparator, and the reference voltage supply module is connected to the negative input terminal of the comparator, please refer to Figure 3, as As shown in Figure 3, when the SPDT switch does not connect the ID pin to the second power supply module, nor connects the ID pin to the positive input terminal of the comparator, the first voltage supply module is the comparator The positive input end provides a first voltage, and the reference voltage supply module provides a reference voltage for the negative input end of the comparator. Since the first voltage is greater than the reference voltage, the output end of the comparator will output a high voltage.
请结合参照图4,在单刀双掷开关将第一电压提供模组与ID引脚接通时,第一电压提供模组将同时为比较器的正极输入端、和ID引脚提供第一电压,此时,比较器的输出端将仍输出高电压。Please refer to Figure 4, when the SPDT switch connects the first voltage supply module to the ID pin, the first voltage supply module will simultaneously provide the first voltage to the positive input terminal of the comparator and the ID pin , at this time, the output terminal of the comparator will still output a high voltage.
若将预设值设置为第一电压的电压值本身,请参照图5,当有外部设备接入电子设备的通用串行总线接口时,通用串行总线接口的ID引脚以及比较器的正极输入端均被接地,此时,正极输入端的电压将由第一电压变化为0V(也即是ID引脚的电压变化值达到预设值),比较器的的输出电压将由高电压变化为低电压。因此,电子设备在检测到比较器输出端的输出电压由高电压变为低电压时,即可确定ID引脚的电压变化值达到预设值。If the preset value is set to the voltage value itself of the first voltage, please refer to Figure 5, when an external device is connected to the USB interface of the electronic device, the ID pin of the USB interface and the positive pole of the comparator The input terminals are all grounded. At this time, the voltage of the positive input terminal will change from the first voltage to 0V (that is, the voltage change value of the ID pin reaches the preset value), and the output voltage of the comparator will change from high voltage to low voltage. . Therefore, when the electronic device detects that the output voltage at the output terminal of the comparator changes from a high voltage to a low voltage, it can determine that the voltage change value of the ID pin reaches a preset value.
在另一实施方式中,若单刀双掷开关与ID引脚连接的输出端与比较器的负极输入端连接,且参考电压提供模组与比较器的正极输入端连接时,请参照图3,如图3所示,在单刀双掷开关未将ID引脚与第二电源模块接通,也未将ID引脚与比较器的正极输入端接通时,第一电压提供模组为比较器的正极输入端提供第一电压,参考电压提供模组为比较器的负极输入端提供参考电压,由于第一电压大于参考电压,比较器的输出端将输出低电压。In another embodiment, if the output terminal of the SPDT switch connected to the ID pin is connected to the negative input terminal of the comparator, and the reference voltage supply module is connected to the positive input terminal of the comparator, please refer to FIG. 3 , As shown in Figure 3, when the SPDT switch does not connect the ID pin to the second power supply module, nor connects the ID pin to the positive input terminal of the comparator, the first voltage supply module is a comparator The positive input end of the comparator provides a first voltage, and the reference voltage supply module provides a reference voltage for the negative input end of the comparator. Since the first voltage is greater than the reference voltage, the output end of the comparator will output a low voltage.
请参照图4,在单刀双掷开关将第一电压提供模组与ID引脚接通时,第一电压提供模组将同时为比较器的正极输入端、和ID引脚提供第一电压,此时,比较器的输出端将仍输出低电压。Please refer to FIG. 4, when the SPDT switch connects the first voltage supply module to the ID pin, the first voltage supply module will simultaneously provide the first voltage for the positive input terminal of the comparator and the ID pin, At this time, the output terminal of the comparator will still output a low voltage.
若将预设值设置为第一电压的电压值本身,请参照图5,当有外部设备接入电子设备的通用串行总线接口时,通用串行总线接口的ID引脚以及比较器的正极输入端均被接地,此时,正极输入端的电压将由第一电压变化为0V(也即是ID引脚的电压变化值达到预设值),比较器的的输出电压将由低电压变化为高电压。因此,电子设备在检测到比较器输出端的输出电压由低电压变为高电压时,即可确定ID引脚的电压变化值达到预设值。If the preset value is set to the voltage value itself of the first voltage, please refer to Figure 5, when an external device is connected to the USB interface of the electronic device, the ID pin of the USB interface and the positive pole of the comparator The input terminals are all grounded. At this time, the voltage of the positive input terminal will change from the first voltage to 0V (that is, the voltage change value of the ID pin reaches the preset value), and the output voltage of the comparator will change from low voltage to high voltage. . Therefore, when the electronic device detects that the output voltage at the output terminal of the comparator changes from a low voltage to a high voltage, it can determine that the voltage change value of the ID pin reaches a preset value.
在步骤203中,在输出电压发生变化时,控制单刀双掷开关接通ID引脚与第二电压提供模组,由第二电压提供模组为ID引脚提供第二电压。In step 203, when the output voltage changes, the SPDT switch is controlled to connect the ID pin and the second voltage supply module, and the second voltage supply module provides the ID pin with a second voltage.
本申请实施例中,电子设备在完成对其ID引脚上电压变化值的检测,且检测到该电压变化值达到预设值,也即是确定可能有外部设备接入其通用串行总线接口时,为ID引脚提供用于外部设备接入检测的第二电压,也即是将ID引脚上拉为高电压。In the embodiment of the present application, after the electronic device completes the detection of the voltage change value on its ID pin, and detects that the voltage change value reaches the preset value, it is determined that there may be an external device connected to its universal serial bus interface. , the ID pin is provided with a second voltage for external device access detection, that is, the ID pin is pulled up to a high voltage.
需要说明的是,本申请实施例中,之前为ID引脚所提供的第一电压,小于当前为ID引脚提供的第二电压,且该第一电压是远小于该第二电压。比如,电子设备为其ID引脚提供的第一电压为0.5V,而在检测到ID引脚的电压变化值达到预设值时,为其ID引脚提供的第二电压为3.3V。It should be noted that, in the embodiment of the present application, the first voltage previously provided for the ID pin is smaller than the second voltage currently provided for the ID pin, and the first voltage is much lower than the second voltage. For example, the first voltage provided by the electronic device to its ID pin is 0.5V, and when it is detected that the voltage change value of the ID pin reaches a preset value, the second voltage provided to its ID pin is 3.3V.
本申请实施例中,电子设备在完成对其ID引脚上电压变化值的检测,且检测到该电压变化值达到预设值,也即是确定可能有外部设备接入其通用串行总线接口时,为ID引脚提供用于外部设备接入检测的第二电压,也即是将ID引脚上拉为高电压。In the embodiment of the present application, after the electronic device completes the detection of the voltage change value on its ID pin, and detects that the voltage change value reaches the preset value, it is determined that there may be an external device connected to its universal serial bus interface. , the ID pin is provided with a second voltage for external device access detection, that is, the ID pin is pulled up to a high voltage.
需要说明的是,本申请实施例中,之前为ID引脚所提供的第一电压,小于当前为ID引脚提供的第二电压,且该第一电压是远小于该第二电压。比如,电子设备为其ID引脚提供的第一电压为0.5V,而在检测到ID引脚的电压变化值达到预设值时,为其ID引脚提供的第二电压为3.3V。It should be noted that, in the embodiment of the present application, the first voltage previously provided for the ID pin is smaller than the second voltage currently provided for the ID pin, and the first voltage is much smaller than the second voltage. For example, the first voltage provided by the electronic device to its ID pin is 0.5V, and when it is detected that the voltage change value of the ID pin reaches a preset value, the second voltage provided to its ID pin is 3.3V.
其中,请参照图6,在为通用串行总线接口的ID引脚提供第二电压时,电子设备可以控制单刀双掷开关接通ID引脚与第二电压提供模组,由第二电压提供模组为ID引脚提供第二电压。Wherein, please refer to FIG. 6, when providing the second voltage for the ID pin of the universal serial bus interface, the electronic device can control the single-pole double-throw switch to connect the ID pin and the second voltage supply module, and the second voltage provides The module provides the second voltage for the ID pin.
比如,第二电压提供模组的输出电压为3.3V,在通过单刀双掷开关接通ID引脚与第二电压提供模组时,第二电压模组将为ID引脚提供3.3V的第二电压,用于实现外部设备的接入检测。For example, the output voltage of the second voltage supply module is 3.3V. When the ID pin and the second voltage supply module are connected through a single-pole double-throw switch, the second voltage module will provide the first voltage of 3.3V for the ID pin. The second voltage is used to realize the access detection of the external equipment.
在步骤204中,检测ID引脚的当前状态是否为接地状态。In step 204, it is detected whether the current state of the ID pin is grounded.
需要说明的是,由于外部设备的ID引脚接地,当外部设备接入电子设备的通用串行总线接口时,将使得电子设备的ID引脚同样接地,也即是说,在外部设备接入电子设备的通用串行总线接口时,电子设备的ID引脚将呈现为接地状态。It should be noted that since the ID pin of the external device is grounded, when the external device is connected to the USB interface of the electronic device, the ID pin of the electronic device will also be grounded. When the universal serial bus interface of the electronic device is connected, the ID pin of the electronic device will be in a ground state.
因此,在本申请实施例中,可以根据ID引脚的当前状态,来确定是否有外部设备接入通用串行总线接口,其中,可以检测ID引脚的当前状态是否接地状态,在ID引脚的当前状态为接地状态时,确定有外部设备接入通用串行总线接口,在ID引脚的当前状态不为接地状态时,确定无外部设备接入通用串行总线接口。Therefore, in the embodiment of the present application, it can be determined whether an external device is connected to the universal serial bus interface according to the current state of the ID pin. When the current state of the pin is grounded, it is determined that an external device is connected to the universal serial bus interface, and when the current state of the ID pin is not in the grounded state, it is determined that no external device is connected to the universal serial bus interface.
在步骤205中,在ID引脚的当前状态为接地状态时,确定有外部设备接入通用串行总线接口,并通过通用串行总线接口向外部设备供电。In step 205, when the current state of the ID pin is grounded, it is determined that an external device is connected to the USB interface, and power is supplied to the external device through the USB interface.
本申请实施例中,电子设备在确定有外部设备接入其通用串行总线接口时,与外部设备建立电连接,并通过其通用串行总线接口的电源引脚为外部设备供电。In the embodiment of the present application, when the electronic device determines that an external device is connected to its universal serial bus interface, it establishes an electrical connection with the external device, and supplies power to the external device through the power pin of its universal serial bus interface.
在步骤206中,在向外部设备供电期间,获取通用串行总线接口的温度值;In step 206, during the period of supplying power to the external device, the temperature value of the universal serial bus interface is obtained;
容易理解的是,若通用串行总线接口的温度过高,将有可能烧毁通用串行总线接口,甚至损坏整个电子设备。而在电子设备通过通用串行总线接口为外部设备供电时,将使得其通用串行总线接口的温度迅速升高。为避免对外部设备供电而造成电子设备的损坏,在本申请实施例中,电子设备在向外部设备提供供电电压期间,实时从设置在通用串行总线接口处的温度传感器处获取通用串行总线接口的温度值,以判断通用串行总线接口的温度是否过高。It is easy to understand that if the temperature of the USB interface is too high, it may burn the USB interface and even damage the entire electronic device. However, when the electronic device supplies power to external devices through the USB interface, the temperature of the USB interface will rise rapidly. In order to avoid damage to the electronic equipment caused by power supply to the external equipment, in the embodiment of the present application, the electronic equipment obtains the universal serial bus voltage from the temperature sensor provided at the universal serial bus interface in real time during the period of supplying the power supply voltage to the external equipment. The temperature value of the interface to determine whether the temperature of the universal serial bus interface is too high.
在步骤207中,在获取到的温度值位于预设温度区间之内时,停止为外部设备供电。In step 207, when the obtained temperature value is within the preset temperature range, power supply to the external device is stopped.
本申请实施例中,在获取到通用串行总线接口的温度值之后,判断该温度值是否位于预设温度区间之内,其中,在该温度值位于预设温度区间之内时,说明通用串行总线接口的温度过高,此时停止向外部设备供电,避免通用串行总线接口的温度继续升高。In the embodiment of the present application, after obtaining the temperature value of the universal serial bus interface, it is judged whether the temperature value is within the preset temperature range, wherein, when the temperature value is within the preset temperature range, it means that the universal serial bus If the temperature of the serial bus interface is too high, stop supplying power to the external device at this time, so as to prevent the temperature of the universal serial bus interface from continuing to rise.
其中,可以将预设温度区间设置为[Tmin,+∞),Tmin表示可能造成电子设备损坏的最低温度值,具体可预先通过实验得到。Wherein, the preset temperature range can be set as [Tmin, +∞), and Tmin represents the lowest temperature value that may cause damage to the electronic device, which can be obtained through experiments in advance.
比如,预设温度区间被设置为[60℃,+∞),若获取到通用串行总线接口的温度值为37℃,则电子设备继续为外部设备供电;若获取到通用串行总线接口的温度值为67℃,则电子设备停止为外部设备供电。For example, the preset temperature range is set to [60°C, +∞), if the obtained temperature value of the universal serial bus interface is 37°C, the electronic device will continue to supply power to the external device; If the temperature value is 67°C, the electronic device stops supplying power to the external device.
在一实施例中,还提供了一种设备检测装置,请参照图9,图9为本申请实施例提供的设备检测装置的结构示意图。其中该设备检测装置应用于电子设备,该设备检测装置包括电压提供模块401、电压检测模块402、以及设备识别模块403,如下:In an embodiment, a device detection device is also provided, please refer to FIG. 9 , which is a schematic structural diagram of the device detection device provided in an embodiment of the present application. Wherein the device detection device is applied to electronic devices, the device detection device includes a voltage supply module 401, a voltage detection module 402, and a device identification module 403, as follows:
电压提供模块401,用于为通用串行总线接口的ID引脚提供第一电压;A voltage supply module 401, configured to provide a first voltage for the ID pin of the Universal Serial Bus interface;
电压检测模块402,用于检测ID引脚的电压变化值是否达到预设值;A voltage detection module 402, configured to detect whether the voltage change value of the ID pin reaches a preset value;
电压提供模块401,还用于在ID引脚的电压变化值达到预设值时,为ID引脚提供用于外部设备接入检测的第二电压,其中,第一电压小于第二电压;The voltage supply module 401 is further configured to provide the ID pin with a second voltage for external device access detection when the voltage change value of the ID pin reaches a preset value, wherein the first voltage is smaller than the second voltage;
设备识别模块403,用于根据ID引脚的当前状态,确定是否有外部设备接入通用串行总线接口。The device identification module 403 is configured to determine whether there is an external device connected to the universal serial bus interface according to the current state of the ID pin.
在一实施例中,提供了一种电子设备的设备检测电路,请参照图3,该设备检测电路包括通用串行总线接口、单刀双掷开关、第一电压提供模组、第二电压提供模组以及比较器。其中,通用串行总线接口的ID引脚与单刀双掷开关的输入端电连接,该单刀双掷开关的一输出端与比较器的一输入端电连接,还与第一电压提供模组电连接,该单刀双掷开关的另一输出端与第二电压提供模组电连接,比较器的另一输入端与参考电压提供模组电连接,该参考电压提供模组提供的参考电压小于第一电压提供模组提供的第一电压,第一电压提供模组所提供的第一电压小于第二电压提供模组所提供的第二电压。In one embodiment, a device detection circuit of an electronic device is provided. Please refer to FIG. groups and comparators. Wherein, the ID pin of the universal serial bus interface is electrically connected to the input end of the single-pole double-throw switch, and an output end of the single-pole double-throw switch is electrically connected to an input end of the comparator, and is also electrically connected to the first voltage supply module connected, the other output end of the single pole double throw switch is electrically connected to the second voltage supply module, the other input end of the comparator is electrically connected to the reference voltage supply module, and the reference voltage provided by the reference voltage supply module is lower than the first A first voltage provided by a voltage supply module, the first voltage provided by the first voltage supply module is lower than the second voltage provided by the second voltage supply module.
基于图3所示的设备检测电路,在一实施例中,电压提供模块401具体用于:Based on the device detection circuit shown in FIG. 3, in an embodiment, the voltage supply module 401 is specifically used for:
控制单刀双掷开关接通ID引脚与第一电压提供模组,由第一电压提供模组为ID引脚提供第一电压。The SPDT switch is controlled to connect the ID pin and the first voltage supply module, and the first voltage supply module supplies the ID pin with the first voltage.
基于图3所示的设备检测电路,在一实施例中,电压检测模块402具体用于:Based on the device detection circuit shown in FIG. 3, in an embodiment, the voltage detection module 402 is specifically used for:
检测比较器输出端的输出电压是否发生变化,其中,在输出电压发生变化时,确定ID引脚的电压变化值达到预设值。Detecting whether the output voltage at the output terminal of the comparator changes, wherein, when the output voltage changes, it is determined that the voltage change value of the ID pin reaches a preset value.
基于图3所示的设备检测电路,在一实施例中,电压提供模块401还具体用于:Based on the device detection circuit shown in FIG. 3, in an embodiment, the voltage supply module 401 is also specifically used for:
控制单刀双掷开关接通ID引脚与第二电压提供模组,由第二电压提供模组为ID引脚提供第二电压。The SPDT switch is controlled to connect the ID pin and the second voltage supply module, and the second voltage supply module provides the ID pin with a second voltage.
在一实施例中,设备识别模块403具体用于:In one embodiment, the device identification module 403 is specifically used to:
检测ID引脚的当前状态是否接地状态,其中,在ID引脚的当前状态为接地状态时,确定有外部设备接入通用串行总线接口。Detecting whether the current state of the ID pin is grounded, wherein, when the current state of the ID pin is grounded, it is determined that an external device is connected to the universal serial bus interface.
在一实施例中,电压提供模块401还用于:In an embodiment, the voltage supply module 401 is also used for:
在有外部设备接入通用串行总线接口时,通过通用串行总线接口向外部设备供电;When an external device is connected to the universal serial bus interface, power is supplied to the external device through the universal serial bus interface;
在向外部设备供电期间,获取通用串行总线接口的温度值;Obtain the temperature value of the universal serial bus interface during the period of power supply to the external device;
在获取到的温度值位于预设温度区间之内时,停止为外部设备供电。When the obtained temperature value is within the preset temperature range, power supply to the external device is stopped.
在一实施例中,电压提供模块401还具体用于:In an embodiment, the voltage supply module 401 is also specifically used for:
在获取到的温度值位于预设温度区间之内时,显示确认信息输入接口;When the obtained temperature value is within the preset temperature range, a confirmation message input interface is displayed;
在基于显示的确认信息输入接口接收到输入的确认信息时,停止为外部设备供电。Stop supplying power to the external device when the input interface receives the input confirmation information based on the displayed confirmation information.
具体实施时,以上各个模块可以作为独立的实体实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单位的具体实施可参见前面的实施例,在此不再赘述。During specific implementation, each of the above modules can be implemented as an independent entity, or can be combined arbitrarily as the same or several entities. The specific implementation of each of the above units can refer to the previous embodiments, and will not be repeated here.
由上可知,本实施例设备检测装置可以由电压提供模块401为通用串行总线接口的ID引脚提供第一电压;由电压检测模块402检测ID引脚的电压变化值是否达到预设值;由电压提供模块401在ID引脚的电压变化值达到预设值时,为ID引脚提供用于外部设备接入检测的第二电压,其中,第一电压小于第二电压;由设备识别模块403根据ID引脚的当前状态,确定是否有外部设备接入通用串行总线接口。该方案中,通过为通用串行总线接口的ID引脚提供一个低电压,并根据ID引脚的电压变化值是否达到预设值,来判断通用串行总线接口是否可能接入了外部设备,进而在通用串行总线接口可能接入外部设备时,为ID引脚提供一个用于外部设备接入检测的高电压,以实现外部设备的接入检测。由此,只需要在较短的时间内为ID引脚提供高电压,而在较长的其他时间为ID引脚提供低电压,相较而言,低电压对通用串行总线接口带来的腐蚀,将远低于高电压对通用串行总线接口带来的腐蚀,几乎可以忽略不计。由此,可以达到提通用串行总线接口使用寿命的目的。It can be seen from the above that the device detection device of this embodiment can provide the first voltage for the ID pin of the universal serial bus interface by the voltage supply module 401; whether the voltage change value of the ID pin is detected by the voltage detection module 402 reaches a preset value; When the voltage change value of the ID pin reaches a preset value, the voltage supply module 401 provides the ID pin with a second voltage for external device access detection, wherein the first voltage is less than the second voltage; the device identification module 403 Determine whether there is an external device connected to the USB interface according to the current state of the ID pin. In this scheme, by providing a low voltage for the ID pin of the universal serial bus interface, and according to whether the voltage change value of the ID pin reaches a preset value, it is judged whether the universal serial bus interface may be connected to an external device, Furthermore, when the USB interface may be connected to an external device, a high voltage for detecting the connection of the external device is provided to the ID pin, so as to realize the detection of the connection of the external device. Therefore, it is only necessary to provide a high voltage for the ID pin in a short period of time, and provide a low voltage for the ID pin in a relatively long period of time. Corrosion will be much lower than the corrosion caused by high voltage to the universal serial bus interface, and it can be almost ignored. Thus, the purpose of improving the service life of the universal serial bus interface can be achieved.
本申请实施例还提供一种电子设备。请参照图10,电子设备500包括处理器501以及存储器502。其中,处理器501与存储器502电性连接。The embodiment of the present application also provides an electronic device. Referring to FIG. 10 , an electronic device 500 includes a processor 501 and a memory 502 . Wherein, the processor 501 is electrically connected with the memory 502 .
处理器500是电子设备500的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器502内的计算机程序,以及调用存储在存储器502内的数据,执行电子设备500的各种功能并处理数据。The processor 500 is the control center of the electronic device 500. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or loading computer programs stored in the memory 502 and calling data stored in the memory 502, the processor 500 executes electronic various functions of the device 500 and process data.
存储器502可用于存储软件程序以及模块,处理器501通过运行存储在存储器502的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器502可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器502可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器502还可以包括存储器控制器,以提供处理器501对存储器502的访问。The memory 502 can be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by running the computer programs and modules stored in the memory 502 . Memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store operating systems, computer programs required by at least one function (such as sound playback function, image playback function, etc.); Data created by the use of electronic devices, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 502 may further include a memory controller to provide the processor 501 with access to the memory 502 .
在本申请实施例中,电子设备500中的处理器501会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器502中,并由处理器501运行存储在存储器502中的计算机程序,从而实现各种功能,如下:In the embodiment of the present application, the processor 501 in the electronic device 500 will follow the steps below to load the instructions corresponding to the process of one or more computer programs into the memory 502, and run the instructions stored in the memory 502 by the processor 501. The computer program in the computer, so as to realize various functions, as follows:
为通用串行总线接口的ID引脚提供第一电压;providing a first voltage for the ID pin of the universal serial bus interface;
检测ID引脚的电压变化值是否达到预设值;Detect whether the voltage change value of the ID pin reaches the preset value;
在ID引脚的电压变化值达到预设值时,为ID引脚提供用于外部设备接入检测的第二电压,其中,第一电压小于第二电压;When the voltage change value of the ID pin reaches a preset value, provide the ID pin with a second voltage for external device access detection, wherein the first voltage is smaller than the second voltage;
根据ID引脚的当前状态,确定是否有外部设备接入通用串行总线接口。According to the current state of the ID pin, it is determined whether there is an external device connected to the universal serial bus interface.
由上可知,本申请实施例通过为通用串行总线接口的ID引脚提供一个低电压,并根据ID引脚的电压变化值是否达到预设值,来判断通用串行总线接口是否可能接入了外部设备,进而在通用串行总线接口可能接入外部设备时,为ID引脚提供一个用于外部设备接入检测的高电压,以实现外部设备的接入检测。由此,只需要在较短的时间内为ID引脚提供高电压,而在较长的其他时间为ID引脚提供低电压,相较而言,低电压对通用串行总线接口带来的腐蚀,将远低于高电压对通用串行总线接口带来的腐蚀,几乎可以忽略不计。由此,可以达到提通用串行总线接口使用寿命的目的。As can be seen from the above, the embodiment of the present application provides a low voltage for the ID pin of the universal serial bus interface, and judges whether the universal serial bus interface may be connected according to whether the voltage change value of the ID pin reaches a preset value. The external device is connected, and then when the universal serial bus interface may be connected to the external device, a high voltage for the external device access detection is provided for the ID pin, so as to realize the external device access detection. Therefore, it is only necessary to provide a high voltage for the ID pin in a short period of time, and provide a low voltage for the ID pin in a relatively long period of time. Corrosion will be much lower than the corrosion caused by high voltage to the universal serial bus interface, and it can be almost ignored. Thus, the purpose of improving the service life of the universal serial bus interface can be achieved.
请一并参照图11,在某些实施方式中,电子设备500还可以包括:显示器503、射频电路504、音频电路505、电源506以及设备检测电路507。其中,其中,显示器503、射频电路504、音频电路505以及电源506分别与处理器501电性连接。Please refer to FIG. 11 together. In some embodiments, the electronic device 500 may further include: a display 503 , a radio frequency circuit 504 , an audio circuit 505 , a power supply 506 and a device detection circuit 507 . Wherein, the display 503 , the radio frequency circuit 504 , the audio circuit 505 and the power supply 506 are respectively electrically connected to the processor 501 .
显示器503可以用于显示由用户输入的信息或提供给用户的信息以及各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示器503可以包括显示面板,在某些实施方式中,可以采用液晶显示器(Liquid Crystal Display,LCD)、或者有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。The display 503 can be used to display information input by or provided to the user and various graphical user interfaces, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. The display 503 may include a display panel. In some implementation manners, the display panel may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD) or an organic light-emitting diode (Organic Light-Emitting Diode, OLED).
射频电路504可以用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。The radio frequency circuit 504 can be used to send and receive radio frequency signals to establish wireless communication with network equipment or other electronic equipment through wireless communication, and to send and receive signals with network equipment or other electronic equipment.
音频电路505可以用于通过扬声器、传声器提供用户与电子设备之间的音频接口。The audio circuit 505 can be used to provide an audio interface between the user and the electronic device through a speaker or a microphone.
电源506可以用于给电子设备500的各个部件供电。在一些实施例中,电源506可以通过电源管理系统与处理器501逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The power supply 506 may be used to power various components of the electronic device 500 . In some embodiments, the power supply 506 may be logically connected to the processor 501 through a power management system, so as to implement functions such as charging, discharging, and power consumption management through the power management system.
请参照图3,设备检测电路包括507通用串行总线接口、单刀双掷开关、第一电压提供模组、第二电压提供模组以及比较器。其中,通用串行总线接口的ID引脚与单刀双掷开关的输入端电连接,该单刀双掷开关的一输出端与比较器的一输入端电连接,还与第一电压提供模组电连接,该单刀双掷开关的另一输出端与第二电压提供模组电连接,比较器的另一输入端与参考电压提供模组电连接,该参考电压提供模组提供的参考电压小于第一电压提供模组提供的第一电压,第一电压提供模组所提供的第一电压小于第二电压提供模组所提供的第二电压。Please refer to FIG. 3 , the device detection circuit includes a 507 USB interface, a SPDT switch, a first voltage supply module, a second voltage supply module and a comparator. Wherein, the ID pin of the universal serial bus interface is electrically connected to the input end of the single-pole double-throw switch, and an output end of the single-pole double-throw switch is electrically connected to an input end of the comparator, and is also electrically connected to the first voltage supply module connected, the other output end of the single pole double throw switch is electrically connected to the second voltage supply module, the other input end of the comparator is electrically connected to the reference voltage supply module, and the reference voltage provided by the reference voltage supply module is lower than the first A first voltage provided by a voltage supply module, the first voltage provided by the first voltage supply module is lower than the second voltage provided by the second voltage supply module.
尽管图11中未示出,电子设备500还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 11 , the electronic device 500 may also include a camera, a Bluetooth module, etc., which will not be repeated here.
在某些实施方式中,在为通用串行总线接口的ID引脚提供第一电压时,处理器501可以执行以下步骤:In some embodiments, when providing the first voltage to the ID pin of the universal serial bus interface, the processor 501 may perform the following steps:
控制单刀双掷开关接通ID引脚与第一电压提供模组,由第一电压提供模组为ID引脚提供第一电压。The SPDT switch is controlled to connect the ID pin and the first voltage supply module, and the first voltage supply module supplies the ID pin with the first voltage.
在某些实施方式中,在检测ID引脚的电压变化值是否达到预设值时,处理器501可以执行以下步骤:In some implementations, when detecting whether the voltage change value of the ID pin reaches a preset value, the processor 501 may perform the following steps:
检测比较器输出端的输出电压是否发生变化,其中,在输出电压发生变化时,确定ID引脚的电压变化值达到预设值。Detecting whether the output voltage at the output terminal of the comparator changes, wherein, when the output voltage changes, it is determined that the voltage change value of the ID pin reaches a preset value.
在某些实施方式中,在为ID引脚提供用于外部设备接入检测的第二电压时,处理器501可以执行以下步骤:In some implementation manners, when the ID pin is provided with the second voltage for external device access detection, the processor 501 may perform the following steps:
控制单刀双掷开关接通ID引脚与第二电压提供模组,由第二电压提供模组为ID引脚提供第二电压。The SPDT switch is controlled to connect the ID pin and the second voltage supply module, and the second voltage supply module provides the ID pin with a second voltage.
在某些实施方式中,在根据ID引脚的当前状态,确定是否有外部设备接入通用串行总线接口时,处理器501可以执行以下步骤:In some embodiments, when determining whether an external device is connected to the USB interface according to the current state of the ID pin, the processor 501 may perform the following steps:
检测ID引脚的当前状态是否接地状态,其中,在ID引脚的当前状态为接地状态时,确定有外部设备接入通用串行总线接口。Detecting whether the current state of the ID pin is grounded, wherein, when the current state of the ID pin is grounded, it is determined that an external device is connected to the universal serial bus interface.
在某些实施方式中,在根据ID引脚的当前状态,确定是否有外部设备接入通用串行总线接口之后,处理器501还可以执行以下步骤:In some embodiments, after determining whether an external device is connected to the USB interface according to the current state of the ID pin, the processor 501 may also perform the following steps:
在有外部设备接入通用串行总线接口时,通过通用串行总线接口向外部设备供电;When an external device is connected to the universal serial bus interface, power is supplied to the external device through the universal serial bus interface;
在向外部设备供电期间,获取通用串行总线接口的温度值;Obtain the temperature value of the universal serial bus interface during the period of power supply to the external device;
在获取到的温度值位于预设温度区间之内时,停止为外部设备供电。When the obtained temperature value is within the preset temperature range, power supply to the external device is stopped.
在某些实施方式中,在在获取到的温度值位于预设温度区间之内时,停止为外部设备供电时,处理器501还可以执行以下步骤:In some implementations, when the acquired temperature value is within the preset temperature range, when power supply to the external device is stopped, the processor 501 may further perform the following steps:
在获取到的温度值位于预设温度区间之内时,显示确认信息输入接口;When the obtained temperature value is within the preset temperature range, a confirmation message input interface is displayed;
在基于显示的确认信息输入接口接收到输入的确认信息时,停止为外部设备供电。Stop supplying power to the external device when the input interface receives the input confirmation information based on the displayed confirmation information.
本申请实施例还提供一种存储介质,所述存储介质存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述任一实施例中的设备检测方法,比如:为通用串行总线接口的ID引脚提供第一电压;检测ID引脚的电压变化值是否达到预设值;在ID引脚的电压变化值达到预设值时,为ID引脚提供用于外部设备接入检测的第二电压,其中,第一电压小于第二电压;根据ID引脚的当前状态,确定是否有外部设备接入通用串行总线接口。An embodiment of the present application also provides a storage medium, the storage medium stores a computer program, and when the computer program is run on a computer, the computer is made to execute the device detection method in any of the above embodiments, for example: The ID pin of the universal serial bus interface provides a first voltage; detects whether the voltage change value of the ID pin reaches a preset value; when the voltage change value of the ID pin reaches a preset value, provides an external voltage for the ID pin The device accesses the detected second voltage, wherein the first voltage is lower than the second voltage; and according to the current state of the ID pin, it is determined whether there is an external device connected to the universal serial bus interface.
在本申请实施例中,存储介质可以是磁碟、光盘、只读存储器(Read Only Memory,ROM,)、或者随机存取记忆体(Random Access Memory,RAM)等。In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a read only memory (Read Only Memory, ROM), or a random access memory (Random Access Memory, RAM), or the like.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.
需要说明的是,对本申请实施例的设备检测方法而言,本领域普通技术人员可以理解实现本申请实施例的设备检测方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,所述计算机程序可存储于一计算机可读取存储介质中,如存储在电子设备的存储器中,并被该电子设备内的至少一个处理器执行,在执行过程中可包括如设备检测方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储器、随机存取记忆体等。It should be noted that, for the device detection method of the embodiment of the present application, those skilled in the art can understand that all or part of the flow of the device detection method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program , the computer program may be stored in a computer-readable storage medium, such as stored in a memory of an electronic device, and executed by at least one processor in the electronic device, and the execution process may include, for example, the device detection method Example flow. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, and the like.
对本申请实施例的设备检测装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,所述存储介质譬如为只读存储器,磁盘或光盘等。For the equipment detection device of the embodiment of the present application, its various functional modules may be integrated into one processing chip, or each module may exist separately physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. If the integrated modules are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium, such as read-only memory, magnetic disk or optical disk, etc. .
以上对本申请实施例所提供的一种设备检测方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。A device detection method, device, storage medium, and electronic equipment provided by the embodiments of the present application have been introduced in detail above. In this paper, specific examples are used to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only It is used to help understand the method and its core idea of this application; at the same time, for those skilled in the art, according to the idea of this application, there will be changes in the specific implementation and application scope. In summary, this specification The content should not be construed as a limitation of the application.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810411563.8A CN108681514B (en) | 2018-05-02 | 2018-05-02 | Device detection method and device, storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810411563.8A CN108681514B (en) | 2018-05-02 | 2018-05-02 | Device detection method and device, storage medium and electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108681514A true CN108681514A (en) | 2018-10-19 |
CN108681514B CN108681514B (en) | 2020-04-10 |
Family
ID=63801834
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810411563.8A Expired - Fee Related CN108681514B (en) | 2018-05-02 | 2018-05-02 | Device detection method and device, storage medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108681514B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110022573A (en) * | 2019-04-15 | 2019-07-16 | Oppo广东移动通信有限公司 | Smart card detection method and electronic equipment |
CN111241023A (en) * | 2020-01-19 | 2020-06-05 | 惠州Tcl移动通信有限公司 | Insertion detection circuit and method of flash memory card, and electronic device |
CN113055515A (en) * | 2021-03-04 | 2021-06-29 | Oppo广东移动通信有限公司 | Ultra-wideband data transmission method and equipment support |
CN113113958A (en) * | 2020-01-09 | 2021-07-13 | 广东小天才科技有限公司 | Charger and access detection method of to-be-charged equipment |
WO2022179305A1 (en) * | 2021-02-23 | 2022-09-01 | Oppo广东移动通信有限公司 | Data communication method and apparatus, and storage medium, electronic device and protective sleeve |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN204391372U (en) * | 2015-01-07 | 2015-06-10 | 浙江大学 | The portable wiring board of easily extensible |
CN205721762U (en) * | 2016-03-31 | 2016-11-23 | 维沃移动通信有限公司 | Interface Circuit and Portable Terminal of Universal Serial Bus USB Interface |
CN106374581A (en) * | 2016-10-31 | 2017-02-01 | 维沃移动通信有限公司 | A voltage output method of a charger and the charger |
US20170124010A1 (en) * | 2015-08-21 | 2017-05-04 | Apple Inc. | Contact corrosion mitigation |
CN106648857A (en) * | 2016-11-29 | 2017-05-10 | 维沃移动通信有限公司 | Method for starting OTG function of mobile terminal and mobile terminal |
-
2018
- 2018-05-02 CN CN201810411563.8A patent/CN108681514B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN204391372U (en) * | 2015-01-07 | 2015-06-10 | 浙江大学 | The portable wiring board of easily extensible |
US20170124010A1 (en) * | 2015-08-21 | 2017-05-04 | Apple Inc. | Contact corrosion mitigation |
CN205721762U (en) * | 2016-03-31 | 2016-11-23 | 维沃移动通信有限公司 | Interface Circuit and Portable Terminal of Universal Serial Bus USB Interface |
CN106374581A (en) * | 2016-10-31 | 2017-02-01 | 维沃移动通信有限公司 | A voltage output method of a charger and the charger |
CN106648857A (en) * | 2016-11-29 | 2017-05-10 | 维沃移动通信有限公司 | Method for starting OTG function of mobile terminal and mobile terminal |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110022573A (en) * | 2019-04-15 | 2019-07-16 | Oppo广东移动通信有限公司 | Smart card detection method and electronic equipment |
CN113113958A (en) * | 2020-01-09 | 2021-07-13 | 广东小天才科技有限公司 | Charger and access detection method of to-be-charged equipment |
CN111241023A (en) * | 2020-01-19 | 2020-06-05 | 惠州Tcl移动通信有限公司 | Insertion detection circuit and method of flash memory card, and electronic device |
CN111241023B (en) * | 2020-01-19 | 2021-10-26 | 惠州Tcl移动通信有限公司 | Insertion detection circuit and method of flash memory card, and electronic device |
WO2022179305A1 (en) * | 2021-02-23 | 2022-09-01 | Oppo广东移动通信有限公司 | Data communication method and apparatus, and storage medium, electronic device and protective sleeve |
CN113055515A (en) * | 2021-03-04 | 2021-06-29 | Oppo广东移动通信有限公司 | Ultra-wideband data transmission method and equipment support |
CN113055515B (en) * | 2021-03-04 | 2023-08-15 | Oppo广东移动通信有限公司 | Ultra-wideband data transmission method and equipment support |
Also Published As
Publication number | Publication date |
---|---|
CN108681514B (en) | 2020-04-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12013735B2 (en) | Electronic device, method of controlling charging by electronic device, and method of supplying power by power supply device | |
CN108681514A (en) | Equipment detection method, device, storage medium and electronic equipment | |
EP3416062B1 (en) | Method and terminal device for establishing connection between devices with universal serial bus usb type-c interface | |
CN108845655B (en) | Electronic equipment control method, device, control circuit and electronic equipment | |
WO2018129991A1 (en) | Charging method, charging device and terminal | |
CN108920397B (en) | Device identification method and device, storage medium and electronic device | |
CN106786960B (en) | Charging control method, device and terminal | |
US9529755B2 (en) | Apparatus and method of recognizing external device in a communication system | |
CN106227634B (en) | Charging reminding method and device and terminal | |
CN107632949A (en) | Data line identification circuit, method and terminal | |
CN108628713A (en) | Device detection method and device, storage medium and electronic device | |
CN105068959A (en) | A charging method and device for a terminal and a terminal with a data exchange function | |
CN106532876B (en) | Power supply control method and device and computer equipment | |
CN105071489B (en) | A kind of charging method and device of the terminal with data exchanging function | |
CN110768382A (en) | Wireless charging method, device, storage medium and electronic device | |
US11449176B2 (en) | Information processing system and method for avoiding execution of unintentional drawing operations | |
CN111262737B (en) | Port configuration management method and device, storage medium and terminal | |
CN108415856A (en) | Device compatibility method and related device | |
CN107069844B (en) | Charging method, device and terminal | |
CN110190641A (en) | Charging control circuit, terminal equipment and data line | |
CN107577567A (en) | Mainboard test circuit and Related product | |
CN108268393A (en) | The processing method and mobile terminal of a kind of access device | |
CN108271092A (en) | The processing method and mobile terminal of a kind of access device | |
CN106658357B (en) | Bluetooth data processing method and device and terminal | |
CN113055515B (en) | Ultra-wideband data transmission method and equipment support |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200410 |