CN105048018B - The charging method and device of a kind of terminal with data exchanging function - Google Patents

The charging method and device of a kind of terminal with data exchanging function Download PDF

Info

Publication number
CN105048018B
CN105048018B CN201510528508.3A CN201510528508A CN105048018B CN 105048018 B CN105048018 B CN 105048018B CN 201510528508 A CN201510528508 A CN 201510528508A CN 105048018 B CN105048018 B CN 105048018B
Authority
CN
China
Prior art keywords
terminal
usb interface
voltage
data exchange
pin
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.)
Expired - Fee Related
Application number
CN201510528508.3A
Other languages
Chinese (zh)
Other versions
CN105048018A (en
Inventor
李路路
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201510528508.3A priority Critical patent/CN105048018B/en
Publication of CN105048018A publication Critical patent/CN105048018A/en
Application granted granted Critical
Publication of CN105048018B publication Critical patent/CN105048018B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Landscapes

  • Charge And Discharge Circuits For Batteries Or The Like (AREA)
  • Telephone Function (AREA)

Abstract

本发明实施例公开了一种具有数据交换功能的终端的充电方法和装置,该充电方法包括:如果所述终端的USB接口与数据交换OTG转接线相连时,检测所述终端的USB接口的电源引脚是否接收到电压信号;若是,将所述终端切换为执行设备充电访问模式并控制所述终端充电;若否,则检测所述终端的USB接口的标识引脚的电压值,并执行相应控制。本发明通过检测终端的USB接口的电源引脚是否接收到电压信号,以此判断将终端切换为执行设备充电访问模式,还是对终端的USB接口的标识引脚的电压值进行检测以执行相应控制,解决了现有技术中终端无法通过OTG转接线进行充电的问题。

The embodiment of the present invention discloses a charging method and device for a terminal with a data exchange function. The charging method includes: if the USB interface of the terminal is connected to the OTG transfer line for data exchange, detect the power supply of the USB interface of the terminal Whether the pin receives a voltage signal; if so, switch the terminal to the device charging access mode and control the charging of the terminal; if not, detect the voltage value of the identification pin of the USB interface of the terminal, and execute the corresponding control. The present invention detects whether the power supply pin of the USB interface of the terminal receives a voltage signal, thereby judging whether to switch the terminal to the execution device charging access mode, or to detect the voltage value of the identification pin of the USB interface of the terminal to perform corresponding control , which solves the problem in the prior art that the terminal cannot be charged through the OTG adapter cable.

Description

一种具有数据交换功能的终端的充电方法和装置A charging method and device for a terminal with data exchange function

技术领域technical field

本发明涉及充电技术,尤其涉及一种具有数据交换功能的终端的充电方法和装置。The invention relates to charging technology, in particular to a charging method and device for a terminal with data exchange function.

背景技术Background technique

随着外围设备的多样化与高速传输的需求,数据交换(On-The-Go,OTG)功能在电子终端设备中应用也越来越广泛,OTG将会逐渐成为未来电子产品的基本配置功能。With the diversification of peripheral equipment and the demand for high-speed transmission, the data exchange (On-The-Go, OTG) function is more and more widely used in electronic terminal equipment, and OTG will gradually become the basic configuration function of future electronic products.

以手机终端为例,如图1所示为现有技术提供的手机的USB接口的示意图,该USB接口具有接地引脚GND、标识引脚ID、正电压数据引脚D+、负电压数据引脚D-和电源引脚VBUS。对于支持OTG功能的手机,当OTG转接线与手机的USB接口连接时,手机执行数据交换访问模式,此时手机USB接口的VBUS引脚输出5V电压,终端通过OTG转接线进行OTG设备的检测和识别。当终端通过OTG转接线检测到有OTG设备接入手机时,处于数据交换访问模式的手机识别该OTG设备并与该OTG设备进行数据交换通信。Taking a mobile phone terminal as an example, as shown in Figure 1, it is a schematic diagram of a USB interface of a mobile phone provided by the prior art. The USB interface has a ground pin GND, an identification pin ID, a positive voltage data pin D+, and a negative voltage data pin D- and power supply pin VBUS. For mobile phones that support the OTG function, when the OTG adapter cable is connected to the USB interface of the mobile phone, the mobile phone executes the data exchange access mode. At this time, the VBUS pin of the USB interface of the mobile phone outputs 5V voltage, and the terminal detects the OTG device through the OTG adapter cable. identify. When the terminal detects that an OTG device is connected to the mobile phone through the OTG adapter cable, the mobile phone in the data exchange access mode recognizes the OTG device and performs data exchange communication with the OTG device.

由此可知,现有的OTG转接线仅作为终端访问外接OTG设备的数据线,用于终端与OTG设备的连接和通信,存在功能单一的缺陷。当OTG转接线将外接电源与终端连接时,由于OTG转接线中的ID引脚与GND引脚相连,相应的手机的ID引脚接地,因此终端处于数据交换访问模式,则终端无法通过OTG转接线进行充电,由此降低了用户体验的便捷度。It can be seen that the existing OTG adapter cable is only used as a data line for the terminal to access the external OTG device, and is used for connection and communication between the terminal and the OTG device, and has a defect of single function. When the OTG transfer cable connects the external power supply to the terminal, since the ID pin in the OTG transfer cable is connected to the GND pin, and the ID pin of the corresponding mobile phone is grounded, the terminal is in the data exchange access mode, and the terminal cannot pass the OTG transfer. Wired for charging, thus reducing the convenience of user experience.

发明内容Contents of the invention

本发明提供一种具有数据交换功能的终端的充电方法和装置,以解决现有技术中终端无法通过OTG转接线进行充电的问题。The present invention provides a charging method and device for a terminal with a data exchange function to solve the problem in the prior art that the terminal cannot be charged through an OTG transfer line.

第一方面,本发明实施例提供了一种具有数据交换功能的终端的充电方法,包括:In a first aspect, an embodiment of the present invention provides a charging method for a terminal with a data exchange function, including:

如果所述终端的USB接口与数据交换OTG转接线相连时,检测所述终端的USB接口的电源引脚是否接收到电压信号;If the USB interface of the terminal is connected to the data exchange OTG transfer line, detect whether the power supply pin of the USB interface of the terminal receives a voltage signal;

若是,将所述终端切换为执行设备充电访问模式并控制所述终端充电;If so, switch the terminal to the device charging access mode and control the charging of the terminal;

若否,则检测所述终端的USB接口的标识引脚的电压值,并执行相应控制。If not, detect the voltage value of the identification pin of the USB interface of the terminal, and perform corresponding control.

第二方面,本发明实施例还提供了一种具有数据交换功能的终端的充电装置,包括:In the second aspect, the embodiment of the present invention also provides a charging device for a terminal with a data exchange function, including:

电源引脚检测模块,用于当所述终端的通用串行总线USB接口与数据交换OTG转接线相连时,检测所述终端的USB接口的电源引脚是否接收到电压信号;The power pin detection module is used to detect whether the power pin of the USB interface of the terminal receives a voltage signal when the USB interface of the terminal is connected to the data exchange OTG transfer wire;

访问模式切换模块,用于当检测到所述终端的USB接口的电源引脚接收到电压信号时,将所述终端切换为执行设备充电访问模式并控制所述终端充电;An access mode switching module, configured to switch the terminal to an access mode for performing device charging and control charging of the terminal when it is detected that the power pin of the USB interface of the terminal receives a voltage signal;

标识引脚检测模块,用于当检测到所述终端的USB接口的电源引脚未接收到电压信号时,检测所述终端的USB接口的标识引脚的电压值,并执行相应控制。The identification pin detection module is used to detect the voltage value of the identification pin of the USB interface of the terminal when it is detected that the power supply pin of the USB interface of the terminal does not receive a voltage signal, and perform corresponding control.

本发明提供的一种具有数据交换功能的终端的充电方法和装置,通过在所述终端的通用串行总线USB接口与数据交换OTG转接线相连时,检测所述终端的USB接口的电源引脚是否接收到电压信号;当检测到接收到电压信号时,将终端切换为执行设备充电访问模式并控制终端充电;如果没有接收到电压信号,则检测终端的USB接口的标识引脚的电压值,并执行相应控制。本发明通过检测所述终端的USB接口的电源引脚是否接收到电压信号,以此判断将终端切换为执行设备充电访问模式,还是对终端的USB接口的标识引脚的电压值进行检测以执行相应控制。本发明解决了现有技术中终端无法通过OTG转接线进行充电的问题。A charging method and device for a terminal with a data exchange function provided by the present invention detects the power supply pin of the USB interface of the terminal when the USB interface of the terminal is connected to the OTG adapter cable for data exchange Whether a voltage signal is received; when a voltage signal is detected, switch the terminal to the device charging access mode and control terminal charging; if no voltage signal is received, detect the voltage value of the identification pin of the USB interface of the terminal, and implement corresponding controls. The present invention detects whether the power supply pin of the USB interface of the terminal receives a voltage signal, thereby judging whether to switch the terminal to the execution device charging access mode, or to detect the voltage value of the identification pin of the USB interface of the terminal to execute Control accordingly. The invention solves the problem in the prior art that the terminal cannot be charged through the OTG transfer line.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图做一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为现有技术提供的手机的USB接口的示意图;Fig. 1 is the schematic diagram of the USB interface of the mobile phone that prior art provides;

图2是本发明实施例一提供的一种具有数据交换功能的终端的充电方法的流程图;FIG. 2 is a flow chart of a charging method for a terminal with a data exchange function provided by Embodiment 1 of the present invention;

图3是本发明实施例二提供的一种具有数据交换功能的终端的充电方法的流程图;FIG. 3 is a flow chart of a charging method for a terminal with a data exchange function provided by Embodiment 2 of the present invention;

图4是本发明实施例三提供的一种具有数据交换功能的终端的充电装置的示意图。FIG. 4 is a schematic diagram of a charging device for a terminal with a data exchange function provided by Embodiment 3 of the present invention.

具体实施方式detailed description

为使本发明的目的、技术方案和优点更加清楚,以下将参照本发明实施例中的附图,通过实施方式清楚、完整地描述本发明的技术方案,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described through implementation with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are the embodiment of the present invention. Some, but not all, embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

由现有技术可知,当OTG转接线插入终端的USB接口时,终端处于数据交换访问模式,此时终端的USB接口的电源引脚会输出5V电压,导致终端无法充电。It can be seen from the prior art that when the OTG adapter cable is inserted into the USB interface of the terminal, the terminal is in the data exchange access mode. At this time, the power pin of the USB interface of the terminal will output a voltage of 5V, resulting in that the terminal cannot be charged.

实施例一Embodiment one

图2为本发明实施例一提供的一种具有数据交换功能的终端的充电方法的流程图,该实施例的技术方案可适用于具有OTG功能的终端通过OTG转接线连接外接电源以进行充电的情况。终端可以为任意具有OTG功能的电子设备,例如手机、平板电脑等。该方法可以由具有OTG功能的终端的充电装置来执行,该装置可以采用软件和/或硬件的方式实现,配置在终端中执行。如图2所示,该具有数据交换功能的终端的充电方法包括如下操作:Fig. 2 is a flow chart of a charging method for a terminal with a data exchange function provided by Embodiment 1 of the present invention. The technical solution of this embodiment is applicable to a terminal with an OTG function connected to an external power supply through an OTG transfer cable for charging. Condition. The terminal can be any electronic device with an OTG function, such as a mobile phone, a tablet computer, and the like. The method can be executed by a charging device of a terminal having an OTG function, and the device can be implemented in software and/or hardware, and configured to be executed in the terminal. As shown in Figure 2, the charging method of the terminal with data exchange function includes the following operations:

S110、如果所述终端的USB接口与数据交换OTG转接线相连时,检测所述终端的USB接口的电源引脚是否接收到电压信号。S110. If the USB interface of the terminal is connected to the data exchange OTG transfer cable, detect whether the power pin of the USB interface of the terminal receives a voltage signal.

已知终端的USB接口具有接地引脚GND、标识引脚ID、正电压数据引脚D+、负电压数据引脚D-和电源引脚VBUS。当终端的USB接口有OTG转接线插入时,首先强制检测终端USB接口的电源引脚VBUS是否接收到电压信号,以作为切换终端访问模式的依据。The USB interface of the known terminal has a ground pin GND, an identification pin ID, a positive voltage data pin D+, a negative voltage data pin D-, and a power pin VBUS. When an OTG adapter cable is inserted into the USB interface of the terminal, it is first mandatory to detect whether the power pin VBUS of the USB interface of the terminal receives a voltage signal as a basis for switching the terminal access mode.

本步骤通过将终端的USB接口的电源引脚是否接收到电压信号作为强制终端进入充电状态的判断依据,以在终端的USB接口的电源引脚接收到电压信号时强制终端切换为执行设备充电访问模式。In this step, whether the power pin of the USB interface of the terminal receives a voltage signal is used as the judgment basis for forcing the terminal to enter the charging state, so that when the power pin of the USB interface of the terminal receives a voltage signal, the terminal is forced to switch to perform device charging access model.

S120、如果接收到电压信号,将所述终端切换为执行设备充电访问模式并控制所述终端充电。S120. If a voltage signal is received, switch the terminal to an access mode for performing device charging and control charging of the terminal.

当检测到终端的USB接口的电源引脚接收到电压信号时,此时将终端切换为执行设备充电访问模式,以实现终端充电。当OTG转接线将外接电源接入终端时,处于设备充电访问模式的终端可通过OTG转接线进行充电。这样就避免了插入OTG转接线后终端始终处于数据交换访问模式导致终端无法充电的情况。When it is detected that the power supply pin of the USB interface of the terminal receives a voltage signal, the terminal is switched to the device charging access mode at this time, so as to realize terminal charging. When the OTG adapter cable connects the external power supply to the terminal, the terminal in the device charging access mode can be charged through the OTG adapter cable. This avoids the situation that the terminal is always in the data exchange access mode after the OTG adapter cable is inserted, causing the terminal to fail to charge.

本步骤中,只要检测到终端的USB接口的电源引脚接收到电压信号,则强制终端切换为设备充电访问模式,从而使OTG转接线可以用作电源设备对终端进行充电的连接线,在电源设备通过OTG转接线接入终端时可进行充电。In this step, as long as it is detected that the power pin of the USB interface of the terminal receives a voltage signal, the terminal is forced to switch to the device charging access mode, so that the OTG adapter cable can be used as a connection line for the power supply device to charge the terminal. The device can be charged when it is connected to the terminal through an OTG adapter cable.

S130、如果没有接收到电压信号,则检测所述终端的USB接口的标识引脚的电压值,并执行相应控制。S130. If no voltage signal is received, detect the voltage value of the identification pin of the USB interface of the terminal, and perform corresponding control.

当检测到终端的USB接口的电源引脚没有接收到电压信号时,对终端USB接口的标识引脚的电压值进行检测,以根据检测结果判断是否将终端切换为数据交换访问模式。When it is detected that the power supply pin of the USB interface of the terminal does not receive a voltage signal, the voltage value of the identification pin of the USB interface of the terminal is detected to judge whether to switch the terminal to the data exchange access mode according to the detection result.

本发明实施例提供的一种具有数据交换功能的终端的充电方法,通过在所述终端的USB接口与OTG转接线相连时,检测终端的USB接口的电源引脚是否接收到电压信号,并在接收到电压信号时判定将终端切换为执行设备充电访问模式;或者在未接收到电源信号时,对终端的USB接口的标识引脚的电压值进行检测,以进一步判断是否执行数据交换访问模式。本发明解决了现有技术中终端无法通过OTG转接线进行充电的问题,并且实现了终端在设备充电访问模式和数据交换访问模式之间的切换,拓展了OTG转接线的功能。A charging method for a terminal with a data exchange function provided by an embodiment of the present invention is to detect whether the power pin of the USB interface of the terminal receives a voltage signal when the USB interface of the terminal is connected to an OTG transfer cable, and then When the voltage signal is received, it is determined to switch the terminal to the device charging access mode; or when the power signal is not received, the voltage value of the identification pin of the USB interface of the terminal is detected to further determine whether to execute the data exchange access mode. The invention solves the problem that the terminal cannot be charged through the OTG transfer line in the prior art, realizes the switching of the terminal between the device charging access mode and the data exchange access mode, and expands the function of the OTG transfer line.

实施例二Embodiment two

图3为本发明实施例二提供的一种具有数据交换功能的终端充电方法的流程图。该方法可以由具有OTG功能的终端的充电装置来执行,该装置可以采用软件和/或硬件的方式实现,配置在终端中执行。如图3所示,该具有数据交换功能的终端的充电方法包括如下操作:FIG. 3 is a flow chart of a terminal charging method with a data exchange function provided by Embodiment 2 of the present invention. The method can be executed by a charging device of a terminal having an OTG function, and the device can be implemented in software and/or hardware, and configured to be executed in the terminal. As shown in Figure 3, the charging method of the terminal with data exchange function includes the following operations:

S201、检测所述终端的USB接口的电源引脚处的电压值是否大于或等于设定门限值。若是,则执行S202;若否,则执行S203。S201. Detect whether the voltage value at the power pin of the USB interface of the terminal is greater than or equal to a set threshold value. If yes, execute S202; if not, execute S203.

示例性的,当有OTG转接线接入所述终端的USB接口时,对所述终端的USB接口的电源引脚处的电压值进行检测,并将所述电压值与设定门限值进行比较,判断所述电源引脚处的电压值是否大于或等于设定门限值。例如所述设定门限值可以设置为5V,在此对所述设定门限值不作具体限定。Exemplarily, when an OTG adapter cable is connected to the USB interface of the terminal, the voltage value at the power pin of the USB interface of the terminal is detected, and the voltage value is compared with the set threshold value comparing and judging whether the voltage value at the power supply pin is greater than or equal to the set threshold value. For example, the set threshold value may be set to 5V, and the set threshold value is not specifically limited here.

本步骤中通过检测所述终端的USB接口的电源引脚处的电压值是否大于或等于设定门限值,用于判断所述终端的USB接口是否有电源设备接入,即是否接收到电压信号。本步骤可以在终端接入OTG转接线的情况下,使得终端还能够进行电源设备的接入检测,解决了现有OTG转接线不能用于连接终端与电源设备并对所述终端进行充电的问题。In this step, by detecting whether the voltage value at the power supply pin of the USB interface of the terminal is greater than or equal to the set threshold value, it is used to determine whether the USB interface of the terminal has a power supply device connected, that is, whether the voltage is received Signal. This step can enable the terminal to detect the access of the power supply equipment when the terminal is connected to the OTG adapter cable, which solves the problem that the existing OTG adapter cable cannot be used to connect the terminal and the power supply equipment and charge the terminal .

S202、若所述终端的USB接口的电源引脚处的电压值大于或等于设定门限值,则确定接收到电压信号,将所述终端切换为执行设备充电访问模式,控制所述终端充电。S202. If the voltage value at the power supply pin of the USB interface of the terminal is greater than or equal to the set threshold value, then determine that a voltage signal is received, switch the terminal to the access mode for performing device charging, and control the charging of the terminal .

上述步骤具体可以是,当所述终端的USB接口电源引脚处的电压值与设定门限值的比较结果,可以确定接收到电压信号,即终端通过OTG转接线接入电源设备时,将所述终端切换为执行设备充电访问模式,利用接入的电源设备对所述终端进行充电。The above steps may specifically be that, when the voltage value at the power supply pin of the USB interface of the terminal is compared with the set threshold value, it can be determined that the voltage signal is received, that is, when the terminal is connected to the power supply device through the OTG adapter cable, the The terminal is switched to the access mode of executing device charging, and the terminal is charged by using the connected power supply device.

S203、若所述终端的USB接口的电源引脚处的电压值小于设定门限值,则检测所述终端的USB接口的标识引脚的电压值是否为设定低电平。若是,则执行S204;若否,则继续执行S201,即继续检测所述终端的USB接口的电源引脚处的电压值是否大于或等于设定门限值。S203. If the voltage value at the power supply pin of the USB interface of the terminal is less than a set threshold value, detect whether the voltage value of the identification pin of the USB interface of the terminal is a set low level. If yes, execute S204; if not, continue to execute S201, that is, continue to detect whether the voltage value at the power pin of the USB interface of the terminal is greater than or equal to the set threshold value.

具体的,可以是当确定所述终端的USB接口处通过OTG转接线接入的设备并非电源设备时,终端切换为执行数据交换访问模式,对所述终端的USB接口的标识引脚的电压值是否为设定低电平进行检测。Specifically, when it is determined that the device connected to the USB interface of the terminal through the OTG adapter cable is not a power supply device, the terminal switches to the data exchange access mode, and the voltage value of the identification pin of the USB interface of the terminal Whether to detect the set low level.

S204、若所述终端的USB接口的标识引脚的电压值为设定低电平,则将所述终端切换为执行数据交换访问模式。S204. If the voltage value of the identification pin of the USB interface of the terminal is set to a low level, switch the terminal to a data exchange access mode.

当终端USB接口的标识引脚为设定低电平时,说明终端的USB接口处检测到有OTG设备接入,那么此时终端可以对接入的OTG设备进行OTG检测、识别和访问,进而与OTG设备进行数据交换。When the identification pin of the USB interface of the terminal is set to a low level, it means that an OTG device is detected at the USB interface of the terminal. At this time, the terminal can perform OTG detection, identification and access to the connected OTG device, and then communicate with the OTG device. OTG equipment for data exchange.

S205、将所述终端切换为执行数据交换访问模式之后,控制所述终端的USB接口的电源引脚输出电压。S205. After switching the terminal to the data exchange access mode, control the output voltage of the power supply pin of the USB interface of the terminal.

在数据交换访问模式下,当终端的USB接口处有OTG设备接入时,控制所述终端的USB接口的电源引脚输出预设电压值,供给外接OTG设备,以实现终端与OTG设备的数据通信。示例性的,所述预设电压值可以为5V,在此只是对预设电压值进行示例而并非具体限定。In the data exchange access mode, when an OTG device is connected to the USB interface of the terminal, the power supply pin of the USB interface of the terminal is controlled to output a preset voltage value, which is supplied to the external OTG device to realize the data exchange between the terminal and the OTG device. communication. Exemplarily, the preset voltage value may be 5V, which is just an example of the preset voltage value and not specifically limited.

需要说明的是,当终端通过OTG转接线接入的设备为存储设备时,终端的VBUS引脚会处于高阻状态,此时终端无法切换为执行充电访问模式,可以将所述存储设备作为OTG设备进行处理,即判断终端的标识引脚ID的电压值是否为设定低电平,若是,则终端USB接口的VBUS引脚输出5V电源,完成与与外接所述存储设备的数据交换通信。It should be noted that when the device connected to the terminal through the OTG adapter cable is a storage device, the VBUS pin of the terminal will be in a high-impedance state. At this time, the terminal cannot switch to the charging access mode, and the storage device can be used as an OTG The device performs processing, that is, judges whether the voltage value of the identification pin ID of the terminal is a set low level, and if so, the VBUS pin of the terminal USB interface outputs a 5V power supply, and completes the data exchange communication with the external storage device.

本发明实施例二提供的一种具有数据交换功能的终端的充电方法,通过检测所述终端的USB接口的电源引脚处的电压值是否大于或等于设定门限值,并依此判断将所述终端切换为执行设备充电访问模式,还是对所述终端的USB接口的标识引脚的电压值是否为设定低电平进行检测和判断,为进行数据交换与否提供依据,解决了现有技术中终端无法通过OTG转接线进行充电的问题,并且实现了设备充电访问模式和数据交换访问模式的切换,拓展了OTG转接线的功能。Embodiment 2 of the present invention provides a charging method for a terminal with a data exchange function, by detecting whether the voltage value at the power pin of the USB interface of the terminal is greater than or equal to the set threshold value, and judging accordingly The terminal is switched to the charging access mode of the execution device, and whether the voltage value of the identification pin of the USB interface of the terminal is a set low level is detected and judged, so as to provide a basis for data exchange or not, and solve the problem There is a problem that the terminal cannot be charged through the OTG adapter cable in the technology, and the switch between the device charging access mode and the data exchange access mode is realized, and the function of the OTG adapter cable is expanded.

实施例三Embodiment three

图4为本发明实施例三提供的一种具有数据交换功能的终端的充电装置的示意图。该装置可以采用软件和/或硬件的方式执行上述实施例所述的具有OTG功能的终端的充电方法,该装置配置在终端中执行。FIG. 4 is a schematic diagram of a charging device for a terminal with a data exchange function provided by Embodiment 3 of the present invention. The device can implement the method for charging a terminal with an OTG function described in the above-mentioned embodiments in the form of software and/or hardware, and the device is configured to be executed in the terminal.

本实施例提供的具有数据交换功能的终端的充电装置包括:电源引脚检测模块310、访问模式切换模块320和标识引脚检测模块330。The charging device for a terminal with a data exchange function provided in this embodiment includes: a power pin detection module 310 , an access mode switching module 320 and an identification pin detection module 330 .

其中,电源引脚检测模块310用于当所述终端的通用串行总线USB接口与数据交换OTG转接线相连时,检测所述终端的USB接口的电源引脚是否接收到电压信号;访问模式切换模块320用于当检测到所述终端的USB接口的电源引脚接收到电压信号时,将所述终端切换为执行设备充电访问模式并控制所述终端充电;标识引脚检测模块330用于当检测到所述终端的USB接口的电源引脚未接收到电压信号时,检测所述终端的USB接口的标识引脚的电压值,并执行相应控制。Wherein, the power pin detection module 310 is used to detect whether the power pin of the USB interface of the terminal receives a voltage signal when the USB interface of the terminal is connected to the data exchange OTG transfer line; the access mode is switched The module 320 is used to switch the terminal to execute device charging access mode and control the charging of the terminal when it detects that the power supply pin of the USB interface of the terminal receives a voltage signal; the identification pin detection module 330 is used when When it is detected that the power supply pin of the USB interface of the terminal does not receive a voltage signal, the voltage value of the identification pin of the USB interface of the terminal is detected, and corresponding control is performed.

可选地所述电源引脚检测模块310具体用于:检测所述终端的USB接口的电源引脚处的电压值是否大于或等于设定门限值,若是,则确定接收到电压信号。Optionally, the power pin detection module 310 is specifically configured to: detect whether the voltage value at the power pin of the USB interface of the terminal is greater than or equal to a set threshold value, and if so, determine that a voltage signal is received.

可选地所述设定门限值为5V。Optionally, the set threshold value is 5V.

可选地所述标识引脚检测模块330包括:引脚电平检测单元331和数据访问切换单元332。Optionally, the identification pin detection module 330 includes: a pin level detection unit 331 and a data access switching unit 332 .

其中,引脚电平检测单元331用于检测所述终端的USB接口的标识引脚的电压值是否为设定低电平;数据访问切换单元332用于当检测到所述终端的USB接口的标识引脚的电压值为设定低电平时,则将所述终端切换为执行数据交换访问模式。Wherein, the pin level detection unit 331 is used to detect whether the voltage value of the identification pin of the USB interface of the terminal is a set low level; the data access switching unit 332 is used to When the voltage value of the identification pin is set to a low level, the terminal is switched to a data exchange access mode.

可选地所述充电装置还包括:引脚电压输出单元333。Optionally, the charging device further includes: a pin voltage output unit 333 .

其中,引脚电压输出单元333用于在所述数据访问切换单元332将所述终端切换为执行数据交换访问模式之后,控制所述终端的USB接口的电源引脚输出电压。Wherein, the pin voltage output unit 333 is configured to control the output voltage of the power pin of the USB interface of the terminal after the data access switching unit 332 switches the terminal to the data exchange access mode.

本发明提供的一种具有数据交换功能的终端的装置,通过电源引脚检测模块在所述终端的通用串行总线USB接口与数据交换OTG转接线相连时,检测所述终端的USB接口的电源引脚是否接收到电压信号。访问模式切换模块当接收到电压信号时,将所述终端切换为执行设备充电访问模式并控制所述终端充电;标识引脚检测模块在没有接收到电压信号的情况下,检测所述终端的USB接口的标识引脚的电压值,并执行相应控制。本实施例解决了现有技术中终端无法通过OTG转接线进行充电的问题,并且实现了终端在设备充电访问模式和数据交换访问模式之间的切换,拓展了OTG转接线的功能,为用户提供了更加便捷的服务体验。A terminal device with a data exchange function provided by the present invention detects the power supply of the USB interface of the terminal when the Universal Serial Bus USB interface of the terminal is connected to the data exchange OTG transfer line through the power pin detection module Whether the pin receives a voltage signal. When the access mode switching module receives the voltage signal, it switches the terminal to the device charging access mode and controls the charging of the terminal; when the identification pin detection module does not receive the voltage signal, it detects the USB port of the terminal. The voltage value of the identification pin of the interface, and perform corresponding control. This embodiment solves the problem that the terminal cannot be charged through the OTG adapter cable in the prior art, and realizes the switching of the terminal between the device charging access mode and the data exchange access mode, expands the function of the OTG adapter cable, and provides users with A more convenient service experience.

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention, and the present invention The scope is determined by the scope of the appended claims.

Claims (6)

1. a kind of charging method of the terminal with data exchanging function, it is characterised in that including:
If the general-purpose serial bus USB interface of the terminal is connected with data exchange OTG patchcords, the terminal is detected Whether the power pins of USB interface receive voltage signal;
If so, the terminal is switched into execution equipment charge access module and the terminal charge is controlled;
If it is not, then detecting the magnitude of voltage of the identified pins of the USB interface of the terminal, and perform corresponding control;
Wherein, detecting the magnitude of voltage of the identified pins of the USB interface of the terminal, and perform corresponding control includes:
Whether the magnitude of voltage for detecting the identified pins of the USB interface of the terminal is setting low level;
If so, the terminal then is switched into execution data exchange access module;
After the terminal to be switched to execution data exchange access module, in addition to:Control the USB interface of the terminal Power pins output voltage.
2. charging method according to claim 1, it is characterised in that the power pins of the USB interface of the detection terminal Whether receiving voltage signal includes:
Detect the terminal USB interface power pins at magnitude of voltage whether be more than or equal to setting threshold value, if so, then It is determined that receiving voltage signal.
3. charging method according to claim 2, it is characterised in that the threshold value that sets is 5V.
4. a kind of charging device of the terminal with data exchanging function, it is characterised in that including:
Power pins detection module, for the general-purpose serial bus USB interface when the terminal and data exchange OTG patchcord phases Lian Shi, detects whether the power pins of the USB interface of the terminal receive voltage signal;
Access module handover module, for when detecting the power pins of USB interface of the terminal and receiving voltage signal, The terminal is switched into execution equipment charge access module and the terminal charge is controlled;
Identified pins detection module, for not receiving voltage signal when the power pins for the USB interface for detecting the terminal When, the magnitude of voltage of the identified pins of the USB interface of the terminal is detected, and perform corresponding control;
The identified pins detection module includes:
Pin level detection unit, whether the magnitude of voltage of the identified pins of the USB interface for detecting the terminal is that setting is low Level;
Data access switch unit, the magnitude of voltage for the identified pins when the USB interface for detecting the terminal is low to set During level, then the terminal is switched into execution data exchange access module;
The charging device also includes:Pin voltage output unit, in the data access switch unit by the terminal Switch to after execution data exchange access module, control the power pins output voltage of the USB interface of the terminal.
5. charging device according to claim 4, it is characterised in that the power pins detection module specifically for:
Detect the terminal USB interface power pins at magnitude of voltage whether be more than or equal to setting threshold value, if so, then It is determined that receiving voltage signal.
6. charging device according to claim 5, it is characterised in that the threshold value that sets is 5V.
CN201510528508.3A 2015-08-25 2015-08-25 The charging method and device of a kind of terminal with data exchanging function Expired - Fee Related CN105048018B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510528508.3A CN105048018B (en) 2015-08-25 2015-08-25 The charging method and device of a kind of terminal with data exchanging function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510528508.3A CN105048018B (en) 2015-08-25 2015-08-25 The charging method and device of a kind of terminal with data exchanging function

Publications (2)

Publication Number Publication Date
CN105048018A CN105048018A (en) 2015-11-11
CN105048018B true CN105048018B (en) 2017-07-21

Family

ID=54454376

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510528508.3A Expired - Fee Related CN105048018B (en) 2015-08-25 2015-08-25 The charging method and device of a kind of terminal with data exchanging function

Country Status (1)

Country Link
CN (1) CN105048018B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107632949B (en) * 2017-09-30 2019-10-25 Oppo广东移动通信有限公司 Data line identification circuit, method and terminal
CN110321303A (en) * 2018-03-29 2019-10-11 中国移动通信集团终端有限公司 Device, method, terminal and the storage medium of back-up terminals data
CN110492569B (en) * 2019-08-26 2021-03-23 珠海格力电器股份有限公司 Mobile power supply and control method and device thereof
CN111159083A (en) * 2019-12-20 2020-05-15 惠州华阳通用电子有限公司 A USB master-slave mode switching method, system, storage medium and terminal
CN112187252A (en) * 2020-10-12 2021-01-05 深圳市道通科技股份有限公司 Interface identification circuit, method, equipment and electronic equipment
CN115208433A (en) * 2021-04-08 2022-10-18 Oppo广东移动通信有限公司 Charging cable, power supply device, terminal device and communication system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101097536A (en) * 2006-06-30 2008-01-02 佛山市顺德区顺达电脑厂有限公司 Operation mode judging system and method thereof
CN101901201A (en) * 2010-08-06 2010-12-01 中兴通讯股份有限公司 Method and device for realizing USB OTG function on electronic equipment
CN203387203U (en) * 2013-05-09 2014-01-08 上海斐讯数据通信技术有限公司 Charging switching system possessing USB on-the-go (OTG) function

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8907633B2 (en) * 2011-06-30 2014-12-09 Standard Microsystems Corporation Method and system for sampling multiple profiles in a charging port without host intervention

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101097536A (en) * 2006-06-30 2008-01-02 佛山市顺德区顺达电脑厂有限公司 Operation mode judging system and method thereof
CN101901201A (en) * 2010-08-06 2010-12-01 中兴通讯股份有限公司 Method and device for realizing USB OTG function on electronic equipment
CN203387203U (en) * 2013-05-09 2014-01-08 上海斐讯数据通信技术有限公司 Charging switching system possessing USB on-the-go (OTG) function

Also Published As

Publication number Publication date
CN105048018A (en) 2015-11-11

Similar Documents

Publication Publication Date Title
CN105048018B (en) The charging method and device of a kind of terminal with data exchanging function
EP2650752B1 (en) Terminal device and power supply method for terminal device
CN103618356B (en) A charging system and charging method for a mobile terminal
JP5717005B2 (en) Method and terminal for selecting an internal circuit according to the status of a USB interface
CN103744821B (en) Method and device for realizing USB OTG (Universal Serial Bus On-The-Go) function of mobile terminal
CN110851387B (en) Interface function configuration method and electronic equipment
EP2879014A1 (en) Tablet interface extension method and device
CN105068959A (en) A charging method and device for a terminal and a terminal with a data exchange function
CN105071484B (en) A kind of charging method and device of the terminal with data exchanging function
EP2860638B1 (en) Serial communication over communication control pin
JPWO2013168289A1 (en) Electronic device and control method thereof
CN106786960B (en) Charging control method, device and terminal
CN101498756B (en) Discrimination method and apparatus for external device connected with portable terminal set
CN103376871A (en) System, apparatus, and method of performing charging operation in host mode
CN104978300A (en) Mobile terminal as well as detecting method and device for connection of mobile terminal and external equipment
CN109254210B (en) Electronic equipment port type detection method and device, detection circuit and electronic equipment
CN108054794A (en) Charging and discharging method and device for intelligent terminal, terminal and storage medium
CN105071489B (en) A kind of charging method and device of the terminal with data exchanging function
CN107885688B (en) Signal switching method and device
CN106797414A (en) The leakage current detection circuit and terminal of a kind of terminal
CN108924325B (en) Data processing method and related device
CN113162131A (en) Reverse charging system, reverse charging method and terminal equipment
CN104850512B (en) No ID pin does the method and device of USB OTG function
CN106774769B (en) Terminal working mode switching method and device and handheld terminal
CN106856289B (en) Electronic equipment and circuit thereof, switching equipment and circuit thereof and signal processing system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

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