Electronic device and reverse charging method
By introducing a processor and a reverse charging power module into electronic devices, the device can detect the fast charging mode and switch to reverse fast charging mode, thus solving the problem of slow charging speed and achieving fast charging and effective power supply.
Patent Information
- Application Number
- PCT/CN2025/105704
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-02
- Filing Date
- 2025-06-30
- Publication Date
- 2026-02-05
AI Technical Summary
Existing electronic devices charge slowly when charging mobile phones and other devices, and users may find that the battery level decreases as the device is charged.
An electronic device is provided, comprising a processor, a peripheral interface, and a reverse charging power module. By detecting a slave device connected to the peripheral interface, the reverse charging power module is controlled to provide power at a first power, and when the slave device supports fast charging mode, it switches to reverse fast charging mode to provide power at a second power, thereby improving charging speed.
It enables fast charging of devices, improves charging efficiency, and avoids the problem of power reduction caused by using the device while charging.
Smart Images

Figure CN2025105704_05022026_PF_FP_ABST
Abstract
Description
Electronic device and reverse charging method
[0001] Cross-reference to Related Applications
[0002] This application claims priority to the Chinese Patent Application No. 202411060083.3, filed on August 2, 2024, and entitled “Electronic device and reverse charging method”, the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0003] The present application relates to the technical field of device charging, and in particular to an electronic device and a reverse charging method. BACKGROUND
[0004] Electronic devices such as notebook computers, tablet computers, etc. usually use large-capacity batteries and can charge other devices reversely, for example, charge mobile phones and other devices. For example, in a scenario where a user carries multiple portable electronic devices, when the mobile phone and other electronic devices are low on power, the user can use the electronic device with a large battery to perform emergency charging on the mobile phone.
[0005] However, using an electronic device to charge a mobile phone is usually slow, and if the user is using the mobile phone, it may also appear that the phone is being charged while being used, and the phone's power is becoming less and less.
[0006] Therefore, how to use an electronic device to quickly charge a slave device such as a mobile phone is a problem to be solved. SUMMARY
[0007] The present application provides an electronic device and a reverse charging method, which can quickly charge a slave device.
[0008] In a first aspect, the present application provides an electronic device, which includes a processor, a peripheral interface, and a reverse charging power supply module. The peripheral interface is used to connect a slave device. The processor is used to control the reverse charging power supply module to provide power to the slave device at a first power when it is detected that the peripheral interface is connected to the slave device. When the slave device supports a fast charging mode, the processor controls the reverse charging power supply module to provide power to the slave device at a second power, which is greater than the first power. For example, the electronic device can be a notebook computer, a tablet computer, a personal computer, a mobile phone box, etc.
[0009] The electronic device provided in the application comprises a reverse charging power supply module. When detecting that the peripheral interface is connected to a slave device, the reverse charging power supply module provides power for the slave device at a first power. At this time, the electronic device is in a reverse charging mode. When the slave device supports a fast charging mode, the reverse charging power supply module provides power for the slave device at a second power. At this time, the electronic device is switched from the reverse charging mode to a reverse fast charging mode, and higher charging power can be provided for the slave device connected to the peripheral interface, so that the charging speed can be improved to quickly charge the slave device.
[0010] In an optional implementation, the electronic device provided in the application further comprises a protocol processing module. The protocol processing module can be used to determine whether the slave device supports the fast charging mode. The protocol processing module and the processor can be arranged in the same chip or can be independently arranged in different chips.
[0011] In the implementation, the protocol processing module can be used to determine whether the slave device supports the fast charging mode. If it is determined that the slave device does not support the fast charging mode, the electronic device can remain in the reverse charging mode. If the slave device supports the fast charging mode, the electronic device can be switched from the reverse charging mode to the reverse fast charging mode to quickly charge the slave device.
[0012] In an optional implementation, the protocol processing module can be used to determine that the slave device supports the fast charging mode by at least one of the following manners: obtaining a device descriptor of the slave device, determining that the slave device supports the fast charging mode based on the device descriptor; or performing voltage detection on a Dp pin or a Dm pin in the peripheral interface, and determining that the slave device supports the fast charging mode when a set pulse is detected.
[0013] In the implementation, the protocol processing module can determine whether the slave device supports the fast charging mode based on the device descriptor of the slave device or by performing voltage detection on the Dp pin or the Dm pin in the peripheral interface.
[0014] In an optional implementation, the peripheral interface comprises a CC pin and a VBUS pin. When detecting that the peripheral interface is connected to the slave device, the processor can control the peripheral interface to be in a standard downstream port (SDP) mode, control the CC pin to be in communication with the slave device, and control the reverse charging power supply module to output a first voltage through the VBUS pin to provide power for the slave device at the first power.
[0015] In the implementation, when in the reverse charging mode, the peripheral interface of the electronic device is in the SDP mode, so that data transmission can be performed between the electronic device and the slave device, and therefore, devices such as a U disk, a digital earphone or a display can be compatible.
[0016] In an optional implementation, the processor can further be configured to, when the protocol processing module determines that the slave device supports the fast charging mode, control the CC pin to be disconnected from the slave device, and control the VBUS pin to stop outputting the first voltage; after waiting for a set time length, control the CC pin to be connected to the slave device again, and the peripheral interface is in a dedicated charging port (DCP) mode; after detecting that the slave device accesses the peripheral interface again, control the reverse charging power supply module to output the second voltage through the VBUS pin to provide the slave device with the second power.
[0017] The processor can further be configured to, before providing the slave device with the second power, negotiate with the slave device through the protocol processing module using a fast charging protocol.
[0018] In the above implementation, when switching from the reverse charging mode to the reverse fast charging mode, the electronic device simulates the cable to be pulled out and reinserted, so that the slave device considers that the cable is pulled out and then reinserted to detect that the peripheral interface of the electronic device is in the DCP mode, and therefore negotiates with the fast charging protocol to start the reverse fast charging mode.
[0019] In an optional implementation, the processor can further be configured to, when the protocol processing module determines that the slave device supports the fast charging mode, output first prompt information; the first prompt information is used to prompt the user that the electronic device supports switching to the reverse fast charging mode; and the processor controls the reverse charging power supply module to provide the slave device with the second power in response to the received mode switching operation.
[0020] In the above implementation, an operation interface is provided for the user, and the user can select whether to start the reverse fast charging mode according to needs.
[0021] In an optional implementation, the processor can further be configured to, after providing the slave device with the second power, output second prompt information; the second prompt information is used to prompt the user that the current is in the reverse fast charging mode.
[0022] In an optional implementation, the processor can further be configured to, after outputting the second prompt information, control the reverse charging power supply module to provide the slave device with the first power in response to a received exit operation.
[0023] In the above implementation, an operation interface is provided for the user, and the user can exit the reverse fast charging mode in a timely manner based on the operation of the user when the user needs to exit the reverse fast charging mode.
[0024] In a second aspect, the present application provides a reverse charging method, which can be executed by the electronic device provided in the first aspect. The method can include the following steps:
[0025] When detecting that the peripheral interface is connected to the slave device, providing the slave device with the first power;
[0026] When the slave device supports the fast charging mode, the electronic device provides power to the slave device at a second power; the second power is greater than the first power.
[0027] In an optional implementation, the electronic device can determine that the slave device supports the fast charging mode by at least one of the following manners:
[0028] Obtaining a device descriptor of the slave device, and determining that the slave device supports the fast charging mode based on the device descriptor;
[0029] Performing voltage detection on a Dp pin or a Dm pin in the peripheral interface, and determining that the slave device supports the fast charging mode when a set pulse is detected.
[0030] In an optional implementation, when the electronic device provides power to the slave device at the first power, the electronic device can:
[0031] Controlling the peripheral interface to be in a standard downstream port (SDP) mode, and controlling a CC pin in the peripheral interface to be in communication with the slave device;
[0032] Controlling a VBUS pin in the peripheral interface to output the first voltage, and providing power to the slave device at the first power.
[0033] In an optional implementation, when the electronic device determines that the slave device supports the fast charging mode, and provides power to the slave device at the second power, the electronic device can:
[0034] Controlling the CC pin in the peripheral interface to be disconnected from the slave device, and controlling the VBUS pin in the peripheral interface to stop outputting the first voltage;
[0035] After waiting for a set time length, controlling the CC pin in the peripheral interface to be in communication with the slave device again, and controlling the peripheral interface to be in a dedicated charging port (DCP) mode;
[0036] After detecting that the slave device accesses the peripheral interface again, controlling the VBUS pin in the peripheral interface to output the second voltage, and providing power to the slave device at the second power.
[0037] In an optional implementation, before the electronic device provides power to the slave device at the second power, the electronic device can negotiate with the slave device using a fast charging protocol.
[0038] In an optional implementation, when the slave device supports the fast charging mode, the electronic device can output first prompt information; the first prompt information is used to prompt a user that the electronic device supports switching to the reverse fast charging mode.
[0039] In response to the received mode switching operation, providing power to the slave device at the second power.
[0040] In an optional implementation, after providing the power for the slave device at the second power, the electronic device can:
[0041] output second prompt information; the second prompt information is used to prompt the user that the current is in the reverse fast charging mode.
[0042] In an optional implementation, after outputting the second prompt information, the electronic device can:
[0043] in response to the received exit operation, provide the power for the slave device at the first power.
[0044] In a third aspect, the present application provides a charging system, which can include an electronic device and a slave device; the slave device can be connected with the electronic device through a peripheral interface of the electronic device, and the electronic device charges the slave device; wherein the electronic device can adopt any one of the electronic devices provided in the first aspect.
[0045] In a fourth aspect, the present application provides an electronic device, which can include a processor, a peripheral interface, a reverse charging power supply module;
[0046] the peripheral interface is connected with the reverse charging power supply module;
[0047] the processor is connected with the reverse charging power supply module, and is configured to: when detecting that the peripheral interface is connected with the slave device, control the reverse charging power supply module to provide the power for the slave device at the first power; and when the slave device supports the fast charging mode, control the reverse charging power supply module to provide the power for the slave device at the second power; the second power is greater than the first power.
[0048] The "connection" in the present application can be direct connection or indirect connection through an intermediate medium.
[0049] In an optional implementation, the peripheral interface includes a VBUS pin; the reverse charging power supply module is connected with the slave device through the VBUS pin; the first voltage is output through the VBUS pin to provide the power for the slave device at the first power; or the second voltage is output through the VBUS pin to provide the power for the slave device at the second power.
[0050] In an optional implementation, the peripheral interface can include a Dp pin or a Dm pin; the electronic device further includes a protocol processing module connected with the peripheral interface;
[0051] the protocol processing module acquires the device descriptor of the slave device through the peripheral interface, and determines that the slave device supports the fast charging mode based on the device descriptor; and / or,
[0052] the protocol processing module performs voltage detection on the Dp pin or the Dm pin to determine that the slave device supports the fast charging mode.
[0053] In an optional implementation, the electronic device further comprises a mode switch; a first end of the mode switch is connected with the Dp pin, and a second end of the mode switch is connected with the Dm pin.
[0054] When the mode switch is turned off, the Dp pin is disconnected with the Dm pin, and the peripheral interface is in a standard downstream port SDP mode; when the mode switch is turned on, the Dp pin is short-circuited with the Dm pin, and the peripheral interface is in a dedicated charging port DCP mode.
[0055] In an optional implementation, the protocol processing module and the processor can be the same module and be arranged in the same chip; or the protocol processing module and the processor can be two independent modules and be arranged in different chips.
[0056] In an optional implementation, the peripheral interface comprises a CC pin; the electronic device further comprises a power charging module, and the power charging module comprises a pull-up resistor Rp and a pull-down resistor Rd.
[0057] When the CC pin is connected with the pull-down resistor Rd, the CC pin is disconnected with the slave device; when the CC pin is connected with the pull-up resistor Rp, the CC pin is connected with the slave device.
[0058] In a fifth aspect, the present application provides a charging system, which can comprise an electronic device and a slave device; the electronic device comprises a processor, a peripheral interface, and a reverse charging power supply module; the slave device comprises a power charging module and a power supply.
[0059] The peripheral interface of the electronic device is connected with the power charging module of the slave device; the power charging module of the slave device is connected with the power supply of the slave device.
[0060] The reverse charging power supply module of the electronic device is connected with the peripheral interface.
[0061] The processor of the electronic device is connected with the reverse charging power supply module, and is configured to control the reverse charging power supply module to charge the power supply of the slave device with a first power when detecting that the peripheral interface is connected with the slave device; and when the slave device supports a fast charging mode, the processor controls the reverse charging power supply module to charge the power supply of the slave device with a second power; the second power is greater than the first power.
[0062] In an optional implementation, the peripheral interface comprises a CC pin; the electronic device further comprises a pull-up resistor Rp1; the slave device further comprises a pull-down resistor Rp2.
[0063] The CC pin is configured to be connected with the pull-down resistor Rp2 in the slave device; when the CC pin is connected with the pull-up resistor Rp1, a current path is formed among the pull-up resistor Rp1, the CC pin, and the pull-down resistor Rp2.
[0064] In a sixth aspect, the present application provides a computer readable storage medium storing computer executable instructions for causing a computer to perform any of the reverse charging methods provided in the second aspect.
[0065] In a seventh aspect, the present application provides a computer program product containing computer executable instructions for causing a computer to perform any of the reverse charging methods provided in the second aspect.
[0066] The technical effects achieved by any of the second aspect to the seventh aspect can refer to the beneficial effects described in the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0067] FIG. 1 is a schematic diagram of a charging system according to an embodiment of the present application;
[0068] FIG. 2 is a schematic diagram of an electronic device according to an embodiment of the present application;
[0069] FIG. 3 is a schematic diagram of a charging mode supported by an electronic device according to an embodiment of the present application;
[0070] FIG. 4 is a flowchart of a reverse charging method according to an embodiment of the present application;
[0071] FIG. 5 is a schematic diagram of an electronic device connected to a slave device according to an embodiment of the present application;
[0072] FIG. 6 is a schematic diagram of a CC pin communication state according to an embodiment of the present application;
[0073] FIG. 7 is a schematic diagram of a set pulse according to an embodiment of the present application;
[0074] FIG. 8 is a flowchart of a charging mode switching process according to an embodiment of the present application;
[0075] FIG. 9 is a state change diagram of various pins in a charging mode switching process according to an embodiment of the present application;
[0076] FIG. 10 is a schematic diagram of a CC pin disconnection state according to an embodiment of the present application;
[0077] FIG. 11 is a schematic diagram of a user interface according to an embodiment of the present application;
[0078] FIG. 12 is a schematic diagram of another user interface according to an embodiment of the present application;
[0079] FIG. 13 is a flowchart of another charging mode switching process according to an embodiment of the present application;
[0080] FIG. 14 is a flowchart of another reverse charging method provided by the embodiments of the present application. DETAILED DESCRIPTION
[0081] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below with reference to the drawings. The terms used in the embodiment part of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0082] Before introducing the specific solutions provided by the embodiments of the present application, some terms in the present application are explained and described, so as to facilitate the understanding of those skilled in the art, and do not limit the terms in the present application.
[0083] (1) Dual role power (DRP) device: an electronic device including a universal serial bus (USB) interface, the USB interface can be used as a data transmission port, and can also be used as a charging port. When the USB interface is used as a data transmission port, it can be used as an uplink port, i.e., the electronic device is a slave device to be accessed, or can be used as a downlink port, i.e., the electronic device is a master device to access a slave device connected through the USB interface; when the USB interface is used as a charging port, the electronic device can be a charged device, or can be a master device to provide power externally. The process in which the electronic device provides power externally as a master device can be referred to as reverse charging.
[0084] (2) Power delivery (PD) protocol: also referred to as USB-PD protocol, is a fast charging specification formulated by the USB standard organization.
[0085] In the embodiments of the present application, unless otherwise explicitly specified and limited, the term "connection" should be understood broadly, for example, the "connection" can be a fixed connection, or can be detachable, or can be integrated; can be directly connected, or can be indirectly connected through an intermediate medium. In addition, the term "connection" can be an electrical connection mode for realizing signal transmission.
[0086] In the embodiments of the present application, "multiple" refers to two or more, and therefore, "multiple" can also be understood as "at least two" in the embodiments of the present application. "At least one" can be understood as one or more, for example, one, two or more. For example, "including at least one" means including one, two or more, and does not limit which ones are included, for example, including at least one of A, B and C means that A, B, C, A and B, A and C, B and C, or A and B and C can be included. "And / or" describes the association relationship of the associated objects, which means that there can be three kinds of relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the character " / ", unless otherwise specified, generally represents an "or" relationship between the associated objects before and after it.
[0087] Unless otherwise stated, the ordinal numbers "first", "second", etc. mentioned in the embodiments of the present application are used to distinguish a plurality of objects, and are not used to limit the order, time sequence, priority or importance of the plurality of objects.
[0088] Electronic devices equipped with large batteries can be used to reverse charge externally due to the large capacity of the large batteries. For example, the charging system shown in FIG. 1 includes electronic device 100 and electronic device 200, which are connected by cable 300. Electronic device 100 can charge electronic device 200 through cable 300. Electronic device 100 can act as a master device, and electronic device 200 can act as a slave device. In FIG. 1, electronic device 100 is exemplified by a notebook computer, electronic device 200 is exemplified by a mobile phone, and cable 300 is exemplified by a USB cable. A typical application scenario is that a user carries multiple portable electronic devices at the same time. When the mobile phone and other electronic devices are low on power, the user can use a notebook computer, tablet computer or other electronic device with a large battery capacity to perform emergency charging on the mobile phone. A notebook computer, tablet computer or other electronic device usually has a maximum capacity of 10,000 mAH or more, and therefore can be used to charge a mobile phone.
[0089] It should be noted that in the embodiments of the present application, the electronic device 100 is not limited to a notebook computer, and the electronic device 100 can also be a tablet computer, a personal computer (PC), an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a virtual reality device, a vehicle terminal device, a mobile phone box, and the like. The electronic device 200 is not limited to a mobile phone, and the electronic device 200 can also be a tablet computer, a notebook computer, a wearable electronic device, a handheld computer, a PDA, and the like. The cable 300 is not limited to a USB cable, and the cable 300 can also be a communication cable under other protocols.
[0090] As shown in FIG. 1, the cable 300 includes a plug P1 and a plug P2 at both ends of the cable. The plug P1 can be plugged into the peripheral interface of the electronic device 100, and the plug P2 can be plugged into the peripheral interface of the electronic device 200, so as to realize the connection of the electronic device 100 and the electronic device 200. When the cable 300 is a USB cable, the peripheral interfaces of the electronic device 100 and the electronic device 200 can be USB interfaces, for example, Type-C interfaces in USB; when the cable 300 is a cable under other protocols, the peripheral interfaces of the electronic device 100 and the electronic device 200 can be interfaces corresponding to other protocols. After the electronic device 100 and the electronic device 200 are connected, data can be transmitted through the cable 300, or charging control signals or charging signals for charging negotiation can be transmitted through the cable 300. When the electronic device 100 charges the electronic device 200, the electronic device 100 can be referred to as a master device, and the electronic device 200 can be referred to as a slave device.
[0091] At present, when using an electronic device to charge a slave device such as a mobile phone, the charging speed is usually slow, and if the user is using the mobile phone, the mobile phone may also appear to be charging while using, and the battery capacity of the mobile phone becomes less and less.
[0092] Based on this, the electronic device provided in the embodiments of the present application can include a processor, a peripheral interface and a reverse charging power supply module. The peripheral interface is configured to connect a slave device. The processor is configured to control the reverse charging power supply module to provide power for the slave device at a first power when it is detected that the peripheral interface is connected to the slave device. When the slave device supports a fast charging mode, the processor controls the reverse charging power supply module to provide power for the slave device at a second power, which is greater than the first power. The electronic device provided in the embodiments of the present application includes the reverse charging power supply module, which can provide higher charging power for the slave device connected to the peripheral interface, so that the power supply capability of the electronic device is greatly improved. When it is detected that the peripheral interface is connected to the slave device, the reverse charging power supply module provides power for the slave device at the first power, at this time, the electronic device is in a reverse charging mode. When the slave device supports the fast charging mode, the reverse charging power supply module provides power for the slave device at the second power, at this time, the electronic device is switched from the reverse charging mode to a reverse fast charging mode, the charging efficiency is improved, so that the charging speed can be improved to quickly charge the slave device.
[0093] FIG. 2 shows a structural schematic diagram of an electronic device according to an embodiment of the present application. As shown in FIG. 2, the electronic device 100 can include a processor 110, a power supply 120, a power charging module 130, a protocol processing module 140, a reverse charging power supply module 150 and a peripheral interface 160. The processor 110, the power charging module 130, the protocol processing module 140, the reverse charging power supply module 150 and the peripheral interface 160 can be connected to each other through a bus. The bus can be an inter-integrated circuit (I2C) bus, a pulse code modulation (PCM) bus, a universal asynchronous receiver / transmitter (UART) bus, a mobile industry processor interface (MIPI) bus, a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0094] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a central processing unit (CPU), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, etc. The processor 110 can also include other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor. Different processing units can be independent devices or integrated in one or more processor chips.
[0095] The power supply 120 can be understood as a battery, for example, a large-capacity battery. The power supply 120 can be used to power the processor 110, the protocol processing module 140, the reverse charging power supply module 150, and other functional modules in the electronic device. Taking a tablet computer as an example, the power supply 120 can adopt a lithium battery, including multiple battery groups. For example, the power supply 120 can include two battery groups, each battery group can include one or more lithium batteries connected in series, and the two battery groups can be connected in parallel, with a capacity of 10000mAh. The maximum charging current of the two battery groups is 12A, the highest voltage that can be provided during reverse charging is 10V, and the maximum current that can be provided during reverse charging is 4A.
[0096] The power supply charging module 130 can be used to receive charging input from a charger to charge the power supply 120. As shown in FIG. 2, the power supply charging module 130 is connected with the peripheral interface 160, and can connect an external charger through the peripheral interface 160. Hereinafter, the peripheral interface 160 is taken as an example of a Type-C interface in a USB. The power supply charging module 130 can include a power supply pin, a CC1 pin, a CC2 pin, a Dp pin, and a Dm pin. The peripheral interface 160 can include a VBUS pin, a CC1 pin, a CC2 pin, a Dp pin, a Dm pin, and a GND pin.
[0097] The VBUS pin and the GND pin are power pins for transmitting power. The VBUS pin in the peripheral interface 160 is connected to the power pin in the power charging module 130, and the GND pin is grounded. The CC1 pin and the CC2 pin can be collectively referred to as a configuration channel (CC) pin, which is a configuration pin of a USB power delivery (PD) protocol. The CC1 pin in the peripheral interface 160 is connected to the CC1 pin in the power charging module 130, and the CC2 pin in the peripheral interface 160 is connected to the CC2 pin in the power charging module 130. The Dp pin and the Dm pin are a pin pair for transmitting USB data, the Dp pin is used to connect an external data plus (DP) transmission line, and can also be referred to as a D+ pin; the Dm pin is used to connect an external data minus (DM) transmission line, and can also be referred to as a D- pin. The Dp pin in the peripheral interface 160 is connected to the Dp pin in the power charging module 130, and the Dm pin in the peripheral interface 160 is connected to the Dm pin in the power charging module 130.
[0098] The peripheral interface 160 can also be used to connect an external slave device. The electronic device 100 can perform data transmission with the slave device, or charge the slave device based on a set charging protocol. The number of peripheral interfaces 160 can be one or multiple.
[0099] The power charging module 130 can include a PD physical layer (PD Phy) chip, which can be used to control the connection or disconnection of the CC pin with an external slave device, and the specific process will be described in detail below.
[0100] The protocol processing module 140 is used to communicate with the slave device for a charging protocol. The protocol processing module 140 includes a Dp pin and a Dm pin, the Dp pin in the protocol processing module 140 is connected to the Dp pin in the peripheral interface 160, and the Dm pin in the protocol processing module 140 is connected to the Dm pin in the peripheral interface 160. The protocol processing module 140 can perform voltage detection on the Dp pin or the Dm pin in the peripheral interface 160, so as to distinguish whether the slave device supports a fast charging mode. If the slave device supports the fast charging mode, the electronic device 100 can use a second power to quickly charge the slave device.
[0101] In some embodiments, the protocol processing module 140 can be included in the processor 110, or be disposed in the same chip as the processor 110.
[0102] The reverse charging power supply module 150 is connected to the VBUS pin in the power supply 120 and the peripheral interface 160, and is configured to output a voltage through the VBUS pin in the peripheral interface 160 to charge the slave device. The reverse charging power supply module 150 can implement direct current-direct current (DC-DC) voltage conversion to provide a voltage required by the slave device. The reverse charging power supply module 150 can adopt a Boost circuit or a Buckboost circuit to provide higher charging power and provide fine voltage regulation capability, and the step of voltage regulation can be 0.1 V or 0.02 V, which can meet various fast charging power supply regulation indexes and has overcurrent protection and overtemperature protection capability. The output current can be regulated according to the power of the electronic device, so that the electronic device can normally work while the high-power output charges the slave device.
[0103] In some embodiments, the reverse charging power supply module 150 can be included in the power supply charging module 130 or arranged in the same chip as the power supply charging module 130.
[0104] In some embodiments, the electronic device 100 can further include a mode switch 170, one end of the mode switch 170 can be connected to the Dp pin in the peripheral interface 160, and the other end can be connected to the Dm pin in the peripheral interface 160. The mode switch 170 can be controlled by the processor 110 to control the opening and closing of the Dp pin and the Dm pin, so as to change the working mode of the Dp pin and the Dm pin. The specific process will be described in detail below.
[0105] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0106] The electronic device provided by the embodiments of the present application can support the three charging modes shown in FIG. 3: the reverse charging mode, the reverse fast charging mode, and the charging only mode, and the three charging modes can be switched to each other.
[0107] In the reverse charging mode, the electronic device can simultaneously perform data transmission and charging protocol communication, i.e., the electronic device is a DRP device, the USB interface can be used as a data transmission port and also as a charging port. When the USB interface is used as a data transmission port, the electronic device can be on the UFP side or the DFP side, and the Dp pin and the Dm pin in the USB interface are used to transmit USB data; when the USB interface is used as a charging port, the electronic device can be a source.
[0108] In the charging only mode, the charger charges the electronic device, and the electronic device can simultaneously perform data transmission and charging protocol communication, i.e., the electronic device is a DRP device, the USB interface can be used as a data transmission port and also as a charging port. When the USB interface is used as a data transmission port, the electronic device can be on the UFP side or the DFP side, and the Dp pin and the Dm pin in the USB interface are used to transmit USB data; when the USB interface is used as a charging port, the electronic device can be a sink.
[0109] In the reverse fast charging mode, the electronic device can perform charging protocol communication, i.e., the USB interface can be used as a charging port, and the electronic device can be a source. The Dp pin and the Dm pin in the USB interface are used to transmit information such as voltage and current adjustment during the charging protocol communication.
[0110] FIG. 4 exemplarily shows a reverse charging method for charging a slave device by an electronic device according to an embodiment of the present application.
[0111] As shown in FIG. 4, the method can include the following steps:
[0112] S401, when detecting that the slave device is connected to the external interface, the electronic device provides power to the slave device at a first power.
[0113] When the electronic device and the slave device are not connected, the default state of the electronic device is a DRP, and the state of the slave device is a try sink or a try source.
[0114] The embodiment is described by taking the USB interface as an example. As shown in FIG. 5, the electronic device and the slave device can be connected through the USB interface and the USB cable. The VBUS pin in the USB interface of the electronic device is connected with the power charging module in the slave device, and the battery of the slave device is charged through the power charging module in the slave device. The CC1 pin and the CC2 pin in the USB interface of the electronic device are connected with the power charging module in the slave device, and the Dp pin and the Dm pin in the USB interface of the electronic device are connected with the power charging module and the processor in the slave device, which are used for communication of the charging protocol. In some embodiments, the power charging module of the slave device can include a charging unit and a protocol processing unit. The VBUS pin in the USB interface of the electronic device is connected with the charging unit in the power charging module of the slave device, and the CC1 pin, the CC2 pin, the Dp pin and the Dm pin in the USB interface of the electronic device are connected with the protocol processing unit in the power charging module of the slave device.
[0115] When the USB cable is inserted into the USB interface of the electronic device and the slave device is connected through the USB cable, the PD physical layer chip in the electronic device reports the SRC (source) event to the processor. The processor of the electronic device determines that the device is inserted into the USB interface, and performs charging protocol negotiation with the device inserted into the USB interface through the protocol processing module. The charging protocol can be, but is not limited to, the PD protocol. After negotiation, the electronic device can determine whether the device inserted into the USB interface is a charger or a slave device.
[0116] If the device inserted into the USB interface is a slave device, the electronic device enters a reverse charging mode to provide power for the slave device at a first power. Exemplarily, the processor of the electronic device can control the USB interface to be in a standard downstream port (SDP) mode, and the Dp pin and the Dm pin in the USB interface are in a disconnected state. At this time, the CC pin in the USB interface is in communication with the slave device, where the CC pin can be the CC1 pin, or the CC pin can be the CC2 pin, or the CC pin can be the CC1 pin and the CC2 pin; as shown in FIG. 6, taking the CC1 pin in the USB interface of the electronic device as an example, the CC1 pin in the USB interface is connected to the CC1 pin in the power charging module of the electronic device, the CC1 pin in the power charging module is connected to the Rpl resistor in the power charging module of the electronic device, and the power is connected through the Rpl resistor; and the CC1 pin in the USB interface of the electronic device is connected to the CC1 pin in the USB interface of the slave device, and the CC1 pin in the USB interface of the slave device is connected to the Rd2 resistor in the slave device, and the ground is connected through the Rd2 resistor, so that the power supply→Rpl resistor→CC1 pin→Rd2 resistor→ground wire forms a current path, and the CC1 pin in the USB interface of the electronic device is in communication with the slave device. Wherein, the Rpl resistor is a resistor pull-up (RP), and the Rd2 resistor is a resistor pull-down (RD).
[0117] When the electronic device enters the reverse charging mode, the processor of the electronic device can also control the reverse charging power module to output a first voltage through the VBUS pin in the USB interface to provide power for the slave device at a first power. Wherein, the amplitude of the first voltage can be 5V, and the first power can be 5V*0.5A, or 5V*1.5A. The reverse charging mode supports the on-the-go (OTG) mode of the mobile device, in the OTG mode, the electronic device can simultaneously reverse charge and communicate, for example, when the slave device is a USB interface device such as a U disk, an extended hard disk type expansion device, a digital earphone or a display, the electronic device in the reverse charging mode can perform data transmission with the above-mentioned USB interface device, so as to ensure that the electronic device can be compatible with the U disk, the display and other USB interface devices in the reverse power supply scene. In the reverse charging mode, the processor of the electronic device can also adjust the first voltage output by the reverse charging power module.
[0118] S402, when the slave device supports the fast charging mode, the electronic device provides power for the slave device at a second power; the second power is greater than the first power.
[0119] In some embodiments, the electronic device can determine whether the slave device supports the fast charging mode through the protocol processing module.
[0120] In an alternative embodiment, the protocol processing module can receive the device descriptor sent by the slave device through the USB interface, and determine whether the slave device supports the fast charging mode based on the device descriptor of the slave device. For example, when the electronic device is in the reverse charging mode, the USB interface of the electronic device is in the SDP mode, data transmission can be performed, and the device descriptor sent by the slave device is received through the Dp pin and the Dm pin. The device descriptor can include the vendor information and the product model information of the slave device. The vendor information can also be referred to as the vendor identity (VID), which refers to the registration information of the manufacturer of the slave device registered in the standard organization. The product model information can also be referred to as the product identity (PID). The protocol processing module obtains the device descriptor of the slave device through the Dp pin and the Dm pin, and determines whether the slave device is a device produced by a specified manufacturer based on the vendor information in the device descriptor. For example, the electronic device can pre-store the vendor information of multiple specified manufacturers. If the vendor information in the device descriptor does not belong to the pre-stored vendor information of the specified manufacturers, it indicates that the slave device is not a device produced by a specified manufacturer, and it can be considered that the slave device does not support the fast charging mode. If the vendor information in the device descriptor belongs to the pre-stored vendor information of the specified manufacturers, it indicates that the slave device is a device produced by a specified manufacturer, and it can be further determined whether the slave device supports the fast charging mode based on the product model information in the device descriptor. If the product model information of the slave device does not belong to the set product model range, it can be considered that the slave device does not support the fast charging mode. If the product model information of the slave device belongs to the set product model range, it can be considered that the slave device supports the fast charging mode.
[0121] In another alternative embodiment, the protocol processing module can determine whether the slave device supports the fast charging mode by voltage detection on the Dp pin or the Dm pin in the USB interface. Illustratively, when the electronic device is in the reverse charging mode, the slave device is the powered end, and the slave device can determine whether the master device (i.e., the electronic device) supports data transmission through the BC1.2 protocol in the USB standard protocol. If it is determined based on the BC1.2 protocol that the master device is in the SDP mode or the charging downstream port (CDP) mode, the slave device can consider that the master device supports data transmission. If it is determined based on the BC1.2 protocol that the master device is in the dedicated charging port (DCP) mode, the slave device can consider that the master device does not support data transmission. In this process, as shown in FIG. 7, the slave device can send a set pulse to the master device (i.e., the electronic device) based on the BC1.2 protocol, and the Dp pin or the Dm pin in the USB interface of the electronic device can receive the set pulse sent by the slave device. The set pulse is a BC1.2 protocol pulse with a voltage amplitude of 0.4V-0.8V and a pulse width greater than 8ms. The BC1.2 protocol belongs to the specification in the fast charging protocol, and if the slave device sends the BC1.2 protocol pulse, it means that the slave device supports the fast charging protocol, that is, supports the fast charging mode. Therefore, the protocol processing module of the electronic device can determine whether the slave device supports the fast charging mode by voltage detection on the Dp pin or the Dm pin in the USB interface. Taking the Dp pin as an example, if the protocol processing module performs voltage detection on the Dp pin and detects a set pulse with a voltage amplitude of 0.4V-0.8V and a pulse width greater than 8ms, it can be considered that the slave device supports the fast charging mode. Otherwise, it can be considered that the slave device does not support the fast charging mode.
[0122] In another alternative embodiment, the protocol processing module can determine whether the slave device supports the fast charging mode in combination with the device descriptor of the slave device and voltage detection on the Dp pin or the Dm pin in the USB interface. Illustratively, the protocol processing module can obtain the device descriptor of the slave device through the Dp pin and the Dm pin, and determine whether the slave device is a device produced by a specified manufacturer based on the vendor information in the device descriptor. If the slave device is not a device produced by the specified manufacturer, it can be considered that the slave device does not support the fast charging mode. If the slave device is a device produced by the specified manufacturer, the protocol processing module can further perform voltage detection on the Dp pin or the Dm pin in the USB interface. Taking the Dm pin as an example, if the protocol processing module performs voltage detection on the Dm pin and detects a set pulse with a voltage amplitude of 0.4V-0.8V and a pulse width greater than 8ms, it can be considered that the slave device supports the fast charging mode. Considering that some slave devices supporting the fast charging mode can not send the set pulse, to avoid misjudgment, when the set pulse is not detected, the protocol processing module can further determine whether the slave device supports the fast charging mode based on the product model information in the device descriptor. If the product model information of the slave device does not belong to a set product model range, it can be considered that the slave device does not support the fast charging mode; if the product model information of the slave device belongs to the set product model range, it can be considered that the slave device supports the fast charging mode.
[0123] In some embodiments, if the protocol processing module determines that the slave device does not support the fast charging mode, for example, the slave device is a USB interface device such as a U disk or a display, the electronic device can maintain the reverse charging mode, in which the electronic device can perform data transmission with the slave device through the USB interface, so that the electronic device can be compatible with the U disk, the display and other USB interface devices.
[0124] When the protocol processing module determines that the slave device supports the fast charging mode, the electronic device can switch from the reverse charging mode to the reverse fast charging mode to provide power to the slave device with a second power, which is greater than the first power described above. As shown in FIG. 8, the process can include the following steps:
[0125] S4021, the electronic device controls the CC pin in the peripheral interface to be disconnected from the slave device.
[0126] When the protocol processing module determines that the slave device supports the fast charging mode, the processor of the electronic device can control the CC pin in the USB interface to be disconnected from the slave device. As shown in FIG. 9, when the USB interface of the electronic device is in the SDP mode, the processor can control the CC pin in the USB interface to be connected to Rd1 resistor in the power charging module of the electronic device through the PD physical layer chip in the power charging module. At this time, the CC pin outputs low level for at least 50 ms, so that the CC pin is disconnected from the slave device. Still taking the CC1 pin in the USB interface of the electronic device as an example, as shown in FIG. 10, the CC1 pin in the USB interface is connected to the CC1 pin in the power charging module of the electronic device, the CC1 pin in the power charging module is connected to Rd1 resistor in the power charging module of the electronic device, and the Rd1 resistor is connected to ground through Rp1 resistor. The CC1 pin in the USB interface of the electronic device is connected to the CC1 pin in the USB interface of the slave device, and the CC1 pin in the USB interface of the slave device is connected to Rd2 resistor in the slave device and connected to ground through the Rd2 resistor. At this time, the ground wire→Rd1 resistor→CC1 pin→Rd2 resistor→ground wire cannot form a current path, so the CC1 pin in the USB interface of the electronic device is disconnected from the slave device and no longer connected.
[0127] S4022, the electronic device controls the VBUS pin in the peripheral interface to stop outputting the first voltage.
[0128] As shown in FIG. 9, the processor of the electronic device can also control the VBUS pin in the USB interface to stop outputting the first voltage. For example, the processor can control the reverse charging power module to stop outputting the first voltage to the VBUS pin in the USB interface, so that the VBUS pin stops outputting the first voltage. The VBUS pin outputs low level, and the CC pin is disconnected from the slave device. Through this process, the cable can be simulated to be pulled out, so that the slave device considers that the cable has been pulled out.
[0129] S4023, after waiting for a set time length, the electronic device controls the CC pin in the peripheral interface to be connected to the slave device again.
[0130] After waiting for the set time length, the processor of the electronic device controls the CC pin in the USB interface to be in communication with the slave device again. The set time length is greater than or equal to 50 ms. After the slave device considers that the cable has been pulled out, the processor of the electronic device can control the CC pin in the USB interface to be in communication with the slave device again through the PD physical layer chip in the power charging module. Still taking the CC1 pin in the USB interface of the electronic device as an example, the PD physical layer chip controls the CC1 pin in the USB interface to be connected to the Rpl resistor in the power charging module of the electronic device, and returns to the state shown in FIG. 6, that is, the CC1 pin is in communication with the slave device again. At this time, the CC pin outputs a high level again, and lasts for at least 500 ms, and the processor of the electronic device waits for the PD physical layer chip to report a SRC event.
[0131] In S4024, the electronic device controls the peripheral interface to be in a DCP mode.
[0132] The processor of the electronic device controls the USB interface to be in the DCP mode, and the Dp pin and the Dm pin in the USB interface are short-circuited, which is used for communication of the charging protocol. For example, the processor of the electronic device can control a mode switch in the electronic device to be closed. The mode switch can also be referred to as a DCP mode switch. One end of the mode switch is connected to the Dp pin in the USB, and the other end is connected to the Dm pin in the USB. As shown in FIG. 2, when the Dp pin and the Dm pin in the USB interface are in the SDP mode, the mode switch is open, and the Dp pin and the Dm pin in the USB interface are disconnected. When the mode switch is closed, the Dp pin and the Dm pin in the USB interface are short-circuited, and a channel is formed. At this time, the USB interface is in the DCP mode, so that the slave device considers that the electronic device is a charger or an adapter.
[0133] In S4025, after detecting that the slave device accesses the peripheral interface again, the electronic device controls the VBUS pin in the peripheral interface to output a second voltage, so as to provide power for the slave device with a second power.
[0134] As shown in FIG. 9, after the CC pin in the USB interface of the electronic device re-communicates with the slave device, the PD physical layer chip in the electronic device reports the SRC event again. The processor of the electronic device receives the SRC event reported by the PD physical layer chip again, determines that the slave device accesses the USB interface again, controls the reverse charging power supply module to output a second voltage through the VBUS pin, so that the slave device considers that the cable is re-inserted, the slave device re-identifies, and determines that the Dp pin and the Dm pin in the USB interface of the master device (i.e., the electronic device) are in the DCP mode, and communicates with the electronic device through the fast charging protocol. The fast charging protocol can be a fast charging protocol based on the USB DP / DM bus, including but not limited to the standard charging port (SCP) protocol, the universal fast charging (UFCS) protocol, the voltage open looped multistep constant current charging (VOOC) protocol, the flash charging protocol, etc. The amplitude of the second voltage is greater than the amplitude of the first voltage, for example, the amplitude of the second voltage can also be 10V. The electronic device can negotiate with the slave device through the protocol processing module using the fast charging protocol, and after the negotiation is completed, the electronic device enters the reverse fast charging mode to provide power for the slave device with the second power, and the second power can reach 10V*4A at most, so that the slave device can be quickly charged. Taking the slave device as a mobile phone as an example, the electronic device provided by the embodiment of the present application can provide emergency charging for the mobile phone, and 30 minutes can charge more than 60% of the mobile phone with a battery capacity of 5000mAH. Compared with the power bank with a fast charging speed of 9.5w-18w, the charging speed can be increased by 39%, and compared with the ordinary USB charging with a fast charging speed of 7.5w, the charging speed can be increased by 400%.
[0135] In some embodiments, when the protocol processing module determines that the slave device supports the fast charging mode, the processor of the electronic device can determine whether the remaining power of the power supply of the electronic device reaches a minimum threshold value, if the remaining power reaches the minimum threshold value, the electronic device can be switched to the reverse fast charging mode through the steps shown in FIG. 8, if the remaining power does not reach the minimum threshold value, the electronic device can not be switched to the reverse fast charging mode.
[0136] In some embodiments, as shown in FIG. 11, when the protocol processing module determines that the slave device supports the fast charging mode, the processor of the electronic device can output first prompt information through the user interface, the first prompt information being used to prompt the user that the electronic device supports switching to the reverse fast charging mode; and the user interface can further be provided with a "switch" button and a "return" button that can be selected by the user. If the user clicks the "return" button, the processor of the electronic device receives the operation of the user clicking the "return" button, and can close the first prompt information and return to the original running interface of the electronic device. If the user clicks the "switch" button, the processor of the electronic device receives the mode switching operation input by the user, and can switch to the reverse fast charging mode through the steps shown in FIG. 8 in response to the mode switching operation, and control the reverse charging power supply module to provide power to the slave device at the second power.
[0137] In some embodiments, as shown in FIG. 12, after the electronic device switches to the reverse fast charging mode to provide power to the slave device at the second power, the electronic device can output second prompt information through the user interface, the second prompt information being used to prompt the user that the electronic device is currently in the reverse fast charging mode; and the user interface can further be provided with a "close mode" button. If the user clicks the "close mode" button, the processor of the electronic device receives the exit operation input by the user, and can switch back to the reverse charging mode from the reverse fast charging mode in response to the exit operation, and control the reverse charging power supply module to provide power to the slave device at the first power.
[0138] The process of switching the electronic device back to the reverse charging mode from the reverse fast charging mode can include the following steps, as shown in FIG. 13.
[0139] S1301, the electronic device controls the CC pin in the peripheral interface to be disconnected from the slave device.
[0140] When switching back to the reverse charging mode, the processor of the electronic device can control the CC pin in the USB interface to be disconnected from the slave device. For example, when the Dp pin and the Dm pin of the electronic device are in the DCP mode, the processor can control the CC pin in the USB interface to be connected to the Rd1 resistor in the power charging module through the PD physical layer chip in the power charging module, at this time, the CC pin outputs low level for at least 50 ms, so as to disconnect the CC pin from the slave device.
[0141] S1302, the electronic device controls the VBUS pin in the peripheral interface to stop outputting the second voltage.
[0142] The processor of the electronic device can also control the VBUS pin in the USB interface to stop outputting the second voltage. Illustratively, the processor can control the reverse charging power supply module to stop outputting the second voltage to the VBUS pin in the USB interface, so that the VBUS pin stops outputting the second voltage. The VBUS pin outputs a low level, while the CC pin is disconnected from the slave device, through this process, the cable being pulled out can be simulated to make the slave device think that the cable has been pulled out.
[0143] In S1303, after waiting for a set time length, the electronic device controls the CC pin in the peripheral interface to re-connect with the slave device.
[0144] After waiting for a set time length, the processor of the electronic device controls the CC pin in the USB interface to re-connect with the slave device. The set time length is greater than or equal to 50 ms. After the slave device thinks that the cable has been pulled out, the processor of the electronic device can control the CC pin in the USB interface to re-connect with the slave device through the PD physical layer chip in the power supply charging module. At this time, the CC pin outputs a high level again, at least for 500 ms, and the processor of the electronic device waits for the PD physical layer chip to report a SRC event.
[0145] In S1304, the electronic device controls the peripheral interface to be in an SDP mode.
[0146] The processor of the electronic device controls the USB interface to be in an SDP mode. Illustratively, the processor of the electronic device can control a mode switch in the electronic device to be disconnected. One end of the mode switch is connected with the Dp pin in the USB, and the other end is connected with the Dm pin in the USB. When the mode switch is disconnected, the Dp pin and the Dm pin in the USB interface are disconnected, and at this time, the USB interface is in an SDP mode.
[0147] In S1305, after detecting that the slave device accesses the peripheral interface again, the electronic device controls the VBUS pin in the peripheral interface to output a first voltage to provide power for the slave device at a first power.
[0148] After the CC pin in the USB interface of the electronic device re-connects with the slave device, the PD physical layer chip in the electronic device reports a SRC event again. The processor of the electronic device receives the SRC event reported by the PD physical layer chip again, determines that the slave device accesses the USB interface again, controls the reverse charging power supply module to output the first voltage through the VBUS pin, so that the slave device thinks that the cable is re-inserted, the slave device re-identifies, and determines that the USB interface of the master device (i.e., the electronic device) is in an SDP mode and communicates with the electronic device through a charging protocol. The charging protocol can be, but is not limited to, a PD protocol, etc. The electronic device can communicate with the slave device through the protocol processing module through the charging protocol, and after the communication is completed, the electronic device enters a reverse charging mode to provide power for the slave device at a first power.
[0149] The current portable electronic device only supports fast charging as a powered end, and does not support the fast charging protocol when charging other devices as a power supply end, so it cannot quickly charge other devices. The electronic device provided by the embodiment of the present application increases the reverse charging power module and the protocol processing module, and can quickly charge other devices. Because the reverse charging power module is added, the power supply capacity of the electronic device is greatly improved, the reverse charging efficiency is improved, and the charging speed is very fast. Moreover, the electronic device provided by the embodiment of the present application increases the protocol processing module, which is used to determine whether the slave device supports the fast charging protocol, and communicates with the slave device according to the fast charging protocol when the slave device supports the fast charging protocol. The electronic device can support the PD fast charging protocol, the SCP protocol, the UFCS protocol and other fast charging protocols based on the Dp / Dm channel, and has more extensive compatibility.
[0150] The electronic device provided by the embodiment of the present application can identify the slave device inserted into the USB interface in the SDP mode of the USB interface. If the slave device is a USB interface device such as a U disk or a display that does not support the fast charging mode, the electronic device can maintain the reverse charging mode and perform data transmission with the USB interface device. If the slave device supports the fast charging mode, the electronic device can switch from the reverse charging mode to the reverse fast charging mode and quickly charge the slave device. Therefore, even if the electronic device has only one USB interface, it can be compatible with various USB peripherals and identify the connected device. While not affecting the data transmission between the U disk or the display and the electronic device, the electronic device can quickly charge the slave device such as a mobile phone that supports the fast charging mode.
[0151] The following is one specific embodiment of the reverse charging method provided by the present application. As shown in FIG. 14, the embodiment can include the following steps:
[0152] S1401, when detecting that a device is inserted into the peripheral interface, the electronic device performs charging protocol negotiation with the device inserted into the peripheral interface through the protocol processing module.
[0153] S1402, when the electronic device confirms that the device inserted into the peripheral interface is a slave device, the electronic device controls the peripheral interface to be in the SDP mode, and the CC pin in the peripheral interface is in communication with the slave device.
[0154] S1403, the electronic device enters the reverse charging mode, and controls the reverse charging power module to output a first voltage through the VBUS pin in the peripheral interface to provide power for the slave device at a first power.
[0155] S1404, the electronic device receives the device descriptor sent by the slave device through the Dp pin and the Dm pin in the peripheral interface, and obtains the manufacturer information and the product model information in the device descriptor.
[0156] In S1405, the electronic device determines, by the protocol processing module, whether the manufacturer information in the device descriptor is information of a specified manufacturer; if yes, S1406 is performed; if no, S1409 is performed.
[0157] In S1406, the electronic device performs voltage detection on the Dp pin or the Dm pin in the peripheral interface by the protocol processing module, and determines whether a set pulse is detected; if yes, S1408 is performed; if no, S1407 is performed.
[0158] In S1407, the electronic device determines, by the protocol processing module, whether the product model information in the device descriptor belongs to a set product model range; if yes, S1408 is performed; if no, S1409 is performed.
[0159] In S1408, the electronic device switches from the reverse charging mode to the reverse fast charging mode, and provides power for the slave device by the reverse charging power module at a second power.
[0160] In S1409, the electronic device maintains in the reverse charging mode.
[0161] The specific process in which the electronic device switches from the reverse charging mode to the reverse fast charging mode can be performed by referring to the steps shown in FIG. 8, which will not be described herein again.
[0162] The execution order between the steps in the above embodiments can be interchanged, for example, S1407 can be performed before S1406, or before S1404, and the execution order between the steps is not limited in the embodiments of the present application.
[0163] Based on the above embodiments, the embodiments of the present application further provide a charging system, which can include at least two electronic devices, one of which is a master device and the other is a slave device, and the master device can fast charge the slave device. The master device can include a processor, a peripheral interface, and a reverse charging power module, and the slave device can include a power charging module and a power supply. The peripheral interface of the master device is connected to the power charging module of the slave device, and the power charging module of the slave device is connected to the power supply of the slave device. The reverse charging power module of the master device is connected to the peripheral interface; the processor of the master device is connected to the reverse charging power module, and is configured to control the reverse charging power module to charge the power supply of the slave device at a first power when detecting that the peripheral interface is connected to the slave device, and control the reverse charging power module to charge the power supply of the slave device at a second power when the slave device supports a fast charging mode; the second power is greater than the first power. The structure of the charging system can be as shown in FIG. 1 or FIG. 5, which will not be described herein again.
[0164] The embodiments of the present application also provide a computer program product comprising computer executable instructions. In one embodiment, the computer executable instructions are used to make a computer execute the functions in the above method embodiments.
[0165] The computer executable instructions can be stored in a computer readable storage medium. The embodiments of the present application also provide a computer readable storage medium, which stores executable instructions. In one embodiment, the computer executable instructions are used to make a computer execute the functions in the above method embodiments.
[0166] The computer readable storage medium provided by the embodiments of the present application can be a random access memory (RAM), a flash memory, a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically ePROM (EEPROM), a register, a hard disk, a mobile hard disk, a CD-ROM, or any other forms of the computer readable storage medium well known in the art.
[0167] The computer executable instructions can be stored in a computer readable storage medium, or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer program or instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through wired or wireless manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center and the like integrated with one or more available media. The available media can be a magnetic medium, for example, a floppy disk, a hard disk, a magnetic tape; or an optical medium, for example, a digital video disc (DVD); or a semiconductor medium, for example, a solid state disk.
[0168] In the embodiments of the present application, the terms and / or descriptions between different embodiments are consistent and can be referred to each other if there is no special description and logical conflict, and the technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationship. In addition, the terms "include" and "have" and any variants thereof are intended to cover the non-exclusive inclusion, for example, including a series of steps or units. The method, system, product or device is not necessarily limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0169] Although the application has been described in conjunction with specific embodiments thereof, it is evident that many alternatives, modifications and variations will be apparent to those skilled in the art. Accordingly, it is intended to embrace all such alternatives, modifications and variations as can be included within the spirit and scope of the present application. It will be appreciated that those skilled in the art will be able to devise numerous ways in which the above described application can be implemented without departing from the scope of the application. Accordingly, the above described embodiments of the application are intended to be illustrative, but not limiting, of the scope of the application, which is to be given the full breadth of the appended claims, and any and all equivalents thereof.
[0170] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. An electronic device, comprising: The electronic device comprises a processor, a peripheral interface and a reverse charging power supply module; The peripheral interface is configured to connect a slave device; The processor is configured to control the reverse charging power supply module to provide power for the slave device at a first power when detecting that the peripheral interface connects the slave device; When the slave device supports a fast charging mode, the processor controls the reverse charging power supply module to provide power for the slave device at a second power; The second power is greater than the first power.
2. The electronic device of claim 1, wherein, The electronic device further comprises a protocol processing module; The protocol processing module is configured to determine that the slave device supports the fast charging mode.
3. The electronic device of claim 2, wherein, The protocol processing module and the processor are arranged in the same chip.
4. The electronic device of claim 2 or 3, wherein, The protocol processing module is configured to determine that the slave device supports the fast charging mode by at least one of the following manners: Obtaining a device descriptor of the slave device, and determining that the slave device supports the fast charging mode based on the device descriptor; or Performing voltage detection on a Dp pin or a Dm pin in the peripheral interface, and determining that the slave device supports the fast charging mode when detecting a set pulse.
5. The electronic device according to any one of claims 1 to 4, wherein The peripheral interface comprises a CC pin and a VBUS pin; The processor controls the peripheral interface to be in a standard downstream port (SDP) mode when detecting that the peripheral interface connects the slave device, the CC pin is in communication with the slave device, and controls the reverse charging power supply module to output a first voltage through the VBUS pin to provide power for the slave device at the first power.
6. The electronic device of claim 5, wherein, The processor is further configured to control the CC pin to be disconnected from the slave device and control the VBUS pin to stop outputting the first voltage when the protocol processing module determines that the slave device supports the fast charging mode; After waiting for a set time length, the processor controls the CC pin to be reconnected to the slave device, the peripheral interface is in a dedicated charging port (DCP) mode, and controls the reverse charging power supply module to output a second voltage through the VBUS pin to provide power for the slave device at the second power when detecting that the slave device is connected to the peripheral interface again.
7. The electronic device of claim 6, wherein, The processor is specifically configured to control the CC pin to be disconnected from the slave device by connecting a pull-down resistor Rd to the CC pin, and control the CC pin to be reconnected to the slave device by connecting a pull-up resistor Rp to the CC pin.
8. The electronic device of claim 6 or 7, wherein, The processor is further configured to negotiate with the slave device by using a fast charging protocol between the protocol processing module and the slave device before providing power for the slave device at the second power.
9. The electronic device according to any one of claims 1 to 8, wherein The processor is further configured to output first prompt information when the protocol processing module determines that the slave device supports the fast charging mode; the first prompt information is used to prompt a user that the electronic device supports switching to a reverse fast charging mode; and the processor controls the reverse charging power supply module to provide power for the slave device at the second power in response to a received mode switching operation.
10. The electronic device according to any one of claims 1 to 9, wherein The processor is further configured to, after controlling the reverse charging power supply module to provide power for the slave device at the second power, In response to a received exit operation, control the reverse charging power supply module to provide power for the slave device at the first power.
11. The electronic device of claim 10, wherein, The processor is specifically configured to, in response to the received exit operation, control the CC pin to be disconnected from the slave device, and control the VBUS pin to stop outputting the second voltage. After waiting for a set time length, the processor controls the CC pin to be reconnected to the slave device, and the peripheral interface is in an SDP mode; after detecting that the slave device accesses the peripheral interface again, the processor controls the reverse charging power supply module to output the first voltage through the VBUS pin to provide power for the slave device at the first power.
12. A reverse charging method, characterized by, The method is applied to an electronic device including a peripheral interface, and the method comprises: When detecting that the peripheral interface is connected to a slave device, providing power for the slave device at a first power; When the slave device supports a fast charging mode, providing power for the slave device at a second power; the second power is greater than the first power.
13. The method of claim 12, wherein, The method comprises at least one of the following manners: Obtaining a device descriptor of the slave device, and determining that the slave device supports the fast charging mode based on the device descriptor; or Performing voltage detection on a Dp pin or a Dm pin in the peripheral interface, and determining that the slave device supports the fast charging mode when a set pulse is detected.
14. The method according to claim 12 or 13, characterized in that, The method of providing power for the slave device at the first power comprises: Controlling the peripheral interface to be in a standard downstream port (SDP) mode, and controlling a CC pin in the peripheral interface to be connected to the slave device; Controlling a VBUS pin in the peripheral interface to output the first voltage to provide power for the slave device at the first power.
15. The method of claim 14, wherein, The method of providing power for the slave device at the second power when it is determined that the slave device supports the fast charging mode comprises: Controlling the CC pin in the peripheral interface to be disconnected from the slave device, and controlling the VBUS pin in the peripheral interface to stop outputting the first voltage; After waiting for a set time length, controlling the CC pin in the peripheral interface to be reconnected to the slave device, and controlling the peripheral interface to be in a dedicated charging port (DCP) mode; After detecting that the slave device accesses the peripheral interface again, controlling the VBUS pin in the peripheral interface to output a second voltage to provide power for the slave device at the second power.
16. The method of claim 15, wherein, Before the method of providing power for the slave device at the second power, the method further comprises: negotiating with the slave device by using a fast charging protocol.
17. The method according to any one of claims 12 to 16, characterized in that, After the method of providing power for the slave device at the second power, the method further comprises: In response to a received exit operation, providing power for the slave device at the first power.
18. The method of claim 17, wherein, The method of providing power for the slave device at the first power in response to the received exit operation comprises: In response to the received exit operation, controlling the CC pin to be disconnected from the slave device, and controlling the VBUS pin to stop outputting the second voltage; After waiting for a set time length, the processor controls the CC pin to be reconnected to the slave device, and the peripheral interface is in an SDP mode; after detecting that the slave device accesses the peripheral interface again, the processor controls the reverse charging power supply module to output the first voltage through the VBUS pin to provide power for the slave device at the first power.
19. A charging system, characterized by The electronic device comprises an electronic device and a slave device; the slave device is connected with the electronic device through a peripheral interface of the electronic device, and the electronic device charges the slave device; wherein the electronic device is the electronic device of any one of claims 1-11.
20. An electronic device, comprising: The electronic device comprises a processor, a peripheral interface, and a reverse charging power supply module; The peripheral interface is connected with the reverse charging power supply module; The processor is connected with the reverse charging power supply module, and is configured to control the reverse charging power supply module to provide power for the slave device at a first power when detecting that the peripheral interface is connected with the slave device; And when the slave device supports a fast charging mode, the processor controls the reverse charging power supply module to provide power for the slave device at a second power; The second power is greater than the first power.
21. The electronic device of claim 20, wherein, The peripheral interface comprises a VBUS pin; The reverse charging power supply module is connected with the slave device through the VBUS pin, and outputs a first voltage through the VBUS pin to provide power for the slave device at a first power, or outputs a second voltage through the VBUS pin to provide power for the slave device at a second power.
22. The electronic device of claim 20 or 21, wherein, The peripheral interface comprises a Dp pin or a Dm pin; the electronic device further comprises a protocol processing module connected with the peripheral interface; The protocol processing module acquires a device descriptor of the slave device through the peripheral interface, and determines that the slave device supports a fast charging mode based on the device descriptor; And / or, The protocol processing module performs voltage detection on the Dp pin or the Dm pin to determine that the slave device supports a fast charging mode.
23. The electronic device of claim 22, wherein, The electronic device further comprises a mode switch; a first end of the mode switch is connected with the Dp pin, and a second end of the mode switch is connected with the Dm pin; When the mode switch is disconnected, the Dp pin is disconnected with the Dm pin, and the peripheral interface is in a standard downstream port (SDP) mode; when the mode switch is connected, the Dp pin is short-circuited with the Dm pin, and the peripheral interface is in a dedicated charging port (DCP) mode.
24. The electronic device of claim 22 or 23, wherein, The protocol processing module and the processor are arranged in the same chip.
25. The electronic device of any of claims 20-24, wherein, The peripheral interface comprises a CC pin; the electronic device further comprises a power charging module comprising a pull-up resistor Rp and a pull-down resistor Rd; When the CC pin is connected with the pull-down resistor Rd, the CC pin is disconnected with the slave device; when the CC pin is connected with the pull-up resistor Rp, the CC pin is connected with the slave device.
26. A charging system characterized by comprising: The electronic device comprises an electronic device and a slave device; the electronic device comprises a processor, a peripheral interface, and a reverse charging power supply module; the slave device comprises a power charging module and a power supply; The peripheral interface of the electronic device is connected with the power charging module of the slave device; the power charging module of the slave device is connected with the power supply of the slave device; The reverse charging power supply module of the electronic device is connected with the peripheral interface; The processor of the electronic device is connected with the reverse charging power module, and is configured to control the reverse charging power module to charge the power supply of the slave device with a first power when detecting that the peripheral interface is connected with the slave device; and when the slave device supports a fast charging mode, the processor controls the reverse charging power module to charge the power supply of the slave device with a second power; the second power is greater than the first power.
27. The charging system of claim 26, wherein, The peripheral interface comprises a CC pin; the electronic device further comprises a pull-up resistor Rp1; the slave device further comprises a pull-down resistor Rp2; The CC pin is configured to be connected with the pull-down resistor Rp2 in the slave device; when the CC pin is connected with the pull-up resistor Rp1, a current path is formed among the pull-up resistor Rp1, the CC pin and the pull-down resistor Rp2.
28. A computer-readable storage medium, characterized in that, Computer executable instructions are stored, and the computer executable instructions are used to make a computer execute the method in any one of claims 12-18.
Citation Information
Patent Citations
Double-Type-C interface fast charging device and method for mobile electronic equipment
CN116846006A
Charging method and electronic equipment
CN117134009A
Charging method, electronic equipment and related device
CN117254568A