CN106292977A - A kind of adapter recognition methods and terminal - Google Patents

A kind of adapter recognition methods and terminal Download PDF

Info

Publication number
CN106292977A
CN106292977A CN201610597603.3A CN201610597603A CN106292977A CN 106292977 A CN106292977 A CN 106292977A CN 201610597603 A CN201610597603 A CN 201610597603A CN 106292977 A CN106292977 A CN 106292977A
Authority
CN
China
Prior art keywords
adapter
terminal
type
input voltage
unit
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
Application number
CN201610597603.3A
Other languages
Chinese (zh)
Other versions
CN106292977B (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 CN201610597603.3A priority Critical patent/CN106292977B/en
Publication of CN106292977A publication Critical patent/CN106292977A/en
Application granted granted Critical
Publication of CN106292977B publication Critical patent/CN106292977B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

Embodiments providing a kind of adapter recognition methods, described method includes: be attached between the general-purpose serial bus USB line supporting by adapter and described adapter, and wherein, the VBUS line of described USB line is at least connected a resistance;After described adapter accesses power supply, determine by the input voltage of described adapter input terminal;According to described input voltage, described adapter is identified, obtains the type of described adapter.The embodiment of the present invention additionally provides a kind of terminal.The production cost of adapter can be reduced by the embodiment of the present invention.

Description

Adapter identification method and terminal
Technical Field
The invention relates to the technical field of data processing, in particular to an adapter identification method and a terminal.
Background
With the rapid development of information technology, terminals (such as mobile phones, tablet computers, and the like) have become an integral part of the life of users, and in general, a charging interface of a terminal is connected to an adapter through a Universal Serial Bus (USB) line, and after the adapter is connected to a power supply, the terminal is charged. In the prior art, for the identification of the same type of adapter, different internal structures are usually adopted in the design of the adapter, and different types of adapters are correspondingly identified, and different types of adapters need to be produced by different processes, so that the cost of the adapter is high.
Disclosure of Invention
The embodiment of the invention provides an adapter identification method and a terminal, which can reduce the production cost of an adapter.
A first aspect of an embodiment of the present invention provides an adapter identification method, including:
the USB cable is connected with the adapter through a Universal Serial Bus (USB) line matched with the adapter, wherein the VBUS line of the USB line is at least connected with a resistor in series;
determining an input voltage of an input terminal of the adapter after the adapter is connected to a power supply;
and identifying the adapter according to the input voltage to obtain the type of the adapter.
A second aspect of an embodiment of the present invention provides a terminal, including:
the USB adapter comprises a connecting unit, a control unit and a control unit, wherein the connecting unit is used for connecting a Universal Serial Bus (USB) line matched with the adapter, and the VBUS line of the USB line is at least connected with a resistor in series;
the first determining unit is used for determining the input voltage of the input terminal of the adapter after the adapter is connected with a power supply;
and the identification unit is used for identifying the adapter according to the input voltage to obtain the type of the adapter.
A third aspect of an embodiment of the present invention provides a terminal, including:
a processor and a memory;
wherein the processor is configured to call the executable program code in the memory, and perform part or all of the steps of the first aspect.
The embodiment of the invention has the following beneficial effects:
it can be seen that, according to the embodiment of the present invention, a USB line of a universal serial bus matched with an adapter is connected to the adapter, wherein a VBUS line of the USB line is connected in series to at least one resistor, after the adapter is connected to a power supply, an input voltage of an input terminal of the adapter is determined, and the adapter is identified according to the input voltage, so as to obtain a type of the adapter. Therefore, the type of the adapter can be determined by the input voltage of the input terminal of the adapter, the design and process complexity of the type structure of the adapter can be reduced, and the production cost of the adapter can be reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a charging interface according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a charging interface connection adapter according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a first embodiment of an adapter identification method according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for identifying an adapter according to a second embodiment of the present invention;
fig. 5a is a schematic structural diagram of a terminal according to a first embodiment of the present invention;
fig. 5b is a schematic diagram of another structure of the terminal depicted in fig. 5a according to an embodiment of the present invention;
fig. 5c is a schematic diagram of another structure of the terminal depicted in fig. 5a according to an embodiment of the present invention;
fig. 5d is a schematic diagram of another structure of the terminal depicted in fig. 5a according to an embodiment of the present invention;
fig. 5e is a schematic diagram of another structure of the terminal depicted in fig. 5a according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal according to a second embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of the invention and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
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 invention. The appearances of the 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 explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The terminal described in the embodiment of the present invention may include a smart Phone (such as an Android Phone, an iOS Phone, a Windows Phone, etc.), a tablet computer, a palm computer, a notebook computer, a mobile internet device (MID, mobile internet Devices), or a wearable device, and the terminal is merely an example, and is not exhaustive and includes but is not limited to the terminal.
In the embodiment of the present invention, a smart phone is taken as an example for explanation, as shown in fig. 1, fig. 1 is a simple schematic diagram of a charging interface of a terminal, and a general smart phone charging interface is as follows: five signal legs are included, namely: VBUS pin, D + pin, D-pin, ID pin and GND pin to, adopt the USB line that matches with the adapter to be connected with this adapter or directly be connected with the power, after the access power, and charge to the battery at terminal through VBUS pin, simultaneously, can also carry out data communication through D + pin, D-pin, because the interface that charges belongs to prior art, the function of other pins is no longer repeated here. The USB line includes a plurality of lines, and more particularly, to a VBUS line, a D + data line, and a D-data line. For charging the adapter, the adapter changes 220V alternating current into 5V direct current, then 5V voltage is applied to the VBUS line, the VBUS line supplies power to the terminal through the USB line, and the terminal charges after acquiring the 5V voltage. As shown in fig. 2, fig. 2 is a schematic diagram of a charging interface connection adapter of a terminal, where the charging interface on the left is a charging interface of the terminal, the dotted line part is a USB line (i.e., a VBUS line, a D + data line, a D-data line, and a GND line are packaged in a cable), a resistor (which may be an equivalent resistor) is connected in series with the VBUS line of the USB line, the charging interface on the right is connected with the adapter, and after the adapter is powered on, the terminal can be powered by this method.
Optionally, in the embodiment of the present invention, the relationship between the adapter and the USB cable matched with the adapter may be divided into the following two cases: in the first case, when the adapter is produced, the USB cable and the adapter can be connected together as a whole, so that when a power supply needs to be inserted, one end of the adapter is connected to the terminal through the USB cable, and the other end of the adapter is inserted into the power supply, so that the terminal can be charged; in the second case: the USB cable is detachable from the adapter, in this case, the USB cable is matched with the adapter, that is, each adapter has its corresponding USB cable, so when a power supply needs to be plugged in, one end of the USB cable is connected to the adapter, the adapter is plugged in the power supply, and the other end of the USB cable is connected to a charging interface (USB interface) of the terminal, so that the terminal can be charged, and of course, in this case, the USB cable has other uses, such as: one end of the USB wire is inserted into the computer socket, the other end of the USB wire is connected with the charging interface of the terminal, the terminal can be charged, and under the condition, the USB wire can be used for transmitting data and also can be used for charging.
Referring to fig. 3, a flowchart of a first embodiment of an adapter identification method according to the present invention is shown in fig. 1 and fig. 2. The adapter identification method described in this embodiment includes the following steps:
301. the USB cable is connected with the adapter through a Universal Serial Bus (USB) line matched with the adapter, wherein the VBUS line of the USB line is connected with at least one resistor in series.
In the embodiment of the invention, the USB cable is matched with the adapter. The charging interface (USB interface) of the terminal is connected to one end of the USB cable, and the other end of the USB cable is connected to the adapter, and of course, the adapter needs to be connected to a power supply, wherein the VBUS cable of the USB cable may be connected in series to at least one resistor, and the at least one resistor may be regarded as an equivalent resistor, that is, the equivalent resistor may be connected in series or in parallel by a plurality of resistors. Wherein the purpose of the at least one resistor is to step down the input voltage from the input terminal of the adapter.
302. After the adapter is connected to a power supply, the input voltage of the input terminal of the adapter is determined.
After the adapter is connected to the power supply, the terminal can detect that an external power supply charges the terminal, and the terminal can enter a charging mode, or of course, the terminal can be displayed to be connected to an external device (for example, the terminal is connected to another terminal), so that the terminal can determine the input voltage of the adapter to the terminal. In particular, the terminal may determine the input voltage to the terminal by the adapter through ADC conversion techniques. If there is no series resistance in the VBUS line, the input voltage from the input terminal of the adapter is equal to 5V or approximately 5V, and if there is at least one resistance in series with the VBUS line, the input voltage from the input terminal of the adapter will be less than 5V.
303. And identifying the adapter according to the input voltage to obtain the type of the adapter.
Alternatively, since the types of adapters that can be determined are different due to the difference in the input voltages, the mapping relationship between the voltage value and the type of adapter may be preset in advance, and then the type of adapter may be determined from the mapping relationship between the preset voltage value and the type of adapter. In this way, the input voltage may be divided into a plurality of levels, each level corresponding to a type of adapter, and thus, after the input voltage is determined, the type of adapter may be determined according to the voltage value of the input voltage.
Optionally, after step 303, the method may further include the step of: and starting the application program corresponding to the type of the adapter according to a preset mapping relation between the type of the adapter and the application program. Each adapter type may be mapped to one or more applications. The adapter type may be in one-to-one mapping relationship with the application program, for example, the application program corresponding to the adapter type a (any type) is a start alarm clock, and the application program corresponding to the adapter type B (different from the type of a) is terminal mute processing.
Optionally, after step 303, the method may further include: and starting the working mode corresponding to the type of the adapter according to the preset mapping relation between the type of the adapter and the working mode. Alternatively, the modes of operation may include, but are not limited to: conference mode, outdoor mode, silent mode, flight mode, etc. Of course, there is a one-to-one mapping relationship between the preset adapter type and the operating mode. For example, the operation mode corresponding to the adapter type a (any type) is a silent mode, and the operation mode corresponding to the adapter type B (type different from a) is an airplane mode.
Optionally, after step 303, the following steps may be further included:
110) determining a voltage of a battery of the terminal;
120) and charging according to the voltage of the battery of the terminal.
As can be seen from the above, in step 110, the voltage of the battery of the terminal may be determined, and of course, at least one of the charging voltage, the charging current and the charging power may be determined according to the voltage, and the charging may be performed in a normal charging mode with a small current and then in a fast charging mode with a larger current, and of course, the charging process may include two processes of constant current charging and constant voltage charging.
Optionally, the at least one resistor includes an adjustable resistor, and of course, the adjustable resistor may be used to adjust the size of the resistor, and after the voltage value of the adjustable resistor is adjusted, the input voltage of the input terminal of the adapter is changed, so that the charging parameter (e.g., current, voltage, or power) for charging the terminal may also be adjusted within the voltage range, current range, or output power range supported by the adapter type, because any terminal has the proper charging voltage, charging current, or charging power supported by it, in this way, the terminal may be brought into the optimal charging state, and therefore, the fast charging speed of the terminal may be increased.
It can be seen that, according to the embodiment of the present invention, a USB line of a universal serial bus matched with an adapter is connected to the adapter, wherein a VBUS line of the USB line is connected in series to at least one resistor, after the adapter is connected to a power supply, an input voltage of an input terminal of the adapter is determined, and the adapter is identified according to the input voltage, so as to obtain a type of the adapter. Therefore, the type of the adapter can be determined by the input voltage of the input terminal of the adapter, the design and process complexity of the type structure of the adapter can be reduced, and the production cost of the adapter can be reduced.
It is understood that, in the embodiment of the present invention, the adapter may be any adapter, the USB cable is a USB cable that is configured with the adapter, the VBUS line of the USB cable includes at least one resistor, the at least one resistor is mainly used for reducing an input voltage from an input terminal of the adapter, and the type of the adapter is determined according to a magnitude of the input voltage. Therefore, the problem that in the prior art, the internal structure of the adapter is designed to be more different (for distinguishing the type of the adapter) can be avoided, and the USB cable is directly improved, so that the production cost of the adapter is reduced.
In accordance with the above, please refer to fig. 4, which is a flowchart illustrating a second embodiment of an adapter identification method according to an embodiment of the present invention. The adapter identification method described in this embodiment includes the following steps:
401. the USB cable is connected with the adapter through a Universal Serial Bus (USB) line matched with the adapter, wherein the VBUS line of the USB line is connected with at least one resistor in series.
402. And after the adapter is connected with a power supply, judging whether the adapter is in a USB charging mode or an adapter charging mode.
403. And if the adapter is in the adapter charging mode, charging the terminal, and determining the input voltage of the terminal input by the adapter.
404. And identifying the adapter according to the input voltage to obtain the type of the adapter.
Step 401 and step 404 may refer to corresponding steps in the adapter identification method described with reference to fig. 3.
Optionally, in step 402, when the adapter is inserted, it may be determined whether the D + pin and the D-pin of the USB cable are connected together, if so, the adapter is in the USB charging mode, and if not, the adapter is in the adapter charging mode, the adapter is directly charged by 500 mA.
It should be noted that, in step 403, if the adapter is in the adapter charging mode, the type of the adapter can be further identified, and in the first step, a fixed low-current charging (aiming at preventing a large current from damaging the battery) is performed (for example, 100 mA), and after the current flows through the resistance on the VBUS line of the USB line, a fixed different voltage drop (specifically, a voltage drop, which is related to the magnitude of the resistance) is generated, for example, if the resistance is 1 ohm, a voltage drop of 0.1V may be generated, and for example, if the resistance is 5 ohm, a voltage drop of 0.5V may be generated, so that the voltage obtained by the terminal is 4.9V and 4.5V. In addition, the voltage drop cannot be too large, and generally can be kept above 4V, because if the voltage drop is too large, the adapter may not be able to charge the terminal.
The following is a device for implementing the adapter identification method provided in fig. 3 or fig. 4, and specifically includes the following steps:
please refer to fig. 5a, which is a schematic structural diagram of a terminal according to a first embodiment of the present invention. The terminal described in this embodiment includes: the connection unit 501, the first determination unit 502, and the identification unit 503 are specifically as follows:
the connection unit 501 is used for connecting a Universal Serial Bus (USB) line matched with an adapter with the adapter, wherein the VBUS line of the USB line is connected with at least one resistor in series;
a first determining unit 502, configured to determine an input voltage of an input terminal of the adapter after the adapter is powered on;
the identifying unit 503 is configured to identify the adapter according to the input voltage, so as to obtain the type of the adapter.
Optionally, the identifying unit 503 is specifically configured to:
and determining the type of the adapter corresponding to the input voltage according to a mapping relation between a preset voltage value and the type of the adapter.
Optionally, as shown in fig. 5b, the terminal shown in fig. 5a may further include: the determining unit 504 and the first charging unit 505 are specifically as follows:
a judging unit 504 for judging whether the adapter is in the USB charging mode or the adapter charging mode before the first determining unit 502 determines the input voltage of the adapter input terminal;
a first charging unit 505, configured to charge the terminal if the determination result of the determining unit 504 is that the adapter is in the adapter charging mode, and the first determining unit 502 determines the input voltage input to the terminal by the adapter.
Optionally, as shown in fig. 5c, the terminal shown in fig. 5a may further include: the first starting unit 506 is specifically as follows:
a first starting unit 506, configured to start, after the identification unit 503 identifies the adapter according to the input voltage to obtain the type of the adapter, an application program corresponding to the type of the adapter according to a preset mapping relationship between the type of the adapter and the application program;
optionally, as shown in fig. 5d, the terminal shown in fig. 5a may further include: the second starting unit 507 is specifically as follows:
a second starting unit 507, configured to start a working mode corresponding to the type of the adapter according to a preset mapping relationship between the type of the adapter and the working mode after the identification unit 503 identifies the adapter according to the input voltage to obtain the type of the adapter.
Optionally, as shown in fig. 5e, the terminal shown in fig. 5a may further include: the second determining unit 508 and the second charging unit 509 are specifically as follows:
a second determining unit 508, configured to determine a voltage of a battery of the terminal after the identifying unit 503 identifies the adapter according to the input voltage to obtain the type of the adapter;
a second charging unit 509 for charging according to a voltage of the battery of the terminal.
It can be seen that, the terminal described in the embodiment of the present invention is connected to the adapter through a USB cable of a universal serial bus that is matched with the adapter, wherein the VBUS cable of the USB cable is connected in series to at least one resistor, after the adapter is connected to a power supply, an input voltage of an input terminal of the adapter is determined, and the adapter is identified according to the input voltage, so as to obtain the type of the adapter. Therefore, the type of the adapter can be determined by the input voltage of the input terminal of the adapter, the design and process complexity of the type structure of the adapter can be reduced, and the production cost of the adapter can be reduced.
Fig. 6 is a schematic structural diagram of a terminal according to a second embodiment of the present invention. The terminal described in this embodiment includes: at least one input device 1000; at least one output device 2000; at least one processor 3000, e.g., a CPU; and a memory 4000, the input device 1000, the output device 2000, the processor 3000, and the memory 4000 being connected by a bus 5000.
The input device 1000 may be a touch panel, a physical button, or a mouse.
The output device 2000 may be a display screen.
The memory 4000 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 4000 is used for storing a set of program codes, and the input device 1000, the output device 2000 and the processor 3000 are used for calling the program codes stored in the memory 4000 to execute the following operations:
the processor 3000 is configured to:
the USB cable is connected with the adapter through a Universal Serial Bus (USB) line matched with the adapter, wherein the VBUS line of the USB line is at least connected with a resistor in series;
determining an input voltage of an input terminal of the adapter after the adapter is connected to a power supply;
and identifying the adapter according to the input voltage to obtain the type of the adapter.
Optionally, the recognizing, by the processor 3000, the adapter according to the input voltage to obtain the type of the adapter includes:
and determining the type of the adapter corresponding to the input voltage according to a mapping relation between a preset voltage value and the type of the adapter.
Optionally, before the processor 3000 determines the input voltage from the adapter input terminal, the method further comprises;
judging whether the adapter is in a USB charging mode or an adapter charging mode;
and if the adapter is in the adapter charging mode, charging the terminal, and executing the determination of the input voltage input into the terminal by the adapter.
Optionally, the processor 3000 identifies the adapter according to the input voltage, and after obtaining the type of the adapter, the processor is further specifically configured to:
starting an application program corresponding to the type of the adapter according to a preset mapping relation between the type of the adapter and the application program;
or,
and starting the working mode corresponding to the type of the adapter according to the preset mapping relation between the type of the adapter and the working mode.
Optionally, the processor 3000 identifies the adapter according to the input voltage, and after obtaining the type of the adapter, the processor is further specifically configured to:
determining a voltage of a battery of the terminal;
and charging according to the voltage of the battery of the terminal.
An embodiment of the present invention further provides a computer storage medium, where the computer storage medium may store a program, and when the program is executed, the program includes some or all of the steps of any one of the adapter identification methods described in the above method embodiments.
While the invention has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus (device), or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. A computer program stored/distributed on a suitable medium supplied together with or as part of other hardware, may also take other distributed forms, such as via the Internet or other wired or wireless telecommunication systems.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the invention has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the invention. Accordingly, the specification and figures are merely exemplary of the invention as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (11)

1. An adapter identification method, comprising:
the USB cable is connected with the adapter through a Universal Serial Bus (USB) line matched with the adapter, wherein the VBUS line of the USB line is at least connected with a resistor in series;
determining an input voltage of an input terminal of the adapter after the adapter is connected to a power supply;
and identifying the adapter according to the input voltage to obtain the type of the adapter.
2. The method of claim 1, wherein identifying the adapter based on the input voltage to obtain the type of the adapter comprises:
and determining the type of the adapter corresponding to the input voltage according to a mapping relation between a preset voltage value and the type of the adapter.
3. The method of any of claims 1 or 2, wherein prior to determining the input voltage at the input terminal by the adapter, the method further comprises:
judging whether the adapter is in a USB charging mode or an adapter charging mode;
and if the adapter is in the adapter charging mode, charging the terminal, and executing the determination of the input voltage input into the terminal by the adapter.
4. The method according to any one of claims 1 or 2, wherein after identifying the adapter according to the input voltage and obtaining the type of the adapter, the method further comprises:
starting an application program corresponding to the type of the adapter according to a preset mapping relation between the type of the adapter and the application program;
or,
and starting the working mode corresponding to the type of the adapter according to the preset mapping relation between the type of the adapter and the working mode.
5. The method according to any one of claims 1 or 2, wherein after identifying the adapter according to the input voltage and obtaining the type of the adapter, the method further comprises:
determining a voltage of a battery of the terminal;
and charging according to the voltage of the battery of the terminal.
6. A terminal, comprising:
the USB adapter comprises a connecting unit, a control unit and a control unit, wherein the connecting unit is used for connecting a Universal Serial Bus (USB) line matched with the adapter, and the VBUS line of the USB line is at least connected with a resistor in series;
the first determining unit is used for determining the input voltage of the input terminal of the adapter after the adapter is connected with a power supply;
and the identification unit is used for identifying the adapter according to the input voltage to obtain the type of the adapter.
7. The terminal according to claim 6, wherein the identification unit is specifically configured to:
and determining the type of the adapter corresponding to the input voltage according to a mapping relation between a preset voltage value and the type of the adapter.
8. The terminal according to any of claims 6 or 7, wherein the terminal further comprises:
a judging unit configured to judge whether the adapter is in a USB charging mode or an adapter charging mode before the first determining unit determines the input voltage of the adapter input terminal;
and the first charging unit is used for charging the terminal if the judgment result of the judging unit is that the adapter is in the adapter charging mode, and the first determining unit determines the input voltage input into the terminal by the adapter.
9. The terminal according to any of claims 6 or 7, wherein the terminal further comprises:
the first starting unit is used for starting the application program corresponding to the type of the adapter according to a preset mapping relation between the type of the adapter and the application program after the identification unit identifies the adapter according to the input voltage to obtain the type of the adapter;
or,
and the second starting unit is used for starting the working mode corresponding to the type of the adapter according to the preset mapping relation between the type of the adapter and the working mode after the identification unit identifies the adapter according to the input voltage to obtain the type of the adapter.
10. The terminal according to any of claims 6 or 7, wherein the terminal further comprises:
the second determining unit is used for determining the voltage of the battery of the terminal after the identifying unit identifies the adapter according to the input voltage to obtain the type of the adapter;
and a second charging unit for charging according to a voltage of the battery of the terminal.
11. A terminal, comprising:
a processor and a memory; wherein the processor performs the method of any one of claims 1 to 5 by calling code or instructions in the memory.
CN201610597603.3A 2016-07-26 2016-07-26 A kind of adapter recognition methods and terminal Active CN106292977B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610597603.3A CN106292977B (en) 2016-07-26 2016-07-26 A kind of adapter recognition methods and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610597603.3A CN106292977B (en) 2016-07-26 2016-07-26 A kind of adapter recognition methods and terminal

Publications (2)

Publication Number Publication Date
CN106292977A true CN106292977A (en) 2017-01-04
CN106292977B CN106292977B (en) 2019-04-02

Family

ID=57652477

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610597603.3A Active CN106292977B (en) 2016-07-26 2016-07-26 A kind of adapter recognition methods and terminal

Country Status (1)

Country Link
CN (1) CN106292977B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107069844A (en) * 2017-01-13 2017-08-18 广东欧珀移动通信有限公司 Charging method, device and terminal

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5506490A (en) * 1993-11-09 1996-04-09 Motorola, Inc. Method and apparatus for determining external power supply type
CN1601439A (en) * 2003-09-26 2005-03-30 纬创资通股份有限公司 System unit having recognizable mains adaptor and identifying method thereof
CN101169456A (en) * 2007-11-29 2008-04-30 北京飞天诚信科技有限公司 USB bus current detection device
CN102684270A (en) * 2012-05-31 2012-09-19 华为技术有限公司 Method for identifying type of universal serial bus (USB) chargers and USB device
CN204215023U (en) * 2014-09-26 2015-03-18 小米科技有限责任公司 Terminal charge parameter testing line
CN105140985A (en) * 2015-08-05 2015-12-09 青岛海信移动通信技术股份有限公司 Mobile terminal, direct-charge power adapter and charging method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5506490A (en) * 1993-11-09 1996-04-09 Motorola, Inc. Method and apparatus for determining external power supply type
CN1601439A (en) * 2003-09-26 2005-03-30 纬创资通股份有限公司 System unit having recognizable mains adaptor and identifying method thereof
CN101169456A (en) * 2007-11-29 2008-04-30 北京飞天诚信科技有限公司 USB bus current detection device
CN102684270A (en) * 2012-05-31 2012-09-19 华为技术有限公司 Method for identifying type of universal serial bus (USB) chargers and USB device
CN204215023U (en) * 2014-09-26 2015-03-18 小米科技有限责任公司 Terminal charge parameter testing line
CN105140985A (en) * 2015-08-05 2015-12-09 青岛海信移动通信技术股份有限公司 Mobile terminal, direct-charge power adapter and charging method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107069844A (en) * 2017-01-13 2017-08-18 广东欧珀移动通信有限公司 Charging method, device and terminal
CN107069844B (en) * 2017-01-13 2019-07-16 Oppo广东移动通信有限公司 Charging method, device and terminal

Also Published As

Publication number Publication date
CN106292977B (en) 2019-04-02

Similar Documents

Publication Publication Date Title
US11368039B2 (en) Battery charging method and electronic device
TWI398759B (en) Power supply device, portable electronic apparatus and related method for determining types of a power supply device
US10007621B2 (en) Method for setting universal serial bus (USB) interface of electronic device, and electronic device
US20100109602A1 (en) Charging device and method of operating the same
CN105518967B (en) Apparatus and method for changing current limit
CN108132401A (en) Charge abnormal detection method, device, storage medium and mobile terminal
WO2018129991A1 (en) Charging method, charging device and terminal
CN106230070B (en) Charging method and device
US10243380B2 (en) Method and apparatus for battery malfunction detection and notification thereof
EP2980958A1 (en) Charging control method and electronic device for supporting the same
JP2014056287A (en) Electronic apparatus and method of determining power source device by electronic apparatus
CN108681514B (en) Device detection method and device, storage medium and electronic device
CN104242365A (en) Portable electronic device and use method
CN109254210B (en) Electronic equipment port type detection method and device, detection circuit and electronic equipment
US12027896B2 (en) Charging cable port detection and current enforcement
CN108924325B (en) Data processing method and related device
CN106292977B (en) A kind of adapter recognition methods and terminal
CN105045479A (en) Icon display method and electronic device
CN105226337A (en) A kind of method and apparatus of terminal charge
CN104767241B (en) A kind for the treatment of method and apparatus of terminal charger
CN107589819B (en) Mobile terminal, current setting method thereof, and computer-readable storage medium
CN112701758B (en) Charging current setting method, system and mobile terminal
CN107589820B (en) Mobile terminal, current setting method thereof, and computer-readable storage medium
CN104731457A (en) Clock display method and device for mobile terminal
CN106650512A (en) Method for protecting electronic equipment, and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant before: Guangdong OPPO Mobile Communications Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant