CN112838643A - Charging method and device - Google Patents

Charging method and device Download PDF

Info

Publication number
CN112838643A
CN112838643A CN202110137349.XA CN202110137349A CN112838643A CN 112838643 A CN112838643 A CN 112838643A CN 202110137349 A CN202110137349 A CN 202110137349A CN 112838643 A CN112838643 A CN 112838643A
Authority
CN
China
Prior art keywords
usb
analog switch
charging
ith
charging state
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.)
Pending
Application number
CN202110137349.XA
Other languages
Chinese (zh)
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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202110137349.XA priority Critical patent/CN112838643A/en
Publication of CN112838643A publication Critical patent/CN112838643A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/00032Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries characterised by data exchange
    • H02J7/00034Charger exchanging data with an electronic device, i.e. telephone, whose internal battery is under charge
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/007Regulation of charging or discharging current or voltage
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J2207/00Indexing scheme relating to details of circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J2207/30Charge provided using DC bus or data bus of a computer

Abstract

The embodiment of the application provides a charging method and a charging device, wherein the device comprises a main controller, a power supply control circuit, an analog switch and a USB interface: the main controller is connected with one end of the power supply control circuit in an enabling mode, and the other end of the power supply control circuit is connected with a power line of the USN interface; the main controller is connected with the analog switch through an input/output interface GPIO; the positive and negative data signal lines of the USB interface are connected with the main controller through positive and negative data line ports of the analog switch, and the positive and negative data signal line short-circuit port of the analog switch is used for disconnecting the communication between the positive and negative data signal lines of the USB interface and the main controller; the ground wire of the USB interface is grounded, and the device can realize heavy-current charging and reduce the charging time of the USB equipment.

Description

Charging method and device
Technical Field
The present application relates to the field of device charging technologies, and in particular, to a charging method and apparatus.
Background
Currently, a handheld mobile device basically supports a USB2.0 basic Charging protocol BC1.2, BC1.2 (battery Charging v1.2) is mainly used for specifying battery Charging requirements, and is implemented based on a USB2.0 protocol at first. The BC1.2 protocol defines the charge detection, control and reporting mechanisms of the USB interface of the device. In the BC1.2 protocol, the types of Charging ports may be classified into a Standard Downlink Port (SDP), a Dedicated Charging Port (DCP), a Charging Downlink Port (CDP), an ACA-DOCK, an Accessory Port (ACA), and the like.
When a common USB device is charged, the charging port is generally identified as the SDP charging port, and charging is performed at a current of at most 500 ma, which requires a long charging time. Therefore, reducing the charging time of the USB device is an urgent problem to be solved.
Disclosure of Invention
The embodiment of the application provides a charging method and a charging device, which are used for reducing the charging time of USB equipment.
In a first aspect, the present application provides a charging device, including a main controller, a power control circuit, an analog switch, and a USB interface:
the main controller is connected with one end of the power supply control circuit in an enabling way, and the other end of the power supply control circuit is connected with a power line of the USB interface; the control end of the analog switch is connected with the main controller; the fixed end of the analog switch is connected with the positive and negative data signal lines of the USB interface, and the positive and negative data signal lines of the first switching end of the analog switch are in short circuit; the positive and negative data lines of the second switching end of the analog switch are connected with the main controller; the fixed end of the analog switch is controlled by the analog switch control end to be selectively connected to the first switching end or the second switching end of the analog switch.
In an optional implementation manner, the USB interface is any one of a Type-a USB port, a Type-B USB port, and a Type-C USB port.
In an alternative embodiment, the present application provides a method of charging using the charging device of the first aspect, including:
the main controller responds to the USB equipment to access the USB interface and detects the charging state of the USB equipment; if the detected charging state is not the charging state of the DCP, sequentially sending a first control instruction to the power control circuit, sending a second control instruction to the control end of the analog switch, sending a third control instruction to the power control circuit, and sending a fourth control instruction to the control end of the analog switch; detecting the charging state of the USB equipment again, and charging the USB equipment in a mode matched with the charging state of the DCP when the detected charging state is the charging state of the DCP again;
after the power supply control circuit receives the first control instruction, the power supply line between the USB interface and the main controller is powered off;
after the control end of the analog switch receives the second control instruction, connecting the fixed end of the analog switch to the first switching end of the analog switch to trigger the USB equipment to be switched to the DCP charging state;
after receiving the third control instruction, the power supply control circuit powers on a power supply line between the USB interface and the main controller;
and after the control end of the analog switch receives the fourth control instruction, the fixed end of the analog switch is connected to the second switching end of the analog switch.
In an optional implementation manner, a method of charging by using the charging device of the first aspect further includes:
and the main controller receives data sent by the USB equipment when the USB equipment is charged in a mode matched with the charging state of the DCP.
In the charging device, the main controller is connected with the control end of the analog switch, the fixed end of the analog switch is connected with the positive and negative data signal lines of the USB interface, the positive and negative data signal lines of the first switching end of the analog switch are in short circuit, the positive and negative data lines of the second switching end of the analog switch are connected with the main controller, the fixed end of the analog switch is controlled by the control end of the analog switch to select the first switching end or the second switching end connected to the analog switch, and when the fixed end of the analog switch is connected to the first switching end, the charging state of the USB equipment connected into the USB interface is switched to a DCP charging state, so that high-current charging is realized, and the charging time of the USB equipment is further reduced.
In a second aspect, the present application provides a charging device, including a main controller, a USB hub, N power control circuits, N analog switches, and N USB interfaces:
the USB concentrator comprises an uplink port and N downlink ports, and the uplink port is connected with the main controller; the main controller is connected with one end of the ith power supply control circuit in the N power supply control circuits in an enabling mode, and the other end of the ith power supply control circuit is connected with a power line of the ith USN interface in the N USB interfaces; the control end of the ith analog switch in the N analog switches is connected with the main controller; the fixed end of the ith analog switch is connected with a positive and negative data signal line of the ith USB interface, and the positive and negative data signal line of the first switching end of the ith analog switch is in short circuit; the positive and negative data lines of the second switching end of the ith analog switch are connected with the positive and negative data signal lines of the ith downlink port in the N downlink ports of the USB concentrator; the fixed end of the ith analog switch is controlled by the control end of the ith analog switch to be selectively connected to the first switching end or the second switching end of the ith analog switch, wherein N is an integer greater than or equal to 1.
In an optional implementation manner, the ith USB interface is any one of a Type-a USB port, a Type-B USB port, and a Type-C USB port.
In an alternative embodiment, the present application provides a method of charging using the charging device of the second aspect, comprising:
the main controller responds to the fact that the USB equipment is connected into the ith USB interface, and detects the charging state of the USB equipment; if the detected charging state is not the charging state of the DCP, sequentially sending a first control instruction to the ith power supply control circuit, sending a second control instruction to the control end of the ith analog switch, sending a third control instruction to the ith power supply control circuit, and sending a fourth control instruction to the control end of the ith analog switch; detecting the charging state of the USB equipment again, and charging the USB equipment in a mode matched with the charging state of the DCP when the detected charging state is the charging state of the DCP again;
after the ith power supply control circuit receives the first control instruction, the power supply line between the ith USB interface and the main controller is powered off;
after the control end of the ith analog switch receives the second control instruction, connecting the fixed end of the ith analog switch to the first switching end of the analog switch to trigger the USB equipment to be switched to the DCP charging state;
after receiving a third control instruction, the ith power control circuit powers on a power line between the ith USB interface and the main controller;
and after the control end of the ith analog switch receives the fourth control instruction, the fixed end of the ith analog switch is connected to the second switching end of the ith analog switch.
In an optional embodiment, the method for charging by using the charging device of the second aspect further comprises:
and the main controller receives data sent by the USB equipment when the USB equipment is charged in a mode matched with the charging state of the DCP.
In the charging device, an uplink port of the USB hub is connected to a main controller, the main controller is connected to a control end of an ith analog switch, a fixed end of the ith analog switch is connected to positive and negative data signal lines of an ith USB interface, and positive and negative data signal lines of a first switching end of the ith analog switch are in short circuit; the positive and negative data lines of the second switching end of the ith analog switch are connected with the positive and negative data signal lines of the ith downlink port in the N downlink ports of the USB concentrator; the fixed end of the ith analog switch is controlled by the control end of the ith analog switch to select the first switching end or the second switching end connected to the ith analog switch, when the fixed end of the ith analog switch is connected to the first switching end, the charging state of the USB equipment connected to the ith USB interface is switched to the DCP charging state, so that high-current charging is realized, the charging time of the USB equipment is reduced, in addition, the USB concentrator is provided with N downlink ports, a plurality of USB equipment connected to the USB interface can be charged simultaneously, and the charging efficiency is improved.
In a third aspect, the present application provides a charging device comprising:
the detection module is used for responding to the USB equipment to access the USB interface and detecting the charging state of the USB equipment;
the control module is used for sequentially sending a first control instruction, a second control instruction, a third control instruction and a fourth control instruction if the detected charging state is not the charging state of a special charging port DCP (digital data processing), wherein the first control instruction is used for powering off a power line connected with the USB interface, the second control instruction is used for triggering the USB equipment to be switched to the DCP charging state, the third control instruction is used for powering on the power line connected with the USB interface, and the fourth control instruction is used for indicating the connection with a positive data signal line and a negative data signal line of the USB interface;
the detection module is further used for detecting the charging state of the USB equipment again;
and the charging module is used for charging the USB equipment in a mode matched with the DCP charging state when the re-detected charging state is the DCP charging state.
In an optional embodiment, the charging apparatus further includes a receiving module, configured to:
and receiving data sent by the USB equipment when the USB equipment is charged in a mode matched with the charging state of the DCP.
In addition, the technical effects brought by the charging device in the third aspect can be referred to the technical effects brought by the charging device in the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a hardware diagram schematically illustrating a charging device according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a charging method provided in the present application;
FIG. 3 is a schematic diagram illustrating charging of multiple USB devices according to an embodiment of the present application;
fig. 4 is a hardware diagram of another charging device provided in the present application;
FIG. 5 is a flow chart of another charging method provided in the practice of the present application;
fig. 6 is a structural diagram of a charging device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. 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 application.
All other embodiments, which can be derived by a person skilled in the art from the exemplary embodiments shown in the present application without inventive effort, shall fall within the scope of protection of the present application. Moreover, while the disclosure herein has been presented in terms of exemplary one or more examples, it is to be understood that each aspect of the disclosure can be utilized independently and separately from other aspects of the disclosure to provide a complete disclosure.
It should be understood that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used are interchangeable under appropriate circumstances and can be implemented in sequences other than those illustrated or otherwise described herein with respect to the embodiments of the application, for example.
Furthermore, the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or device that comprises a list of elements is not necessarily limited to those elements explicitly listed, but may include other elements not expressly listed or inherent to such product or device.
The term "module," as used herein, refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and/or software code that is capable of performing the functionality associated with that element.
Based on the type of the charging port defined in the BC1.2 protocol, the SDP charging port is a standard downlink port, the maximum current is 500 milliamperes, and a common USB interface is generally the SDP charging port; the DCP charging interface is a special charging interface, does not support data transmission, supports more than 1.5 amperes of current, and is mainly used for special charging devices such as quick charging devices and the like; the CDP charging port supports both data transmission and currents above 1.5 amps. The state of charge of the SDP charging port is recorded as the SDP state of charge, the state of charge of the DCP charging port is recorded as the DCP state of charge, and the state of charge of the CDP charging port is recorded as the CDP state of charge. When a common USB device is charged, the USB device generally recognizes the charging port as the SDP charging port, and charges at a current of at most 500 ma, which requires a long charging time.
In order to realize that a USB interface of common USB equipment supports both data transmission and quick charging with current of more than 1.5 amperes, the existing solution is to add a plurality of control judgment circuits in a power supply device, and the circuits and control logics are relatively complex and have relatively high cost.
In order to solve the above problem, embodiments of the present application provide a charging method and apparatus. The charging device comprises a main controller, a power supply control circuit, an analog switch and a USB interface. In the embodiment of the application, a main controller is connected with an enable (EN for short) at one end of a power control circuit, the other end of the power control circuit is connected with a power line of a USN interface, an analog switch comprises a fixed end, a control end, a first switching end and a second switching end, the control end of the analog switch is connected with the main controller, a port of the control end can adopt a General-purpose input/output (GPIO) interface, and a charging process of a DCP mode in a BC1.2 protocol is simulated by controlling the power control circuit and the analog switch by the main controller; the fixed end of the analog switch is connected with a positive data signal line and a negative data signal line of the USB interface, the positive data signal line and the negative data signal line of the first switching end of the analog switch are in short circuit, the positive data line and the negative data line of the second switching end of the analog switch are connected with the main controller, the fixed end of the analog switch is controlled by the analog switch control end to be selectively connected to the first switching end or the second switching end of the analog switch, when the fixed end of the analog switch is connected to the first switching end, the charging state of USB equipment connected into the USB interface is switched to a DCP charging state, and compared with the situation that a complex control circuit is additionally arranged in power supply end equipment, the analog switch is simple to realize and low in; through the power supply device of the embodiment of the application, the large-current charging matched with the charging state of the DCP is realized, so that the charging time of the USB equipment is reduced.
In some embodiments of the present application, the USB device may be directly connected to the charging apparatus. Fig. 1 schematically shows a hardware diagram of a charging device provided in an embodiment of the present application. As shown in fig. 1, the charging device includes a main controller 101, a power supply control circuit 102, an analog switch 103, and a USB interface 104. The USB interface 104 can be a Type-A USB port, a Type-B USB port or a Type-C USB port supporting a USB2.0 protocol, the USB interface 104 is sequentially provided with four lines with different colors of red, white, green and black, the red is a power line and represents the anode of the power line, and the red is marked by VCC; black is ground, representing the negative pole, marked with GND; white and green are data signal lines, green is a positive data signal line, denoted by DP, and white is a negative data signal line, denoted by DM. The main controller 101 is enabled to be connected to one end of the power control circuit 102, the other end of the power control circuit 102 is connected to a power line of the USB interface 104, VBUS represents USB voltage (typically 5 volts); the main controller 101 is connected with a control end of the analog switch 103, the control end is a GPIO port, and the analog switch 103 is controlled by the control end of the analog switch 103; the fixed end of the analog switch 103 is connected with positive and negative data signal lines DP and DM of the USB interface 104, the positive and negative data signal lines (represented by DP1 and DM1 in fig. 1) of the first switching end of the analog switch 103 are short-circuited, the positive and negative data lines of the second switching end (represented by DP2 and DM2 in fig. 1) of the analog switch 103 are connected with the main controller, the fixed end of the analog switch 103 is controlled by the control end of the analog switch 103 to be selectively connected to the first switching end or the second switching end, wherein when the fixed end of the analog switch is connected to the first switching end, the charging state of the USB device connected to the USB interface is switched to a DCP charging state; the ground of the USB interface 104 is grounded.
Based on the charging device shown in fig. 1, fig. 2 exemplarily shows a flowchart of a charging method provided in an embodiment of the present application. As shown in fig. 2, the process is executed by the charging apparatus shown in fig. 1, and mainly includes the following steps:
s201: the main controller responds to the USB equipment to access the USB interface and detects the charging state of the USB equipment.
In this step, when the USB device is connected to the USB interface, the main controller is connected to a power line of the USB interface, and the main controller and the USB device perform USB communication via a hardware handshake protocol, and based on the BC1.2 protocol, the main controller detects a charging state of the USB device.
S202: and determining whether the detected charging state is the DCP charging state, if not, executing S203, otherwise, executing S210.
In this step, generally, according to the BC1.2 protocol, the USB device recognizes the USB interface as the SDP charging port, and the charging state of the USB device detected by the host controller is the SDP charging state.
S203: the main controller sequentially sends a first control instruction to the power supply control circuit, a second control instruction to the control end of the analog switch, a third control instruction to the power supply control circuit and a fourth control instruction to the control end of the analog switch.
In the step, the simulation of the charging state of the DCP in the BC1.2 protocol is realized through control instructions from the main controller to the power control circuit and the analog switch. The first control instruction is used for indicating the power supply control circuit to power off a power line between the USB interface and the main controller, the second control instruction is used for indicating the fixed end of the analog switch to be connected to the first switching end of the analog switch so as to trigger the USB device to be switched into a DCP charging state, the third control instruction is used for indicating the power supply control circuit to power on the power line between the USB interface and the main controller, and the fourth control instruction is used for indicating the fixed end to be connected to the second switching end of the analog switch so as to enable a positive data signal line and a negative data signal line of the USB interface to be conducted with a loop of the main controller to carry out USB communication.
S204: and after receiving the first control instruction, the power supply control circuit cuts off the power supply line between the USB interface and the main controller.
S205: and after the control end of the analog switch receives the second control instruction, the fixed end of the analog switch is connected to the first switching end of the analog switch so as to trigger the USB equipment to be switched into the DCP charging state.
In the step, the fixed end of the analog switch is connected to the first switching end of the analog switch, and the positive and negative data signal lines DP1 and DM1 of the analog switch are in short circuit to trigger the USB device to perform the burst state identification. According to the BC1.2 protocol, when the fixed end of the analog switch is connected to the first switching end of the analog switch, the USB interface identified by the USB equipment is a DCP charging port, and the charging state is switched to the DCP charging state.
S206: and after receiving the third control instruction, the power supply control circuit powers on a power supply line between the USB interface and the main controller.
In this step, the host controller supplies power to the USB interface at 5 volts.
S207: and after the control end of the analog switch receives the fourth control instruction, the fixed end of the analog switch is connected to the second switching end of the analog switch.
In this step, when the fixed end of the analog switch is connected to the second switching end of the analog switch, the positive and negative data signal lines of the USB interface are conducted with the loop of the main controller to perform USB communication.
S208: the main controller again detects the charging state of the USB device.
In this step, the main controller performs USB communication with the USB device, and the controller detects the charging state of the USB device again.
S209: determining whether the detected charging state is the DCP charging state, if so, executing S210, otherwise, charging the USB device with the detected charging state.
In the step, the charging state corresponds to the charging port identified by the USB, and when the USB interface identified by the USB is the DCP charging port, the charging state detected by the main controller is the DCP charging state; when the USB identifies that the USB interface is the SDP charging port, the charging state detected by the main controller is the SDP charging state. If the detected charging state is the DCP charging state, the state switching is successful, otherwise, the state switching is failed, and the USB equipment is charged by using the currently detected charging state.
S210: the main controller charges the USB device in a mode matched with the charging state of the DCP.
In this step, based on the BC1.2 protocol, the DCP charging state supports a current of 1.5 a or more, so that the USB device can be charged with a current of 1.5 a or more.
It is worth to be noted that, based on the hardware handshake protocol, only when the fixed end of the analog switch is connected to the first switching end of the analog switch, that is, when the positive and negative data signal lines DP1 and DM1 of the analog switch are short-circuited, the USB device is triggered to identify the type of the USB interface, and the USB device is switched to the charging state corresponding to the type of the USB interface according to the identified type of the USB interface; after the power line is electrified and stable power supply is carried out, the charging state is not influenced by the connection state of the positive and negative data signal lines of the USB interface.
In the above embodiment of the present application, when the main controller charges the USB device in a manner matching with the DCP charging state, the main controller may also receive data sent by the USB device, so as to realize charging and data transmission with a current of more than 1.5 amperes at the same time.
In the charging device provided in the embodiment of the application, when the main controller detects that the charging state of the USB device is not the DCP charging state, the main controller sends a first control instruction for powering off the power line to the power control circuit, sends a second control instruction for controlling the fixed end of the analog switch to be connected to the first switching end (that is, the positive and negative data signal lines DP1 and DM1 of the analog switch are short-circuited) to the control end of the analog switch, based on the hardware handshake protocol, triggers the charging state of the USB device to be switched to the DCP charging state, after the charging state is switched, sends a third control instruction for powering on the power line to the power control circuit, and sends a fourth control instruction for controlling the fixed end of the analog switch to be connected to the first switching end to the control end of the analog switch, so as to recover the communication between the main controller and the USB device, the main controller detects the charging state of the USB again, and when the DP1 and the DM1, the USB equipment switches the SDP charging state into the DCP charging state, so that the charging state detected by the main controller is the DCP charging state again, the USB equipment is charged in a mode matched with the DCP charging state, and compared with the mode matched with the SDP charging state, the charging time of the USB equipment is shortened; on the other hand, after the USB device is switched to the DCP charging state, the communication between the main controller and the USB device is recovered, the control logic is simple, and the control over the power supply control circuit and the analog switch can be realized only by using two GPIOs; on the other hand, compared with the current implementation mode of large-current charging, only one stage of analog switch is added in the charging device, so that the cost is lower.
In other embodiments, the USB device may also be connected to the host controller via a USB hub. The USB hub may be integrated inside the charging device or may be deployed independently. The USB hub comprises an upstream port and N downstream ports, wherein N is greater than or equal to 1. Because the USB concentrator includes N USB downstream ports, every downstream port can be connected with a USB interface to can charge for a plurality of USB equipment simultaneously, improve charge efficiency.
Fig. 3 schematically illustrates a structural diagram of a charging apparatus for charging at least one USB device according to an embodiment of the present application. As shown in fig. 3, the upstream port of the USB hub is connected to the main controller (USB _ host), each of the N downstream ports is connected to one USB interface, each USB interface can be connected to one USB device, and when a plurality of USB devices are connected to different USB interfaces at the same time, the plurality of USB devices can be charged by a circuit of 1.5 amperes or more.
Taking the example that the host controller simultaneously charges two (N ═ 2) USB devices, fig. 4 is a hardware structure diagram of another charging apparatus provided in the present application. As shown in FIG. 4, the charging device includes a main controller 101, power control circuits 1021-1022, analog switches 1031-1032, USB interfaces 1041-1042, and a USB hub (USB _ hub) 105. The USB hub 105 includes an upstream port and 2 downstream ports, the upstream port is connected to the main controller 101, the main controller 101 is enabled to be connected to one end of the first power control circuit 1021, the other end of the first power control circuit 1021 is connected to the power line of the first USB interface 1041, the main controller 101 is connected to the control terminal of the first analog switch 1031, the control terminal is a general input/output port GPIO, the fixed terminal of the first analog switch 1031 is connected to the positive and negative data signal lines of the first USB interface 1041, the positive and negative data signal lines (shown by DP1 and DM1 in fig. 4) of the first switching terminal of the first analog switch 1031 are shorted, the positive and negative data lines (shown by DP2 and DM2 in fig. 4) of the second switching terminal of the first analog switch 1031 are connected to the positive and negative data signal lines of the first downstream port of the N downstream ports of the USB hub 105, the fixed terminal of the first analog switch 1031 is controlled by the control terminal of the first analog switch 1031 to be selectively connected to the first switching terminal or the first A second switching terminal, wherein when the fixed terminal of the first analog switch 1031 is connected to the first switching terminal, that is, when the positive and negative data signal lines DP1 and DM1 of the first analog switch 1031 are short-circuited, the USB connected to the first USB interface 1041 is triggered to switch the charging state to the DCP charging state; the ground wire of the first USB interface 1041 is grounded; the main controller 101 is connected to one end of the second power control circuit 1022 in an enabling manner, the other end of the second power control circuit 1022 is connected to the power line of the second USB interface 1042, the main controller 101 is connected to a control end of a second analog switch 1032, the control end is a general-purpose input/output port, a fixed end of the second analog switch 1032 is connected to the positive and negative data signal lines of the second USB interface 1042, the positive and negative data signal lines (indicated by DP1 and DM1 in fig. 4) of the first switch end of the second analog switch 1032 are shorted, the positive and negative data signal lines (indicated by DP2 and DM2 in fig. 4) of the second switch end of the second analog switch 1032 are connected to the positive and negative data signal lines of the second downstream port of the N downstream ports of the USB hub 105, the fixed end of the second analog switch 1032 is selectively connected to the first switch end or the second switch end under the control of the second analog switch 1032, when the fixed end of the second analog switch 1032 is connected to the first switch end, that is, the positive and negative data signal lines DP1 and DM1 of the second analog switch 1032 are shorted, the USB device connected to the second USB interface 1042 is triggered to switch the charging state to the DCP charging state, and the ground line of the second USB interface 1042 is grounded.
The description of the USB interfaces 1041 to 1042, the power control circuits 1021 to 1022, and the analog switches 1031 to 1032 refers to FIG. 1, which is not repeated here.
Based on the charging apparatus shown in fig. 4, next, for example, a USB device connected to the ith USB interface of the N USB interfaces is charged, and fig. 5 exemplarily shows a flowchart of a charging method provided in the embodiment of the present application. As shown in fig. 5, the process mainly includes the following steps:
s501: the main controller responds to the fact that the USB equipment is connected into the ith USB interface, and the charging state of the USB equipment is detected.
In this step, the corresponding relationship between the N downstream ports of the USB hub and the N USB interfaces is preset, and each downstream port corresponds to only one USB interface. After the USB equipment is connected with the USB interface, the USB equipment communicates with the main controller, and the main controller identifies the USB interface connected with the USB equipment according to the downlink port of the USB concentrator. Specifically, when the USB device is connected to the ith USB interface, the main controller responds to the USB device to connect to the ith USB interface, the main controller is connected to the power line of the ith USB interface, the main controller communicates with the USB device via USB, and based on the BC1.2 protocol, the main controller 101 detects the charging state of the USB device. Generally, the USB device supports the BC1.2 protocol, and usually recognizes the ith USB interface as an SDP charging port, which corresponds to the SDP charging status.
S502: the main controller determines whether the detected state of charge is the DCP state of charge, if not, S503 is performed, otherwise S510 is performed.
In this step, since the USB device recognizes the i-th USB interface as the SDP charging port according to the BC1.2 protocol, the charging state of the USB device detected by the general host controller in S501 is the SDP charging state.
S503: the main controller sequentially sends a first control instruction to the ith power supply control circuit, a second control instruction to the control end of the ith analog switch, a third control instruction to the ith power supply control circuit and a fourth control instruction to the control end of the ith analog switch.
In the step, the simulation of the charging state of the DCP in the BC1.2 protocol is realized through control instructions from the main controller to the ith power supply control circuit and the ith analog switch. The first control instruction is used for indicating an ith power supply control circuit to power off a power line between an ith USB interface and a main controller, the second control instruction is used for indicating a fixed end of an ith analog switch to be connected to a first switching end of the ith analog switch so as to trigger a USB device to be switched into a DCP charging state, the third control instruction is used for indicating the ith power supply control circuit to power on the power line between the ith USB interface and the main controller, and the fourth control instruction is used for indicating a fixed end of the ith analog switch to be connected to a second switching end of the ith analog switch so as to conduct a positive and negative data signal line of the ith USB interface and a loop of an ith downlink port of a USB hub, so that USB communication is carried out.
S504: and after the ith power supply control circuit receives the first control instruction, the power supply line between the ith USB interface and the main controller is powered off.
S505: and after the control end of the ith analog switch receives the second control instruction, connecting the fixed end of the ith analog switch to the first switching end of the analog switch so as to trigger the USB equipment to be switched into the DCP charging state.
In this step, when the fixed end of the ith analog switch is connected to the first switching end of the analog switch, that is, when the positive and negative data signal lines DP1 and DM1 of the ith analog switch are short-circuited, the USB device is triggered to identify the charging state of the ith USB interface, and based on the BC1.2 protocol, the ith USB interface identified by the USB device is the DCP charging port, and the charging state of the DCP is detected.
S506: and after receiving the third control instruction, the ith power supply control circuit powers on a power supply line between the ith USB interface and the main controller.
In this step, the host controller supplies power to the ith USB interface at 5 volts.
S507: and after the control end of the ith analog switch receives the fourth control instruction, connecting the fixed end of the ith analog switch to the second switching end of the ith analog switch.
In this step, when the fixed end of the ith analog switch is connected to the second switching end of the analog switch, the positive and negative data signal lines of the ith USB interface are conducted with the loop of the ith downlink port of the USB hub for USB communication.
S508: the main controller again detects the charging state of the USB device.
In this step, the main controller performs USB communication with the USB device through the USB hub, and the controller detects the charging state of the USB device again.
S509: determining whether the detected charging state is the DCP charging state, if so, executing S510, otherwise, charging the USB device with the detected charging state.
The detailed description of this step is referred to S209 and will not be repeated here.
S510: the main controller charges the USB device in a mode matched with the charging state of the DCP.
The detailed description of this step is referred to S210 and will not be repeated here.
In the above embodiment of the present application, the USB interface is connected with the main controller through the USB hub, and since the USB hub includes N downlink ports, each downlink port is connected with one USB interface, and a plurality of devices access different USB interfaces, thereby realizing charging a plurality of USB devices simultaneously in a DCP charging state matched charging mode, and improving charging efficiency.
It should be noted that the types of the N USB interfaces may be the same or different, for example, the first USB interface is a Type-a USB port supported by the USB2.0 protocol, the second USB interface is a Type-B USB port supported by the USB2.0 protocol, and the third USB interface is a Type-C USB port supported by the USB2.0 protocol.
Based on the same technical concept, embodiments of the present application provide a charging device, which can implement the charging method in the above embodiments.
Referring to fig. 6, the charging device includes a detection module 601, a control module 602, and a charging module 603.
The detection module 601 is configured to respond to a USB device accessing a USB interface and detect a charging state of the USB device;
the control module 602 is configured to sequentially send a first control instruction, a second control instruction, a third control instruction, and a fourth control instruction if the detected charging state is not the DCP charging state of the dedicated charging port, where the first control instruction is used to power off a power line connected to the USB interface, the second control instruction is used to trigger the USB device to be switched to the DCP charging state, the third control instruction is used to power on the power line connected to the USB interface, and the fourth control instruction is used to indicate that the power line is connected to a positive/negative data signal line of the USB interface;
the detection module 601 is further configured to detect the charging state of the USB device again;
the charging module 603 is configured to charge the USB device in a manner matching with the DCP charging state when the re-detected charging state is the DCP charging state.
In some embodiments of the present application, the charging device further comprises a receiving module 604 for:
and receiving data sent by the USB device when the USB device is charged in a mode matched with the charging state of the DCP.
In some embodiments of the present application, the USB interface is any one of a Type-A port, a Type-B port, and a Type-C port.
It should be noted that, the charging device provided in the embodiment of the present application can implement the steps of the charging method implemented in the embodiment of the method and achieve the same technical effects, and detailed descriptions of the same parts and beneficial effects as those of the embodiment of the method are omitted here.
The embodiment of the present application further provides a computer-readable storage medium, where computer-executable instructions are stored, and the computer-executable instructions are used to enable a computer to execute the method in the foregoing embodiment.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. 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.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A charging device is characterized by comprising a main controller, a power supply control circuit, an analog switch and a USB interface:
the main controller is connected with one end of the power supply control circuit in an enabling way, and the other end of the power supply control circuit is connected with a power line of the USB interface; the control end of the analog switch is connected with the main controller; the fixed end of the analog switch is connected with the positive and negative data signal lines of the USB interface, and the positive and negative data signal lines of the first switching end of the analog switch are in short circuit; the positive and negative data lines of the second switching end of the analog switch are connected with the main controller; the fixed end of the analog switch is controlled by the analog switch control end to be selectively connected to the first switching end or the second switching end of the analog switch.
2. The charging device according to claim 1, wherein the USB interface is any one of a Type-a USB port, a Type-B USB port, and a Type-C USB port.
3. A method of charging using the charging device according to claim 1 or 2, characterized in that the method comprises:
the main controller responds to the USB equipment to access the USB interface and detects the charging state of the USB equipment; if the detected charging state is not the charging state of the DCP, sequentially sending a first control instruction to the power control circuit, sending a second control instruction to the control end of the analog switch, sending a third control instruction to the power control circuit, and sending a fourth control instruction to the control end of the analog switch; detecting the charging state of the USB equipment again, and charging the USB equipment in a mode matched with the charging state of the DCP when the detected charging state is the charging state of the DCP again;
after the power supply control circuit receives the first control instruction, the power supply line between the USB interface and the main controller is powered off;
after the control end of the analog switch receives the second control instruction, connecting the fixed end of the analog switch to the first switching end of the analog switch to trigger the USB equipment to be switched to the DCP charging state;
after receiving the third control instruction, the power supply control circuit powers on a power supply line between the USB interface and the main controller;
and after the control end of the analog switch receives the fourth control instruction, the fixed end of the analog switch is connected to the second switching end of the analog switch.
4. The method of claim 3, wherein the method further comprises:
and the main controller receives data sent by the USB equipment when the USB equipment is charged in a mode matched with the charging state of the DCP.
5. A charging device is characterized by comprising a main controller, a USB concentrator, N power supply control circuits, N analog switches and N USB interfaces:
the USB concentrator comprises an uplink port and N downlink ports, and the uplink port is connected with the main controller; the main controller is connected with one end of the ith power supply control circuit in the N power supply control circuits in an enabling mode, and the other end of the ith power supply control circuit is connected with a power line of the ith USN interface in the N USB interfaces; the control end of the ith analog switch in the N analog switches is connected with the main controller; the fixed end of the ith analog switch is connected with a positive and negative data signal line of the ith USB interface, and the positive and negative data signal line of the first switching end of the ith analog switch is in short circuit; the positive and negative data lines of the second switching end of the ith analog switch are connected with the positive and negative data signal lines of the ith downlink port in the N downlink ports of the USB concentrator; the fixed end of the ith analog switch is controlled by the control end of the ith analog switch to be selectively connected to the first switching end or the second switching end of the ith analog switch, wherein N is an integer greater than or equal to 1.
6. The charging apparatus according to claim 5, wherein the ith USB port is any one of a Type-a USB port, a Type-B USB port, and a Type-C USB port.
7. A method of charging using the charging device according to claim 5 or 6, wherein the method comprises:
the main controller responds to the fact that the USB equipment is connected into the ith USB interface, and detects the charging state of the USB equipment; if the detected charging state is not the charging state of the DCP, sequentially sending a first control instruction to the ith power supply control circuit, sending a second control instruction to the control end of the ith analog switch, sending a third control instruction to the ith power supply control circuit, and sending a fourth control instruction to the control end of the ith analog switch; detecting the charging state of the USB equipment again, and charging the USB equipment in a mode matched with the charging state of the DCP when the detected charging state is the charging state of the DCP again;
after the ith power supply control circuit receives the first control instruction, the power supply line between the ith USB interface and the main controller is powered off;
after the control end of the ith analog switch receives the second control instruction, connecting the fixed end of the ith analog switch to the first switching end of the analog switch to trigger the USB equipment to be switched to the DCP charging state;
after receiving a third control instruction, the ith power control circuit powers on a power line between the ith USB interface and the main controller;
and after the control end of the ith analog switch receives the fourth control instruction, the fixed end of the ith analog switch is connected to the second switching end of the ith analog switch.
8. The method of claim 7, wherein the method further comprises:
and the main controller receives data sent by the USB equipment when the USB equipment is charged in a mode matched with the charging state of the DCP.
9. A charging device, comprising:
the detection module is used for responding to the USB equipment to access the USB interface and detecting the charging state of the USB equipment;
the control module is used for sequentially sending a first control instruction, a second control instruction, a third control instruction and a fourth control instruction if the detected charging state is not the charging state of a special charging port DCP (digital data processing), wherein the first control instruction is used for powering off a power line connected with the USB interface, the second control instruction is used for triggering the USB equipment to be switched to the DCP charging state, the third control instruction is used for powering on the power line connected with the USB interface, and the fourth control instruction is used for indicating the connection with a positive data signal line and a negative data signal line of the USB interface;
the detection module is further used for detecting the charging state of the USB equipment again;
and the charging module is used for charging the USB equipment in a mode matched with the DCP charging state when the re-detected charging state is the DCP charging state.
10. The charging device of claim 9, further comprising a receiving module to:
and receiving data sent by the USB equipment when the USB equipment is charged in a mode matched with the charging state of the DCP.
CN202110137349.XA 2021-02-01 2021-02-01 Charging method and device Pending CN112838643A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110137349.XA CN112838643A (en) 2021-02-01 2021-02-01 Charging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110137349.XA CN112838643A (en) 2021-02-01 2021-02-01 Charging method and device

Publications (1)

Publication Number Publication Date
CN112838643A true CN112838643A (en) 2021-05-25

Family

ID=75931307

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110137349.XA Pending CN112838643A (en) 2021-02-01 2021-02-01 Charging method and device

Country Status (1)

Country Link
CN (1) CN112838643A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120210146A1 (en) * 2011-02-11 2012-08-16 Via Technologies, Inc. Adaptive usb charging method and system
CN103064489A (en) * 2011-10-21 2013-04-24 华为终端有限公司 Method for selecting internal circuit according to conditions of universal serial bus (USB) interface and terminal
CN106655316A (en) * 2016-09-21 2017-05-10 奇酷互联网络科技(深圳)有限公司 Charging circuit and terminal equipment
CN106774769A (en) * 2016-12-21 2017-05-31 浙江大华技术股份有限公司 The changing method and device of a kind of terminal work mode, handheld terminal
US20170277251A1 (en) * 2016-03-24 2017-09-28 Chengdu Monolithic Power Systems Co., Ltd. Adaptive power supply circuit and system
CN109861038A (en) * 2018-12-11 2019-06-07 苏州佳世达电通有限公司 It can automatically switch the USB Port and its control method of connection mode

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120210146A1 (en) * 2011-02-11 2012-08-16 Via Technologies, Inc. Adaptive usb charging method and system
CN103064489A (en) * 2011-10-21 2013-04-24 华为终端有限公司 Method for selecting internal circuit according to conditions of universal serial bus (USB) interface and terminal
US20170277251A1 (en) * 2016-03-24 2017-09-28 Chengdu Monolithic Power Systems Co., Ltd. Adaptive power supply circuit and system
CN106655316A (en) * 2016-09-21 2017-05-10 奇酷互联网络科技(深圳)有限公司 Charging circuit and terminal equipment
CN106774769A (en) * 2016-12-21 2017-05-31 浙江大华技术股份有限公司 The changing method and device of a kind of terminal work mode, handheld terminal
CN109861038A (en) * 2018-12-11 2019-06-07 苏州佳世达电通有限公司 It can automatically switch the USB Port and its control method of connection mode

Similar Documents

Publication Publication Date Title
US20200343756A1 (en) Fast Charging Method and System, Terminal, and Charger
CN103178583B (en) Mobile phone USB (Universal Serial Bus) interface charging system supporting charging for other mobile devices and charging realization method of mobile phone USB interface charging system
CN106230077B (en) A kind of power-supplying circuit of mobile terminal, method for controlling power supply and power management module
CN105896655B (en) Method for charging for electronic equipment and electronic equipment
CN105553001A (en) Charging method and intelligent terminal
CN104796011A (en) Charging method, AC adapter, charging managing device and terminal
CN103986217A (en) Charger outputting different voltages in self-adaptation mode and implementation method thereof
CN108535594A (en) Interface grafting abnormal detection circuit and method
CN114336815A (en) Multi-port charging control method
CN101102119A (en) A charging detection circuit of appliance device and charging detection method
CN102975627A (en) Battery management system and electric vehicle
CN201039411Y (en) A mobile phone with self-adapted charging device
CN111880635A (en) Electronic equipment and power supply control method and power supply control system thereof
JP2018529301A (en) Power adapter, terminal device, charging system, and charging method
CN108181978B (en) Power control method and device for electronic equipment
CN112838643A (en) Charging method and device
KR20230016688A (en) Chargers, data lines and charging equipment
CN104917245A (en) Charging management circuit, mobile terminal and charging control method of mobile terminal
CN112637427A (en) Rack type multi-port voice equipment testing tool and testing method
US10481576B2 (en) Method and device for implementing connection control
CN107706977B (en) Charging current detection method and charging device
CN103001261A (en) Universal charger with USB (universal serial bus)
CN211579637U (en) One drags many charging wires
CN103296864B (en) Power supply in response to various control signal format
CN205304589U (en) Power source control circuit

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210525

RJ01 Rejection of invention patent application after publication