Charging method, electronic device, and related apparatus

Connecting with external devices through the USB interface, sending supported charging power information and outputting different charging powers according to the request, solving the problem of limited charging current of existing PC products and achieving a more efficient and flexible charging method.

WO2025102798A1PCT designated stage expired Publication Date: 2025-05-22HONOR DEVICE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/106253
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-17
Filing Date
2024-07-18
Publication Date
2025-05-22

AI Technical Summary

Technical Problem

The charging current provided by existing PC products to terminal devices through the USB Type-C interface is limited, making it difficult to meet the needs of higher charging power.

Method used

Establish a connection with external devices through the USB interface, send supported charging power information, receive charging power requests from the device, and output different charging powers according to the request, including the default 5V/2A and higher 9V/2A, etc.

Benefits of technology

It realizes the provision of multiple charging gears to external devices, meets different charging needs, and improves charging efficiency and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024106253_22052025_PF_FP_ABST
    Figure CN2024106253_22052025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a charging method, an electronic device, and a related apparatus. The electronic device comprises one or more universal serial bus (USB) interfaces. The electronic device is connected to a first external device via a first USB interface among the one or more USB interfaces. The method may comprise: an electronic device and a first external device determine a charging power of a first specification on the basis of a first message; the electronic device outputs the charging power of the first specification to the first external device; and when the first external device can support a higher charging power, on the basis of a protocol interaction result of the electronic device and the first external device, the electronic device outputs a charging power of a second specification to the first external device, wherein the charging power of the second specification comprises a charging power of the highest charging level which can be received by the first external device. According to the present application, different charging powers can be provided to external devices.
Need to check novelty before this filing date? Find Prior Art

Description

Charging method, electronic device and related device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on November 17, 2023, with application number 202311532706.8 and application name “Charging method, electronic device and related device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of electronic technology, and in particular to a charging method, an electronic device, and related devices. Background Art

[0003] Currently, an increasing number of devices support the Universal Serial Bus (USB) Type-C interface, combining charging and data transmission on a single USB Type-C port. For example, personal computers (PCs) such as desktops, all-in-one computers, and notebooks can function as power sources, using the USB Type-C port to provide charging current to devices.

[0004] The USB Type-C port on PCs supports the USB Power Delivery (PD) protocol and can provide charging power up to 5V / 3A to connected devices. Further research is needed to increase the charging current that PCs can provide.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a charging method, an electronic device, and related devices, which can establish a connection with an external device through a USB interface, thereby providing different charging powers to the external device.

[0007] In a first aspect, the present application provides a charging method, which is applied to an electronic device, the electronic device including one or more USB interfaces, the electronic device being connected to a first external device via a first USB interface among the one or more Universal Serial Bus (USB) interfaces, the method comprising:

[0008] sending a first message to the first external device through the first USB interface, wherein the first message includes a charging power supported by the electronic device to output to the first external device;

[0009] receiving a request for a first specification of charging power from the electronic device, wherein the first specification of charging power belongs to the charging power supported by the electronic device to output to the first external device;

[0010] outputting the first specification of charging power to the first external device through the first USB interface;

[0011] receiving a request for a second-specification charging power from the electronic device, wherein the second-specification charging power includes the highest charging power level that the first external device can receive, the second-specification charging power belongs to the charging power supported by the electronic device to output to the first external device, and the second-specification charging power is greater than the first-specification charging power;

[0012] The charging power of the second specification is output to the first external device through the first USB interface.

[0013] In one implementation, the USB interface includes a USB Type-C interface.

[0014] Through the embodiment of the present application, after the first external device establishes a connection with the electronic device through the USB interface, the electronic device can first broadcast the charging power supported by the output to the first external device. After receiving the response from the first external device, the electronic device first outputs the charging power of the first specification to the first external device (the default charging power, for example 5V / 2A). In the case where the first external device supports a higher charging power, the first external device can send a higher charging power request to the electronic device. The electronic device responds to its request and provides the highest charging power that can be received by the first external device. It can be understood that because the electronic device can provide charging power of multiple specifications, it can provide charging power of different specifications to the external device at the request of the first external device to meet different charging needs.

[0015] In one possible implementation of the first aspect, the electronic device further includes a switching circuit and a processor, the switching circuit corresponding to the one or more USB ports, the switching circuit connecting the processor and a short-circuited 0-ohm resistor. The processor is configured to satisfy requirements of some external devices, such as requiring a higher charging power only when the electronic device is a DCP port, or to comply with charging protocols specified in certain proprietary protocols.

[0016] It can be seen that the USB interface can be switched to be connected to the processor or short-circuited with a 0-ohm resistor through the switch switching circuit. When connected to the processor through the switch switching circuit, the electronic device can be considered as an SDP end. When short-circuited with a 0-ohm resistor through the switch switching circuit, the electronic device can be considered as a DCP end.

[0017] In a possible implementation of the first aspect, outputting the second-specification charging power to the first external device through the first USB interface includes:

[0018] When it is determined that the system of the electronic device is not in a working state and / or the battery power of the electronic device is greater than or equal to a preset threshold, the charging power of the second specification is output to the first external device through the first USB interface.

[0019] It can be seen that this application outputs charging power to the outside while ensuring its own charging needs, without affecting the power demand of the electronic device itself.

[0020] In a possible implementation of the first aspect, the electronic device is connected to a second external device through a second USB interface among the one or more USB interfaces, and the outputting the second-specification charging power to the first external device through the first USB interface includes:

[0021] When it is determined that the second external device located at the second USB interface is not charging the electronic device, the charging power of the second specification is output to the first external device through the first USB interface.

[0022] As can be seen, if a device is also connected to another USB port, it is necessary to determine whether the device is charging the electronic device. If the other device is not charging the electronic device, a higher charging power is output to the first external device. If the other device is charging the electronic device, the normal charging power is restored. This can avoid unstable performance of the electronic device due to outputting a high charging power when charging the electronic device.

[0023] In a possible implementation of the first aspect, the switching circuit is configured to connect the first USB interface and the processor, and after outputting the first specification of charging power to the first external device through the first USB interface and before receiving a request for a second specification of charging power from the electronic device, further comprising:

[0024] receiving a fast charge request from the first external device;

[0025] In response to the fast charge request, controlling the switch circuit to switch from connecting to the processor to connecting to the 0 ohm resistor;

[0026] The first USB interface performs protocol interaction with the first external device to determine that the electronic device is a dedicated charging port DCP end.

[0027] It can be seen that when the switch circuit is switched to connecting the first USB interface and the processor, the electronic device is identified as the SDP end. If the first external device needs to be fast charged, it can be switched to connecting the first USB interface and the 0 ohm resistor through the switch circuit. In this way, the electronic device is identified as the DCP end and can output a higher charging power to the first external device.

[0028] In a possible implementation of the first aspect, the electronic device is connected to a second external device through a second USB interface among the one or more USB interfaces, and the receiving a fast charge request from the first external device includes:

[0029] When it is determined that the second external device located at the second USB interface is not charging the electronic device, a fast charging request from the first external device is received.

[0030] As can be seen, when other USB ports are also connected to devices, it is necessary to determine whether the device is charging the electronic device. If other devices are not charging the electronic device, the first external device receives a fast charge request, and if other devices are charging the electronic device, the normal charging power is restored. This can avoid the performance instability of the electronic device caused by outputting high charging power when charging the electronic device.

[0031] In a possible implementation manner of the first aspect, when the switch switching circuit is connected to the first USB interface and the 0-ohm resistor, the electronic device is a DCP terminal.

[0032] It can be seen that after the electronic device is identified as a DCP end, it can support some gears of the PD protocol and PPS, so that it can output different and higher charging power.

[0033] In a possible implementation of the first aspect, the electronic device is connected to a second external device through a second USB interface among the one or more USB interfaces, and the outputting the second-specification charging power to the first external device through the first USB interface includes:

[0034] When it is determined that the second external device located at the second USB interface is not charging the electronic device, the charging power of the second specification is output to the first external device through the first USB interface.

[0035] As can be seen, when an electronic device is identified as a DCP port, if other devices are also connected to other USB ports, it is necessary to determine whether the device is charging the electronic device. If other devices are not charging the electronic device, a higher charging power is output to the first external device. If other devices are charging the electronic device, the normal charging power is restored. This can avoid unstable performance of the electronic device due to outputting higher charging power when charging the electronic device.

[0036] In a possible implementation manner of the first aspect, after outputting the second-specification charging power to the first external device through the first USB interface, the method further includes:

[0037] receiving a request for a charging power of a third specification from the electronic device;

[0038] The voltage and current are adjusted according to the request for the charging power of the third specification, and the voltage and current corresponding to the request for the charging power of the third specification are output.

[0039] It can be seen that the electronic device can adjust the voltage and current in real time according to the requirements of the first external device, thereby outputting the charging power that matches the requirements to adapt to different application environments.

[0040] In a possible implementation of the first aspect, the electronic device includes one or more of a power transmission module, a control unit, and a power supply module, and outputting the second-specification charging power to the first external device through the first USB interface includes:

[0041] Turning on the OTG function of the power module by the control unit;

[0042] Turning on a second switch of the power module through the power transmission module, wherein the second switch is used to connect the first USB interface and the charger chip in the power module, and the charger chip in the power module is used to provide the second specification of charging power;

[0043] Based on the OTG function and the second switch being in the on state, the charging power of the second specification is output to the first external device through the first USB interface.

[0044] It can be seen that the electronic device outputs higher charging power through the control unit, power transmission module and power supply module.

[0045] In a second aspect, the present application provides an electronic device, comprising one or more of one or more USB interfaces, a power transmission module, a control unit, and a power supply module, wherein the electronic device is connected to a first external device through a first USB interface of the one or more universal serial bus USB interfaces,

[0046] The power transmission module is configured to send a first message to the first external device through the first USB interface, wherein the first message includes the charging power supported by the electronic device to output to the first external device;

[0047] The power transmission module is configured to receive a request for a first specification of charging power from the first external device through the first USB interface, wherein the first specification of charging power belongs to the charging power supported by the electronic device to output to the first external device;

[0048] The control unit is configured to control the power module to output a charging power of a first specification;

[0049] The power transmission module is configured to output the charging power of the first specification to the first external device through the first USB interface;

[0050] The power transmission module is further configured to receive a request for a second-specification charging power from the first external device through the first USB interface, wherein the second-specification charging power includes the highest charging power level that the first external device can receive, the second-specification charging power belongs to the charging power supported by the electronic device to output to the first external device, and the second-specification charging power is greater than the first-specification charging power;

[0051] The control unit is used to control the power module to output a charging power of a second specification;

[0052] The power transmission module is used to output the second-specification charging power to the first external device through the first USB interface.

[0053] In a possible implementation of the second aspect, the electronic device further includes a switch switching circuit and a processor, the switch switching circuit corresponds to the one or more USB interfaces, and the switch switching circuit connects the processor and a short-circuited 0 ohm resistor.

[0054] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more USB interfaces; one or more processors; and a memory; wherein the USB interface is used to establish a connection with a device having the USB interface, the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the charging method described in the first aspect or any possible implementation of the first aspect.

[0055] In a fourth aspect, the present application provides a chip or chip system, comprising at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected via a circuit, and the at least one processor is configured to execute a computer program or instruction to perform the charging method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip may be an input / output interface, a pin, or a circuit.

[0056] In one possible implementation, the chip or chip system described above in the embodiments of the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit within the chip, such as a register, a cache, etc., or a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).

[0057] In a fifth aspect, an embodiment of the present application provides a computer storage medium, which stores a computer program. When the computer program is executed by a processor, the computer executes the charging method described in the first aspect or any possible implementation of the first aspect.

[0058] In a sixth aspect, an embodiment of the present application provides a computer program product, which, when running on a communication device, enables the communication device to execute the charging method described in the first aspect or any possible implementation of the first aspect.

[0059] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution or beneficial effect is included in at least one embodiment. Therefore, the description of a technical feature, technical solution or beneficial effect in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be implemented without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in specific embodiments that do not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The following is an introduction to the drawings used in the embodiments of this application.

[0061] FIG1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0062] FIG2 is a schematic diagram of the architecture of an electronic device provided in an embodiment of the present application;

[0063] FIG3 is a schematic diagram of a charging scenario of a single Type-C interface based on a first charging circuit provided by an embodiment of the present application;

[0064] FIG4 is a schematic diagram showing a flow chart of a charging scenario using a single Type-C interface based on a first charging circuit;

[0065] FIG5 is a schematic diagram of a charging scenario of a dual Type-C interface based on a first charging circuit provided in an embodiment of the present application;

[0066] FIG6 is a schematic diagram showing a flow chart of a charging scenario using dual Type-C interfaces based on a first charging circuit;

[0067] FIG7 is a schematic diagram of the architecture of another electronic device provided in an embodiment of the present application;

[0068] FIG8 is a schematic diagram of a charging scenario of a single Type-C interface based on a second charging circuit provided in an embodiment of the present application;

[0069] FIG9 is a schematic diagram showing a flow chart of a charging scenario using a single Type-C interface based on a second charging circuit;

[0070] FIG10 is a schematic diagram showing a flow chart of another charging scenario using a single Type-C interface and a second charging circuit;

[0071] FIG11 is a schematic diagram of a charging scenario of a dual Type-C interface based on a second charging circuit provided in an embodiment of the present application;

[0072] Figures 12A-12C are schematic flow diagrams showing a charging scenario using dual Type-C interfaces based on a second charging circuit;

[0073] Figures 13A-13C are schematic flow charts showing another charging scenario using dual Type-C interfaces based on a second charging circuit;

[0074] FIG14 is a flow chart of a charging method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0075] The terms used in the following examples of the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in the specification and appended claims of the present application, the singular expressions "a," "an," "said," "above," "the," and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and encompasses any or all possible combinations of one or more of the listed items.

[0076] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0077] In order to better understand the embodiments of the present application, the terms or concepts that may be involved in the embodiments are explained below.

[0078] 1. Power Delivery (PD) is a communication protocol used to transfer power between a power adapter and a charger. The PD protocol enables intelligent power transfer management by enabling communication between the power adapter and charger. It automatically adjusts voltage and current based on device requirements to provide the optimal charging capability. The PD protocol also supports bidirectional communication, allowing devices to send requests to the power adapter, such as adjusting power and obtaining device information.

[0079] 2. USB Type-C is a Type C USB interface defined by the USB Association. It supports symmetrical plugging and unplugging, and can use any USB transmission protocol such as USB2.0, USB3.0 or USB3.1. It supports USB standard charging, data transmission, audio transmission, display output and other functions.

[0080] The USB Type-C standard differs from previous standards by introducing dual-role capability. Both ends of each USB Type-C cable are fully equivalent, meaning the two connected devices must communicate with each other to determine whether they are acting as a host or a peripheral. Role communication is performed separately for data and power. For data, the host port used for data communication is called a downstream facing port (DFP), and the peripheral port is called an upstream facing port (UFP). For power, the power supply is called a source, and the power consumption is called a sink. Some devices can have dual-role capabilities for both data and power.

[0081] USB Type-C cables support a maximum charging voltage / current / power of 5V / 3A (15W). Using the PD protocol, this can be increased to 20V / 5A (100W). The USB PD 3.0 protocol supports programmable power supply (PPS), allowing for precise control of voltage and current.

[0082] 3. Charging standard BC1.2, based on the USB 2.0 D+ / D- line communication mode, defines three types of ports: standard downstream port (SDP), dedicated charging port (DCP), and charging downstream port (CDP).

[0083] 4. System sleep state (S-State), including but not limited to six levels S0-S5, among which:

[0084] S0 corresponds to the power-on state;

[0085] S1-S2 correspond to sleep states, where S1 corresponds to a state where the processor stops working but is still powered on, and S2 corresponds to a state where the processor is turned off and the power is disconnected, but surrounding devices such as Bluetooth remain running;

[0086] S3 corresponds to the standby state under sleep, that is, all devices including the processor are powered off, but the memory remains running;

[0087] S4 corresponds to the dormant state;

[0088] S5 corresponds to the shutdown state.

[0089] Generally speaking, PC products with USB Type-C interfaces can charge mobile phones, tablets, and other terminal devices. After a successful handshake between the PC product and the terminal device based on a charging protocol (such as the PD protocol), the PC product can provide a maximum charging voltage / current / power of up to 5V / 3A (i.e., 15W), but the charging current is generally limited to 2A according to specifications. At the same time, the terminal device will recognize the PC product's port as an SDP by default using the BC2.1 protocol, and communicate with the PC product based on the USB2.0 protocol. It is understandable that PC products based on PD3.0 or PD2.0 can provide greater charging power to terminal devices, but current terminal devices must recognize the source port as a DCP before they support some charging modes of the PD protocol, including PPS. Since current terminal devices recognize the PC product's port as an SDP by default after establishing a connection with the PC product, the charging modes that the PC product can provide to the terminal device are limited.

[0090] Based on this, the present application provides a charging method, an electronic device and related devices, wherein the electronic device includes one or more USB interfaces, and the electronic device is connected to a first external device through a first USB interface among the one or more USB interfaces. The electronic device broadcasts the supported external charging power to the first external device through the first USB interface. The first external device will first request a charging power of 5V / 2A. The electronic device responds to its request and outputs a charging power of 5V / 2A to the first external device. Afterwards, if the first external device supports a higher charging power (for example, 9V / 2A), a higher charging power (for example, 9V / 2A) is requested from the electronic device. The electronic device responds to its request and outputs a charging power of, for example, 9V / 2A to the first external device. It can be seen that the electronic device can provide different charging gears to the first external device.

[0091] In one possible embodiment, the electronic device further includes a switch circuit and a processor, the switch circuit corresponding to one or more USB interfaces, and the switch circuit connecting the processor and a short-circuited 0-ohm resistor. When the electronic device fast charges a first external device, the switch circuit can be controlled to switch to connecting a 0-ohm resistor. The electronic device interacts with the first external device through the first USB interface, and the electronic device can be determined to be a dedicated charging port (DCP). When the electronic device is identified as a DCP, it can support some charging gears of the PD protocol and PPS.

[0092] First, an embodiment of the present application provides an electronic device that can be used as a power source to charge a device to be charged. The electronic device / device to be charged provided in the embodiment of the present application may be, but is not limited to, a notebook computer (Notebook or Laptop), a tablet computer, a mobile phone, a desktop computer, an all-in-one computer, a personal digital assistant (PDA), and may also be an in-vehicle computer, a smart wearable device, a smart home device, augmented reality (AR) / virtual reality (VR), etc. The embodiment of the present application does not limit the specific types of the above-mentioned electronic devices and devices to be charged.

[0093] First, the structure of the electronic device is introduced. FIG1 is a schematic diagram of the structure of the electronic device provided in an embodiment of the present application.

[0094] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0095] It is understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange the components differently. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware. For example, for a desktop device or an all-in-one device, the SIM card interface, antenna group 1, and mobile communication module may not be included; for a laptop computer, the antenna group 1 and mobile communication module may not be included.

[0096] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0097] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0098] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0099] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0100] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.

[0101] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.

[0102] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0103] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.

[0104] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0105] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0106] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.

[0107] It may also include other interfaces for interacting with other devices, such as a Dock interface or a Lighting interface.

[0108] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0109] The charging management module 140 is used to receive charging input from a charger or provide power to an external device. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142, it can also power the electronic device through the power management module 141. For electronic devices that use a Type-C interface, its charging management module 140 can support the USB power transmission (PD) charging protocol.

[0110] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0111] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0112] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0113] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0114] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0115] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0116] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0117] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.

[0118] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage cell potential level; universal flash storage (UFS) and embedded multi media card (eMMC) can be divided into UFS and eMMC according to the storage specification.

[0119] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.

[0120] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0121] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, files such as music and videos can be stored in the external non-volatile memory.

[0122] The following takes the PD charging protocol and two Type-C interfaces as examples to introduce the charging method and electronic device provided by this application. It should be noted that the charging method provided by this application is also suitable for devices with two or more Type-C interfaces, as well as type protocols of the PD charging protocol, such as a charging protocol that communicates with CC signals, or a charging protocol that communicates with the pins on the Type-C interface at positions corresponding to CC signals, or a charging protocol that communicates with non-D+ / D- signals defined by the Type-C interface.

[0123] First, the structure of the electronic device 100 is described using an electronic device such as a PC product. Referring to FIG2 , FIG2 is a schematic diagram of the architecture of an electronic device provided in an embodiment of the present application. The electronic device 100 can be used to implement the charging method provided in an embodiment of the present application.

[0124] As shown in Figure 2, the electronic device 100 includes a first charging circuit 101 and a processor 205. The first charging circuit 101 includes one or more of a first Type-C interface 2011, a second Type-C interface 2012, a power transmission module 202, a power supply module 203, and a control unit 204.

[0125] The first Type-C interface 2011 and / or the second Type-C interface 2012 are used to connect external devices. When the electronic device 100 provides power to the external device through the first Type-C interface 2011 and / or the second Type-C interface 2012, the electronic device is the charging end (represented by Source) and the external device is the power-consuming device end (represented by Sink). As can be seen from Figure 2, the first Type-C interface 2011 and / or the second Type-C interface 2012 include one or more of the VBUS pin for power supply, the CC pin (including the CC1 pin and the CC2 pin), the DP (also known as the D+ or data positive signal) pin, and the DM (also known as the D- or data negative signal) pin. Among them:

[0126] The VBUS pin is the return path for the power supply. The default VBUS voltage is 5V, but the standard allows devices to negotiate and select a VBUS voltage other than the default value, supporting a higher voltage. This application does not impose any restrictions on the supported VBUS voltage values.

[0127] The CC pin is used to complete the configuration channel function defined in the USB Type-C specification and the functions specified in the USB PD specification.

[0128] The DM pin and DP pin are a differential pair used for USB 2.0 connection. The signals transmitted on the DM / DP pins can be used to identify proprietary protocols.

[0129] The power transmission module 202 is, for example, a USB-PD charging protocol integrated circuit (IC). The USB-PD charging protocol IC can be an IC that communicates with the CC channel protocol defined by the Type-C interface, supporting the PD charging protocol or a charging protocol similar to the PD charging protocol. The power transmission module 202 can also include one or more interfaces, such as an I2C interface. The PD chip is electrically connected to the I2C interface of the control unit 204 through the I2C interface and the I2C bus to achieve electrical connection between the power transmission module 202 and the control unit 204 and transmission of signals. The PD chip can, for example, be electrically connected to the CC pins (CC1 / CC2 pins) of the first Type-C interface 2011 and / or the second Type-C interface 2012, and recognize the external device connected to the first Type-C interface 2011 and / or the second Type-C interface 2012 through voltage changes at the CC pins.

[0130] In some embodiments, the power transmission module 202 is provided with one or more first switches and one or more second switches. The first Type-C interface 2011 corresponds to the first switch and the second switch, respectively, and the second Type-C interface 2012 corresponds to the first switch and the second switch, respectively. It is understood that in the case of two or more USB Type-C interfaces, the power transmission module 202 is provided with two or more first switches and two or more second switches, respectively corresponding to different USB Type-C interfaces.

[0131] The power module 203 includes one or more of a charging control chip, a battery, and a buck circuit.

[0132] The buck circuit is used to output a voltage, for example, a fixed 5V voltage to the power transmission module 202, so as to output the 5V voltage to the VBUS pin of the first Type-C interface 2011 and / or the VBUS pin of the second Type-C interface 2012 through a pin electrically connected to the first switch in the power transmission module 202.

[0133] It should be noted that the first switch can be located inside the power transmission module 202 or outside the power transmission module 202, and its on or off is controlled by the power transmission module 202, for example, controlling whether to output a 5V fixed voltage to the VBUS pin of the first Type-C interface 2011 and / or the second Type-C interface 2012. Exemplarily, the first switch can be, for example, a switch chip with an overcurrent protection (OCP) function. Of course, the first switch is not limited to this, and any module that can have the function of turning on or off and the overcurrent protection function is within the protection scope of the embodiments of the present application.

[0134] The charging control (charger) chip is electrically connected to the VBUS pin of the first Type-C interface 2011 and / or the second Type-C interface 2012 through the second switch, and is also connected to the battery and the control unit 204 respectively. When the first Type-C interface 2011 and / or the second Type-C interface 2012 is connected to a charging power source such as an adapter or a power bank, the power module 203 is used to receive the charging input through the second switch. While charging the battery, it can also power other modules that need power during operation, thereby completing the forward charging of the electronic device. In this embodiment, the power module 203 also has a power reverse output function, that is, a function of outputting power to an external device to be charged. Among them, the power reverse output function can be implemented based on the active (On The Go, OTG) function, and the voltage and current of the reverse output of the power module 203 are adjustable.

[0135] Exemplarily, the second switch can be, for example, a switch chip with an overvoltage protection (OVP) function. Of course, the second switch module 70 is not limited thereto. As long as the module can have the function of turning on or off and the overvoltage protection function, it is within the protection scope of the embodiment of the present application. For example, the second switch can be turned on or off by the power transmission module 202, or the control unit 204 can control the second switch to be turned on or off through the GPIO interface. It is understandable that in the case of two or more USB Type-C interfaces, two or more second switches are provided in the power module 203.

[0136] The control unit 204 can be a single-chip microcomputer, such as a microcontroller unit (MCU) or an embedded controller (EC). In one implementation, the control unit 204 can also be integrated into the processor 205. It mainly controls the power-on timing, keyboard, and handles underlying hardware-related tasks, such as temperature detection. It also performs functions such as charging control and PD chip interface implementation. The control unit 204 decompresses the independently running software and stores it in its own non-volatile medium.

[0137] In some embodiments, the control unit 204 may include one or more interfaces. The interfaces may include a general purpose input / output interface (GPIO), an enhanced serial peripheral (eSPI) interface, an integrated circuit I2C interface, etc. The above interfaces are used to achieve electrical connection with other modules in the electronic device 100 and communication between modules. In the embodiment of the present application, the control unit 204 can, for example, be electrically connected and communicated with the power transmission module 202 through different I2C interfaces, and electrically connected and communicated with the power supply module 203 through the GPIO interface.

[0138] It should be understood that the various components shown in FIG. 2 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0139] Next, a schematic diagram of a scenario provided by the present application is introduced. FIG3 is a schematic diagram of a charging scenario of a single Type-C interface based on a first charging circuit provided by an embodiment of the present application.

[0140] In the scenario shown in Figure 3, the electronic device 100 is a laptop computer, which is equipped with two Type-C interfaces, a first Type-C interface 2011 and a second Type-C interface 2012. The electronic device 100 can establish a connection with the first external device 200 (such as a mobile phone) through one of the two Type-C interfaces (such as the first Type-C interface 2011). At the first moment after the connection is established, the electronic device 100 confirms that it is a Source device and the connected first external device 200 is a Sink device. First, the electronic device 100 can provide a power of, for example, 5V / 2A (i.e., 10W) ​​to the first external device 200. At the second moment after the first moment, the first external device 200 confirms that it supports a higher power protocol, such as the PD3.0 protocol, the PD2.0 protocol, etc., and the first external device 200 requests a higher power, such as 9V / 2A (i.e., 18W), from the electronic device 100. After receiving the request from the first external device 200, the electronic device 100 provides a higher charging power (e.g., 18W) to the first external device 200 if the system of the electronic device 100 is not in the S0 state and the power level is not lower than the preset threshold. Therefore, at the second moment, the first external device 200 can be fast charged at a power of, for example, 9V / 2A (i.e., 18W).

[0141] Figure 4 shows a flow chart of a charging scenario using a single Type-C port based on a first charging circuit, including but not limited to the following steps. For ease of description, this application describes the steps in the following order and is not intended to limit execution to the above order. This embodiment of the application does not limit the order, time, or number of executions of the above steps.

[0142] S401 : The first external device 200 establishes a connection with the power transmission module of the electronic device 100 .

[0143] Specifically, when the first external device 200 is connected to the electronic device 100 through the first Type-C interface (which can be simply referred to as the first external device 200 being connected to the Type-C interface), the power transmission module 202 in the electronic device 100 and the first external device 200 handshake through the CC pin of the Type-C interface to confirm that they are the Source device and the connected first external device 200 is the Sink device.

[0144] S402 : The power transmission module sends a first message to the first external device 200 .

[0145] Specifically, the electronic device 100, acting as a source device, sends a first message to the first external device 200, acting as a sink device, via the power transmission module. The first message includes information indicating that the electronic device 100 can provide one or more charging powers of 5V / 2A and 9V / 2A. It is understood that these values ​​can also be replaced with other values, such as values ​​corresponding to the interaction results determined after the electronic device and the first external device perform protocol interaction.

[0146] S403: The first external device 200 requests a charging power of 5V / 2A from the power transmission module.

[0147] S404: The power transmission module turns on the first switch.

[0148] Specifically, as shown in Figure 3, the power transmission module can control the on / off state of the first switch. The first switch is electrically connected to the Buck circuit in the power module, thereby controlling whether the 5V voltage output by the Buck circuit is output to the power transmission module.

[0149] S405: The power module outputs a charging power of 5V / 2A.

[0150] Specifically, the Buck circuit in the voltage module is used to output a 5V voltage. When the first switch is on, the power module outputs the 5V voltage to the VBUS pin of the USB Type-C interface through the pin in the power transmission module electrically connected to the first switch, thereby providing a 5V / 2A charging power to the first external device 200.

[0151] S406 : The first external device 200 requests a charging power of 9V / 2A from the power transmission module.

[0152] Specifically, when the first external device 200 supports a fast charging protocol such as PD3.0 or PD2.0, the first external device 200 requests a charging power of 9V / 2A from the power transmission module.

[0153] S407: The power transmission module sends a first request to the control unit.

[0154] Specifically, after receiving the request from the first external device 200 serving as a Sink device, the power transmission module sends a first request to enable the OTG function to the control unit through the I2C interface.

[0155] S408 , the control unit determines whether the system is in S0 and whether the current power level is lower than a preset threshold.

[0156] Specifically, after receiving the request to enable the OTG function, the control unit needs to ensure its own power supply first, and then provide power to the outside world while ensuring its own power supply. Therefore, the control unit determines whether the current system of the electronic device 100 is in the S0 state and whether the battery power is lower than a preset threshold (for example, 20%).

[0157] Therefore, when it is determined that the current system of the electronic device 100 is in the S0 state and the battery power is lower than the preset threshold, the charging power of 5V / 2A continues to be provided to the external device.

[0158] S409: No, the control unit sends a second message to the power transmission module.

[0159] Specifically, when it is determined that the current system of the electronic device 100 is not in the S0 state and the battery circuit is greater than or equal to the preset threshold, the control unit sends a second message to the power transmission module indicating that the OTG function can be enabled.

[0160] S410: No, the control unit sends a message to the power module to enable the OTG function.

[0161] S411: The power module enables the OTG function.

[0162] S412: The power transmission module turns off the first switch and turns on the second switch.

[0163] Specifically, after receiving the second message, the power transmission module disconnects the first switch, placing it in the off state. This disables the OCP function of the power module and stops outputting the 5V / 2A charging power. The second switch is opened, enabling the OVG function of the power module 203 and configuring the relevant registers of the power module 203 to reversely output a current and voltage of, for example, 9V / 2A.

[0164] S413 : The power module outputs a charging power of 9V / 2A to the first external device 200 .

[0165] Specifically, as shown in Figure 3, the charging control chip in the power module is electrically connected to the VBUS pin of the USB Type-C interface via a second switch, and is also connected to the battery. Therefore, the power module can provide 9V / 2A charging power to the first external device 200 through the charger chip and the battery.

[0166] It can be seen that the electronic device can negotiate with the first external device to determine different charging powers to meet the demand of outputting higher charging power to the first external device.

[0167] Figure 5 is a schematic diagram of a charging scenario using dual Type-C interfaces based on a first charging circuit according to an embodiment of the present application. As shown in Figure 5, the electronic device 100 is configured with two Type-C interfaces, namely a first Type-C interface 2011 and a second Type-C interface 2012. The electronic device 100 can establish a connection with a first external device 200 (e.g., a mobile phone) through the first Type-C interface, and can establish a connection with a second external device 300 (e.g., a charger) through the second Type-C interface 2012.

[0168] As shown in Figure 5, at the first moment after the electronic device 100 establishes a connection with the first external device 200 via the first Type-C interface 2011, the electronic device 100 identifies itself as the source device and the connected first external device 200 as the sink device. First, the electronic device 100 can provide power to the first external device 200, for example, 5V / 2A (i.e., 10W).

[0169] After the first moment, the first external device 200 confirms that it supports a higher power protocol, such as the PD3.0 protocol, the PD2.0 protocol, etc., and the first external device 200 requests a higher power, such as 9V / 2A (i.e., 18W), from the electronic device 100. After receiving the request from the first external device 200, the electronic device 100 determines whether the following situations exist in which high power cannot be provided: Situation 1, whether the second Type-C interface 2012 is connected to the second external device 300 (such as a charger) and the electronic device 100 is identified as a Sink; Situation 2, whether the system of the electronic device 100 is in the S0 state and the power level is not lower than the preset threshold. If one or more of the above situations exist, the request of the first external device 200 is rejected, and the electronic device 100 continues to output 5V / 2A charging. Therefore, at the second moment after the first moment, the first external device 200 continues to charge at a power of 5V / 2A.

[0170] If none of the above situations exist, after receiving the request from the first external device 200, the electronic device 100 provides 9V / 2A (i.e., 18W) of power to the first external device 200. Therefore, at the second moment, the first external device 200 can be fast charged at 9V / 2A (i.e., 18W).

[0171] When the electronic device 100 outputs 9V / 2A (i.e., 18W) of power to the first external device 200, and the electronic device 100 establishes a connection with the second external device 300 (e.g., a charger), with the electronic device 100 acting as a sink and the second external device 300 (e.g., a charger) acting as a source, the electronic device 100 stops outputting 9V / 2A (i.e., 18W) of power and begins outputting 5V / 2A (i.e., 10W). Therefore, at the third moment after the second moment, the first external device 200 resumes charging at 5V / 2A.

[0172] Figure 6 shows a flow chart of a dual Type-C interface charging scenario based on a first charging circuit, including but not limited to the following steps: For the convenience of description, this application describes the following steps in the following order and is not intended to limit the execution to the above order. This embodiment of the application does not limit the order, execution time, number of executions, etc. of the above one or more steps.

[0173] S501 : The first external device 200 establishes a connection with the power transmission module of the electronic device 100 .

[0174] Specifically, when the first external device 200 is connected to the first Type-C interface 2011, the power transmission module 202 in the electronic device 100 and the first external device 200 handshake through the CC pin of the first Type-C interface 2011 to confirm that it is a Source device and the connected first external device 200 is a Sink device.

[0175] S502 : The power transmission module sends a first message to the first external device 200 .

[0176] Specifically, the electronic device 100 serving as a Source device sends a first message to the first external device 200 serving as a Sink device through a power transmission module. The first message includes that the electronic device 100 can provide one or more charging powers of 5V / 2A and 9V / 2A.

[0177] S503: The first external device 200 requests a charging power of 5V / 2A from the power transmission module.

[0178] S504: The power transmission module turns on the first switch.

[0179] Specifically, as can be seen from Figure 3, the power transmission module can control the on or off of the first switch, and the first switch is electrically connected to the Buck circuit in the power supply module, so that the first switch can control whether the 5V voltage output by the Buck circuit is output to the power transmission module.

[0180] S505: The power module outputs a charging power of 5V / 2A.

[0181] Specifically, the Buck circuit in the voltage module is used to output a 5V voltage. When the first switch is on, the power supply module outputs the 5V voltage to the VBUS pin of the USB Type-C interface through the pin in the power transmission module electrically connected to the first switch, thereby providing a 5V / 2A charging power to the first external device 200.

[0182] S506 : The first external device 200 requests a charging power of 9V / 2A from the power transmission module.

[0183] Specifically, when the first external device 200 supports a fast charging protocol such as PD3.0 or PD2.0, the first external device 200 requests a charging power of 9V / 2A from the power transmission module.

[0184] S507: The power transmission module sends a first request to the control unit.

[0185] Specifically, after receiving the request from the first external device 200 serving as a Sink device, the power transmission module sends a first request for enabling the OTG function (Enable) to the control unit through the I2C interface.

[0186] S508 : The control unit determines whether there is a second external device charging the electronic device 100 .

[0187] Specifically, the electronic device 100 has two or more Type-C interfaces. When the second external device is connected to the second Type-C interface 2012, the power transmission module 202 in the electronic device 100 and the second external device 300 handshake through the CC pin of the second Type-C interface 2012 to determine whether they are the source device and whether the connected second external device is a sink device.

[0188] If the electronic device 100 determines that it is a Sink device and the second external device connected is a Source device, it determines that the second Type-C interface 2012 is in a state of charging the electronic device 100, and the electronic device 100 continues to provide 5V / 2A charging power to the external device.

[0189] If it is determined that no second external device is charging the electronic device via the second Type-C interface, step S509 is executed.

[0190] S509 , the control unit determines whether the system is in S0 and whether the current power level is lower than a preset threshold.

[0191] Specifically, after receiving the request to enable the OTG function, the control unit needs to ensure its own power supply first, and then provide power to the outside world while ensuring its own power supply. Therefore, the control unit determines whether the current system of the electronic device 100 is in the S0 state and whether the battery power is lower than a preset threshold (for example, 20%).

[0192] Therefore, when it is determined that the current system of the electronic device 100 is in the S0 state and the battery power is lower than the preset threshold, the charging power of 5V / 2A continues to be provided to the external device.

[0193] When it is determined that the current system of the electronic device 100 is not in the S0 state and the battery circuit is greater than or equal to the preset threshold, step S510 is executed.

[0194] S510: The control unit sends a second message to the power transmission module.

[0195] Specifically, when it is determined that no second external device is charging the electronic device 100 through the Type-C interface, the current system of the electronic device 100 is not in the S0 state and the battery circuit is greater than or equal to a preset threshold, the control unit sends a second message to the power transmission module to indicate that the OTG function can be turned on.

[0196] S511: No, the control unit sends a message to the power module to enable the OTG function.

[0197] S512: The power module turns on the OTG function.

[0198] S513: The power transmission module turns off the first switch and turns on the second switch.

[0199] Specifically, after receiving the second message, the power transmission module disconnects the first switch, placing it in the off state, thereby disabling the OCP function of the power module and stopping the output of 5V / 2A charging power. The second switch is opened to enable the OVG function of the power module 203 and configure the relevant registers of the power module 203 to reversely output a current and voltage of, for example, 9V / 2A.

[0200] S514 , the power module provides 9V / 2A charging power to the first external device 200 .

[0201] Specifically, as shown in Figure 3, the charging control chip in the power module is electrically connected to the VBUS pin of the USB Type-C interface via a second switch, and is also connected to the battery. Therefore, the power module can provide 9V / 2A charging power to the first external device 200 through the charger chip and the battery.

[0202] S515 : The control unit determines that a second external device is charging the electronic device 100 or the system is in the S0 state.

[0203] S516: The control unit controls to send a second request to the power transmission module.

[0204] Specifically, the second request is used to request the power transmission module to turn off the second switch and turn on the first switch.

[0205] S517: The power transmission module turns off the second switch and turns on the first switch.

[0206] S518 : The power module outputs 5V / 2A charging power to the first external device 200 .

[0207] Specifically, the power module stops outputting the charging power of 9V / 2A and resumes outputting the charging power of 5V / 2A.

[0208] As can be seen, the electronic device can negotiate with the first external device to determine different charging powers to meet the need to output a higher charging power to the first external device. In the case where there is another USB interface (such as a second Type-C interface) to charge the electronic device, in order to ensure the stable performance of the electronic device, the higher charging power output to the first external device can be stopped and the normal charging power can be restored.

[0209] Please refer to Figure 7, which is a schematic diagram of the architecture of another electronic device provided in an embodiment of the present application. As shown in Figure 6, the electronic device 100 includes a second charging circuit 102 and a processor 205. The second charging circuit 102 includes one or more of a first Type-C interface 2011, a second Type-C interface 2012, a power transmission module 202, a power supply module 203, a control unit 204, a first switch switching circuit 2061, and a second switch switching circuit 2062. Among them:

[0210] The first switch switching circuit 2061 corresponds to the first Type-C interface 2011 , and is connected to the first Type-C interface 2011 , the control unit 204 , and the processor 205 , respectively. A 0 ohm (R) resistor is short-circuited on the first switch switching circuit 2061 .

[0211] In some embodiments, the control unit 204 can control the first switch circuit 2061 to switch the DP signal line and the DM signal line connected to the first Type-C interface 2011 to the lines connected to the processor 205. In this way, the first Type-C interface 2011 is connected to the processor 205 through the first switch circuit 2061. When an external device is connected to the electronic device 100 through the first Type-C interface 2011, USB 2.0 recognition can be performed. In other words, the electronic device 100 can transmit data with the external device through the first Type-C interface 2011.

[0212] In some embodiments, the control unit 204 may control the first switch circuit 2061 to switch the DP signal line and the DM signal line connected to the first Type-C interface 2011 to lines connected to 0 ohm (R), respectively.

[0213] The second switch switching circuit 2062 corresponds to the second Type-C interface 2012 , and is respectively connected to the second Type-C interface 2012 , the control unit 204 , and the processor 205 , and a 0 ohm (R) resistor is short-circuited on the second switch switching circuit 2062 .

[0214] In some embodiments, the control unit 204 can control the second switch circuit 2062 to switch the DP signal line and the DM signal line connected to the second Type-C interface 2012 to the lines connected to the processor 205. In this way, the second Type-C interface 2012 is connected to the processor 205 through the second switch circuit 2062. When an external device is connected to the electronic device 100 through the second Type-C interface 2012, USB 2.0 recognition can be performed. In other words, the electronic device 100 can transmit data with the external device through the second Type-C interface 2012.

[0215] In some embodiments, the control unit 204 may control the first switch circuit 2061 to switch the DP signal line and the DM signal line connected to the first Type-C interface 2011 to lines connected to 0 ohm (R), respectively.

[0216] For relevant descriptions of the first Type-C interface 2011, the second Type-C interface 2012, the power transmission module 202, the power supply module 203 and the control unit 204 in Figure 6, please refer to Figure 2 and will not be repeated here.

[0217] It should be noted that the number of switch switching circuits is consistent with the number of Type-C interfaces. This application takes two Type-C interfaces as an example, but is not limited to two Type-C interfaces and two switch switching circuits.

[0218] FIG8 is a schematic diagram of a charging scenario using a single Type-C interface and a second charging circuit according to an embodiment of the present application. The second charging circuit is the second charging circuit 102 shown in FIG7 . In the scenario shown in FIG8 , the electronic device 100 is in the power-on state and / or the sleep state.

[0219] As shown in Figure 8, the electronic device 100 is a laptop computer, which is equipped with two Type-C interfaces: a first Type-C interface 2011 and a second Type-C interface 2012. The electronic device 100 can establish a connection with a first external device 200 (such as a mobile phone) through one of the two Type-C interfaces (such as the first Type-C interface 2011). After the connection is established, the electronic device 100 confirms that it is a Source device and the connected first external device 200 is a Sink device. The electronic device 100 can broadcast the charging power provided by itself to the first external device 200, and display support for PPS, for example, through a pop-up window. At the first moment, the first external device 200 will preferentially request 5V / 2A. Therefore, at the first moment, the electronic device 100 provides a power of, for example, 5V / 2A (i.e., 10W) ​​to the first external device 200, and the electronic device 100 can transmit data with the first external device 200.

[0220] As can be seen from Figure 8, after the connection is established, the electronic device 100 can pop up a window to display "Do you want to fast charge?" to prompt the user whether to select fast charging. If the user selects the "No" option, the electronic device 100 responds to the user operation of the "No" function control and determines that the user has not selected fast charging, so the current charging power is maintained unchanged. If the user selects the "Yes" option, the electronic device 100 responds to the user operation of the "Yes" function control and determines that the user has selected fast charging, so a higher charging power than 5V / 2A is provided to the first external device 200. For example, at the second moment, the first external device 200 can be fast charged at a power of 12V / 3A (i.e., 36W).

[0221] After the second moment, the electronic device 100 can adjust in real time the charging power transmitted to the first external device 200. For example, at the third moment, the first external device 200 can be fast charged at a power of 9V / 2A (ie, 18W).

[0222] Figure 9 shows a flow chart of a charging scenario using a single Type-C port with a second charging circuit, including but not limited to the following steps. For ease of description, this application describes the steps in the following order and is not intended to limit execution to the above order. This application does not limit the order, time, or number of executions of the above steps.

[0223] As shown in Figure 7, the electronic device's control unit can control the switch circuit to switch to the processor side. Thus, when an external device is connected to the electronic device via the Type-C interface, it can identify itself as the SDP side based on the USB 2.0 protocol. When the electronic device 100 is powered on and / or in sleep mode, the control unit defaults to switching the first switch circuit 2061 to the processor side.

[0224] S701 : The first external device 200 establishes a connection with the power transmission module of the electronic device 100 .

[0225] Specifically, when the first external device 200 is connected to the Type-C interface, the power transmission module 202 in the electronic device 100 and the first external device 200 handshake through the CC pin of the Type-C interface to confirm that they are the Source device and the connected first external device 200 is the Sink device.

[0226] S702 : The power transmission module sends a first message to the first external device 200 .

[0227] Specifically, the electronic device 100, which serves as a source device, sends a first message to the first external device 200, which serves as a sink device, through the power transmission module. The first message includes that the electronic device 100 can provide one or more charging powers of 5V / 2A, 9V / 2A, 12V / 2A, 15V / 3A, and 20V / 3.5A, and that it supports a programmable power supply (PPS). It should be noted that the voltage and current provided by the electronic device 100 are not limited to those provided in the embodiments of the present application, and more or less voltage and current can be provided.

[0228] S703: The first external device 200 requests a charging power of 5V / 2A from the power transmission module.

[0229] S704: The power transmission module turns on the first switch.

[0230] Specifically, as can be seen from Figure 7, the power transmission module can control the on or off of the first switch, and the first switch is electrically connected to the Buck circuit in the power supply module, so that the first switch can control whether the 5V voltage output by the Buck circuit is output to the power transmission module.

[0231] S705: The power module outputs a charging power of 5V / 2A.

[0232] Specifically, the Buck circuit in the voltage module is used to output a 5V voltage. When the first switch is on, the power supply module outputs the 5V voltage to the VBUS pin of the USB Type-C interface through the pin in the power transmission module electrically connected to the first switch, thereby providing a 5V / 2A charging power to the first external device 200.

[0233] Since when the electronic device 100 is in the power-on state and / or sleep state, the electronic device can control the switch switching circuit to switch to the processor end through the control unit, therefore, after the electronic device establishes a connection with the external device, the electronic device can be confirmed as the SDP end based on the BC1.2 protocol, thereby supporting the function of data transmission with the external device.

[0234] S706: The control unit controls the first switch circuit to switch to the 0R resistor.

[0235] Specifically, the UI of the electronic device prompts the user through a pop-up window whether to select fast charging. If the user selects fast charging, the control unit controls the first control switch switching circuit to switch from the processor end to the 0R resistor end. As can be seen from Figure 6, after switching to the 0R resistor section, the first Type-C interface is disconnected from the processor. If the user does not select fast charging, the electronic device continues to output 5V / 2A charging power.

[0236] S707: The control unit sends a second message to the power transmission module.

[0237] Specifically, the second message is used to notify the power transmission module to turn off the first switch.

[0238] S708: The power transmission module turns off the first switch.

[0239] Specifically, the power transmission module turns off the first switch in response to the second message.

[0240] S709: The first external device re-establishes a connection with the power transmission module.

[0241] Specifically, after the power transmission module stops the OCP function by disconnecting the first switch, the first external device and the electronic device can re-establish a connection, for example, by identifying the electronic device as a DCP end through the Type-C interface based on BC1.2.

[0242] S710: The power transmission module sends a third message to the control unit.

[0243] Specifically, after the electronic device establishes a connection with the first external device based on BC1.2, the first external device requests the power transmission module for the highest charging capacity supported by the first external device, and the power transmission module sends a third message to the control unit through I2C. The third message is used to request the highest voltage and current supported by the first external device.

[0244] S711: The control unit sends a message to the power module to enable the OTG function.

[0245] Specifically, the control unit configures the OTG voltage and current of the charger chip in the power module according to the requirements from the power transmission module, and turns on the OTG function.

[0246] S712: The power module enables the OTG function.

[0247] Specifically, the power module turns on the OTG function according to the configuration of the control unit.

[0248] S713: The control unit sends a fourth message to the power transmission module.

[0249] The fourth message is used to indicate that the OTG function has been configured.

[0250] S714: The power transmission module turns off the first switch and turns on the second switch.

[0251] Specifically, after receiving the message that the OTG function has been configured, the power transmission module turns on the second switch and turns off the first switch.

[0252] S715: The power module outputs the highest level of voltage and current supported by the first external device.

[0253] Specifically, after the second switch is turned on, the power module can output the highest-level voltage and current requested by the first external device to the first external device through the charger chip.

[0254] S716: The first external device sends a third request to the power transmission module.

[0255] Specifically, the first external device may send a third request to the electronic device, such as "get PPS state", where the third request is used to request voltage and current adjustment.

[0256] S717: The power transmission module sends a voltage and current adjustment request to the control unit.

[0257] S718, the control unit adjusts the voltage and current.

[0258] Specifically, the control unit adjusts the OTG voltage and current of the charger chip in the power module in real time according to the requirements of the power transmission module.

[0259] S719: The power module outputs a voltage and current corresponding to the third request to the first external device.

[0260] In some embodiments, after the first external device is disconnected from the electronic device, the power transmission module disconnects the second switch and sends a message to the control unit to disconnect the second switch. The control unit controls the first switch switching circuit to switch to the processor end and waits for the next external device to be connected.

[0261] It can be seen that in the power-on scenario and / or sleep scenario, the control unit of the electronic device controls the switch switching circuit to switch to the processor end by default. Therefore, after the first external device is connected to the electronic device, it can transmit data based on USB2.0, and can also output normal charging power to the first external device. After the first external device has a fast charging demand, the electronic device responds to its demand and switches to a 0 ohm short circuit through the switch switching circuit, so that the electronic device is identified as a DCP end. After the first external device identifies the electronic device as a DCP end, it can support some charging gears of the PD protocol and PPS.

[0262] Figure 10 shows a flow chart of another charging scenario using a single Type-C port with a second charging circuit, including but not limited to the following steps. For ease of description, this application describes the steps in the following order and is not intended to limit execution to the above order. This application does not limit the order, time, or number of executions of the above steps.

[0263] As can be seen in Figure 7, the electronic device can control the switch switching circuit to switch to an OR short circuit through the control unit. In this way, when an external device is connected to the electronic device via the Type-C interface, it can be identified as a DCP end based on the BC1.2 protocol. When the electronic device 100 is in the off state, the control unit defaults to switching the first switch switching circuit 2061 to an OR short circuit.

[0264] S801 : The first external device 200 establishes a connection with the power transmission module of the electronic device 100 .

[0265] Specifically, when the first external device 200 is connected to the first Type-C interface, the power transmission module 202 in the electronic device 100 and the first external device 200 handshake through the CC pin of the Type-C interface to confirm that it is a Source device and the connected first external device 200 is a Sink device.

[0266] S802: The power transmission module sends a first message to the first external device 200.

[0267] Specifically, the electronic device 100, which serves as a source device, sends a first message to the first external device 200, which serves as a sink device, through the power transmission module. The first message includes that the electronic device 100 can provide one or more charging powers of 5V / 2A, 9V / 2A, 12V / 2A, 15V / 3A, and 20V / 3.5A, and that it supports a programmable power supply (PPS). It should be noted that the voltage and current provided by the electronic device 100 are not limited to those provided in the embodiments of the present application, and more or less voltage and current can be provided.

[0268] S803: The first external device 200 requests a charging power of 5V / 2A from the power transmission module.

[0269] S804: The power transmission module turns on the first switch.

[0270] Specifically, as can be seen from FIG6 , the power transmission module can control the on or off state of the first switch, which is electrically connected to the Buck circuit in the power module. Thus, the first switch can control whether the 5V voltage output by the Buck circuit is output to the power transmission module. Since the electronic device 100 can control the switch switching circuit to switch to the processor end through the control unit when the electronic device 100 is in the power-on state and / or the sleep state, after the electronic device establishes a connection with the external device, the electronic device can be confirmed as the SDP end based on USB 2.0, thereby supporting the function of data transmission with the external device.

[0271] S805: The power module outputs a charging power of 5V / 2A.

[0272] Specifically, the Buck circuit in the voltage module is used to output a 5V voltage. When the first switch is on, the power supply module outputs the 5V voltage to the VBUS pin of the USB Type-C interface through the pin in the power transmission module electrically connected to the first switch, thereby providing a 5V / 2A charging power to the first external device 200.

[0273] At the same time, based on USB2.0, electronic devices are identified as DCP terminals, and voltage, current and PPS adjustments can be performed.

[0274] S806: The first external device sends a third message to the power transmission module.

[0275] The third message is used to request the electronic device to support the highest voltage and current level, for example, 12V / 2A.

[0276] S807: The power transmission module sends a third message to the control unit.

[0277] Specifically, the power transmission module sends a third message to the control unit through I2C, where the third message is used to request the control unit to configure the highest gear of voltage and current supported by the first external device.

[0278] S808: The control unit sends a message to the power module to enable the OTG function.

[0279] Specifically, the control unit configures the OTG voltage and current of the charger chip in the power module according to the requirements from the power transmission module, and turns on the OTG function.

[0280] S809: The power module turns on the OTG function.

[0281] Specifically, the power module turns on the OTG function according to the configuration of the control unit.

[0282] S810: The control unit sends a fourth message to the power transmission module.

[0283] The fourth message is used to indicate that the OTG function has been configured.

[0284] S811: The power transmission module turns off the first switch and turns on the second switch.

[0285] Specifically, after receiving the message that the OTG function has been configured, the power transmission module turns on the second switch and turns off the first switch.

[0286] S812: The power module outputs the highest-level voltage and current supported by the first external device.

[0287] Specifically, after the second switch is turned on, the power module can output the highest-level voltage and current requested by the first external device to the first external device through the charger chip.

[0288] S813: The first external device sends a third request to the power transmission module.

[0289] Specifically, the first external device may send a third request to the electronic device, such as "get PPS state", where the third request is used to request voltage and current adjustment.

[0290] S814: The power transmission module sends a voltage and current adjustment request to the control unit.

[0291] S815, the control unit adjusts the voltage and current.

[0292] Specifically, the control unit adjusts the OTG voltage and current of the charger chip in the power module in real time according to the requirements of the power transmission module.

[0293] S816: The power module outputs a voltage and current corresponding to the third request to the first external device.

[0294] In some embodiments, after the first external device is disconnected from the electronic device, the power transmission module disconnects the second switch and sends a message to the control unit to disconnect the second switch. The control unit controls the first switch switching circuit to switch to the processor end and waits for the next external device to be connected.

[0295] As can be seen, in the shutdown scenario, the electronic device's control unit defaults to controlling the switch circuit to short-circuit the 0-ohm resistor. Therefore, after the first external device is connected to the electronic device, the electronic device is identified as a DCP terminal. After the first external device identifies the electronic device as a DCP terminal, it can support some charging modes of the PD protocol, as well as PPS.

[0296] FIG11 is a schematic diagram of a dual Type-C interface charging scenario based on a second charging circuit according to an embodiment of the present application. The second charging circuit is the second charging circuit 102 shown in FIG7 . In the scenario shown in FIG11 , the electronic device 100 is in the power-on state and / or the sleep state.

[0297] As shown in Figure 11, the electronic device 100 is a laptop computer, which is equipped with two Type-C interfaces, a first Type-C interface 2011 and a second Type-C interface 2012. The electronic device 100 can establish a connection with a first external device 200 (such as a mobile phone) through one of the two Type-C interfaces (such as the first Type-C interface 2011). After the connection is established, the electronic device 100 confirms that it is a Source device and the connected first external device 200 is a Sink device. The electronic device 100 can broadcast the charging power provided by itself to the first external device 200, and display support for PPS, for example, through a pop-up window. At the first moment, the first external device 200 will preferentially request 5V / 2A. Therefore, at the first moment, the electronic device 100 provides a power of, for example, 5V / 2A (i.e., 10W) ​​to the first external device 200, and the electronic device 100 can transmit data with the first external device 200.

[0298] As can be seen from FIG11 , at the first moment, after the electronic device 100 provides a power of, for example, 5V / 2A (i.e., 10W) ​​to the first external device 200, the following situations may occur:

[0299] In case 1, after the first moment, the electronic device 100 detects that the second external device 300 is charging itself through the second Type-C interface, and the electronic device 100 maintains the current charging power of 5V / 2A. That is, at the second moment, the first external device 200 is still charging at a power of 5V / 2A.

[0300] In the second scenario, after the first moment, the electronic device 100 detects that there is no second external device 300 charging itself through the second Type-C interface, and a pop-up window can be displayed to ask "Do you want to fast charge?" to prompt the user whether to select fast charging. If the user selects the "No" option, the electronic device 100 maintains the current charging power unchanged in response to the user operation of the "No" function control. For example, at the second moment, the first external device 200 is still fast charged at a power of 12V / 3A (i.e., 36W).

[0301] If the user selects the "Yes" option, the electronic device 100 responds to the user operation of the "Yes" function control and provides a higher charging power than 5V / 2A (for example, 12V / 3A) to the first external device 200. Therefore, at the second moment, the first external device 200 can be quickly charged at a power of 12V / 3A (i.e., 36W). After the second moment, the electronic device 100 can adjust the charging power transmitted to the first external device 200 in real time. For example, at the third moment, the first external device 200 can be quickly charged at a power of 9V / 2A (i.e., 18W).

[0302] Case three: After the first moment, the electronic device 100 detects that there is no second external device 300 charging itself through the second Type-C interface, and a pop-up window can be displayed "Do you want to fast charge?" to prompt the user whether to choose fast charging. If the user selects the "Yes" option, the electronic device 100 responds to the user operation of the "Yes" function control and provides a higher charging power than 5V / 2A (for example, 12V / 3A) to the first external device 200. Therefore, at the second moment, the first external device 200 can be fast charged at a power of 12V / 3A (i.e., 36W). After the second moment, the electronic device 100 can adjust the charging power transmitted to the first external device 200 in real time. For example, at the third moment, the first external device 200 can be fast charged at a power of 9V / 2A (i.e., 18W). After the second or third moment, the electronic device 100 detects that the second external device 300 is charging itself via the second Type-C interface 2012, or detects that the first external device 200 is transmitting data via the first Type-C interface 2011, and the charging power is restored to 5V / 2A. Therefore, at a fourth moment after the second or third moment, the first external device 200 is charged again at 5V / 2A.

[0303] Figures 12A-12C illustrate a schematic flow diagram of a dual Type-C port charging scenario based on a second charging circuit, including but not limited to the following steps. For ease of description, this application describes the steps in the order of S901-S922, and is not intended to limit execution to the above order. This embodiment of the application does not limit the order, time, or number of executions of the above one or more steps.

[0304] As can be seen in Figure 7, the electronic device can control the switch circuit 2061 and the second switch circuit 2062 to switch to the processor side through the control unit. In this way, when an external device is connected to the electronic device via the Type-C interface, it can be identified as the SDP side based on the USB 2.0 protocol. When the electronic device 100 is powered on and / or in sleep mode, the control unit controls the first switch circuit 2061 and the second switch circuit 2062 to switch to the processor side by default.

[0305] S901 : The first external device 200 establishes a connection with the power transmission module of the electronic device 100 .

[0306] Specifically, when the first external device 200 is connected to the first Type-C interface, the power transmission module 202 in the electronic device 100 and the first external device 200 handshake through the CC pin of the first Type-C interface to confirm that they are the Source device and the connected first external device 200 is the Sink device.

[0307] S902 : The power transmission module sends a first message to the first external device 200 .

[0308] Specifically, the electronic device 100, which serves as a source device, sends a first message to the first external device 200, which serves as a sink device, through the power transmission module. The first message includes that the electronic device 100 can provide one or more charging powers of 5V / 2A, 9V / 2A, 12V / 2A, 15V / 3A, and 20V / 3.5A, and that it supports a programmable power supply (PPS). It should be noted that the voltage and current provided by the electronic device 100 are not limited to those provided in the embodiments of the present application, and more or less voltage and current can be provided.

[0309] S903: The first external device 200 requests a charging power of 5V / 2A from the power transmission module.

[0310] S904: The power transmission module turns on a first switch corresponding to the first Type-C interface.

[0311] Specifically, as can be seen from Figure 7, the power transmission module can control the on or off of the first switch corresponding to the first Type-C interface. The first switch is electrically connected to the Buck circuit in the power supply module, so that the first switch can control whether the 5V voltage output by the Buck circuit is output to the power transmission module.

[0312] S905: The power module outputs a charging power of 5V / 2A.

[0313] Specifically, the Buck circuit in the voltage module is used to output a 5V voltage. When the first switch corresponding to the first Type-C interface is on, the power supply module outputs the 5V voltage to the VBUS pin of the first Type-C interface through the pin electrically connected to the first switch in the power transmission module, thereby providing a charging power of 5V / 2A to the first external device 200.

[0314] Since the electronic device 100 can control the switch circuit to switch to the processor end through the control unit when the electronic device 100 is in the power-on state and / or the sleep state, after the electronic device establishes a connection with the external device, it can be confirmed based on USB2.0 that the electronic device is the SDP end, thereby supporting the function of data transmission with the external device.

[0315] S906: The control unit determines whether the second Type-C interface is in a state of charging the electronic device.

[0316] Specifically, the electronic device 100 has two or more Type-C interfaces. When the second external device is connected to the second Type-C interface 2012, the power transmission module 202 in the electronic device 100 and the second external device 300 handshake through the CC pin of the second Type-C interface 2012 to determine whether it is a Source device and whether the connected second external device is a Sink device.

[0317] If the electronic device 100 determines that it is a sink device and the second external device connected is a source device, it is determined that the second Type-C interface 2012 is in a state of charging the electronic device 100, and the electronic device 100 continues to provide 5V / 2A charging power to the external device.

[0318] If it is determined that the second Type-C interface 2012 is not in a state of charging the electronic device 100 , step S907 is executed.

[0319] S907: The control unit determines whether to perform fast charging.

[0320] Specifically, as shown in FIG10 , the electronic device may display a pop-up window asking “whether to perform fast charging”, and in response to a user operation on the pop-up window, may determine whether to perform fast charging or not.

[0321] After receiving the message that fast charging is not performed, the electronic device maintains the current output power and continues to provide 5V / 2A charging power to the external device.

[0322] After receiving the fast charging message, execute step S908.

[0323] S908: The control unit controls the first switch circuit to switch to the 0R resistor.

[0324] Specifically, the UI of the electronic device prompts the user through a pop-up window whether to select fast charging. If the user selects fast charging, the control unit controls the first control switch switching circuit corresponding to the first Type-C interface to switch from the processor end to the 0R resistor end. As can be seen from Figure 6, after switching to the 0R resistor section, the first Type-C interface is disconnected from the processor. If the user does not select fast charging, the electronic device continues to output 5V / 2A charging power.

[0325] S909: The first external device re-establishes a connection with the power transmission module.

[0326] Specifically, after the power transmission module stops the OCP function by disconnecting the first switch corresponding to the first Type-C interface, the first external device and the electronic device can re-establish a connection, for example, identifying the electronic device as a DCP end through the Type-C interface based on BC1.2.

[0327] S910: The power transmission module sends a third message to the control unit.

[0328] Specifically, after the electronic device establishes a connection with the first external device based on BC1.2, the first external device requests the power transmission module for the highest charging capacity supported by the first external device, and the power transmission module sends a third message to the control unit through I2C. The third message is used to request the highest voltage and current supported by the first external device.

[0329] S911: The control unit sends a message to the power module to enable the OTG function.

[0330] Specifically, the control unit configures the OTG voltage and current of the charger chip in the power module according to the requirements from the power transmission module, and turns on the OTG function.

[0331] S912: The power module enables the OTG function.

[0332] Specifically, the power module turns on the OTG function according to the configuration of the control unit.

[0333] S913: The control unit sends a fourth message to the power transmission module.

[0334] The fourth message is used to indicate that the OTG function has been configured.

[0335] S914: The power transmission module turns off the first switch corresponding to the first Type-C interface and turns on the second switch corresponding to the first Type-C interface.

[0336] Specifically, after receiving the message that the OTG function has been configured, the power transmission module turns on the second switch corresponding to the first Type-C interface and turns off the first switch corresponding to the first Type-C interface.

[0337] S915: The power module outputs the highest level of voltage and current supported by the first external device.

[0338] Specifically, after the second switch corresponding to the first Type-C interface is turned on, the power module can output the highest-level voltage and current requested by the first external device to the first external device through the charger chip.

[0339] S916: The first external device sends a third request to the power transmission module.

[0340] Specifically, the first external device may send a third request to the electronic device, such as "get PPS state", where the third request is used to request voltage and current adjustment.

[0341] S917: The power transmission module sends a voltage and current adjustment request to the control unit.

[0342] S918, the control unit adjusts the voltage and current.

[0343] Specifically, the control unit adjusts the OTG voltage and current of the charger chip in the power module in real time according to the requirements of the power transmission module.

[0344] S919: The power module outputs a voltage and current corresponding to the third request to the first external device.

[0345] In some embodiments, after the first external device is disconnected from the electronic device, the power transmission module disconnects the second switch and sends a message to the control unit to disconnect the second switch. The control unit controls the first switch switching circuit to switch to the processor end and waits for the next external device to be connected.

[0346] In some possible implementations, after any step between S910 - S919 shown in FIG. 12A , one or more steps from S920 - S926 shown in FIG. 12B are further included.

[0347] S920: The second external device establishes a connection with the power transmission module.

[0348] Specifically, a second external device (such as a charger) is connected to the electronic device through the second Type-C interface and establishes a connection with the power transmission module. The second external device is identified as the source end and the electronic device as the sink end, and the second external device can charge the electronic device.

[0349] S921: The power transmission module sends a fifth message to the control unit.

[0350] The fifth message is used to inform the control unit that a second external device is connected to the electronic device.

[0351] S922: The control unit sends a message to the power module to disable the OTG function.

[0352] S923: The power module disables the OTG function.

[0353] S924, the control unit controls the first switch circuit to switch to the processor end.

[0354] The first switch circuit is connected to the first Type-C interface. After the first switch circuit switches to the processor end, the first Type-C interface can be connected to the processor through the first switch circuit. Therefore, the data transmission function of the electronic device is restored, and the first external device can perform data transmission with the electronic device.

[0355] S925: The control unit turns off the second switch and turns on the first switch.

[0356] Among them, disconnecting the second switch indicates that the power module cannot output high power to the first external device through the charger chip, and opening the first switch indicates that the power module can output 5V / 2A power to the first external device through the Buck circuit.

[0357] S926: The power module outputs 5V / 2A charging power to the first external device.

[0358] In some possible implementations, after any step between S910 - S919 shown in FIG. 12A , steps S927 - S931 shown in FIG. 12C are further included.

[0359] S927: The first external device sends a sixth message to the processor.

[0360] Specifically, the first external device may select to resume the data transmission function on the UI interface of the electronic device, thereby sending a sixth message to the processor to resume the data transmission function.

[0361] S928: The processor sends a sixth message to the control unit.

[0362] The sixth message is used to notify the control unit that the first external device is to be switched back to the SDP end.

[0363] S929: The control unit controls the first switch circuit to switch to the processor end.

[0364] The first switch circuit is connected to the first Type-C interface. After the first switch circuit switches to the processor end, the first Type-C interface can be connected to the processor through the first switch circuit. Therefore, the data transmission function of the electronic device is restored, and the first external device can perform data transmission with the electronic device.

[0365] S930: The control unit turns off the second switch and turns on the first switch.

[0366] Among them, disconnecting the second switch indicates that the power module cannot output high power to the first external device through the charger chip, and opening the first switch indicates that the power module can output 5V / 2A power to the first external device through the Buck circuit.

[0367] S931: The power module outputs 5V / 2A charging power to the first external device.

[0368] Figures 13A-13C illustrate another process flow diagram for a dual Type-C port charging scenario based on a second charging circuit, including but not limited to the following steps. For ease of description, this application describes the steps in the order of S1001-S1017, and is not intended to limit execution to the above order. This embodiment of the application does not limit the order, time, or number of executions of the above one or more steps.

[0369] As shown in Figure 7, the electronic device can control the switch switching circuit to switch to an OR short circuit through the control unit. In this way, when an external device is connected to the electronic device via the Type-C interface, it can be identified as a DCP terminal based on the USB 2.0 protocol. When the electronic device 100 is powered off, the control unit defaults to controlling the first switch switching circuit 2061 and the second switch switching circuit 2062 to switch to an OR short circuit.

[0370] S1001 : The first external device 200 establishes a connection with the power transmission module of the electronic device 100 .

[0371] Specifically, when the first external device 200 is connected to the first Type-C interface, the power transmission module 202 in the electronic device 100 and the first external device 200 handshake through the CC pin of the first Type-C interface to confirm that they are the Source device and the connected first external device 200 is the Sink device.

[0372] S1002 : The power transmission module sends a first message to the first external device 200 .

[0373] Specifically, the electronic device 100, which serves as a source device, sends a first message to the first external device 200, which serves as a sink device, through the power transmission module. The first message includes that the electronic device 100 can provide one or more charging powers of 5V / 2A, 9V / 2A, 12V / 2A, 15V / 3A, and 20V / 3.5A, and that it supports a programmable power supply (PPS). It should be noted that the voltage and current provided by the electronic device 100 are not limited to those provided in the embodiments of the present application, and more or less voltage and current can be provided.

[0374] S1003: The first external device 200 requests a charging power of 5V / 2A from the power transmission module.

[0375] S1004: The power transmission module turns on a first switch corresponding to the first Type-C interface.

[0376] Specifically, as can be seen from Figure 7, the power transmission module can control the on or off of the first switch corresponding to the first Type-C interface. The first switch is electrically connected to the Buck circuit in the power supply module, so that the first switch can control whether the 5V voltage output by the Buck circuit is output to the power transmission module.

[0377] S1005: The power module outputs a charging power of 5V / 2A.

[0378] Specifically, the Buck circuit in the voltage module is used to output a 5V voltage. When the first switch corresponding to the first Type-C interface is on, the power supply module outputs the 5V voltage to the VBUS pin of the first Type-C interface through the pin electrically connected to the first switch in the power transmission module, thereby providing a charging power of 5V / 2A to the first external device 200.

[0379] Since the electronic device 100 can control the switch circuit to switch to the processor end through the control unit when the electronic device is turned off, after the electronic device establishes a connection with the external device, it can be confirmed based on USB2.0 that the electronic device is a DCP end, and voltage adjustment or PPS adjustment can be performed.

[0380] S1006: The control unit determines whether the second Type-C interface is in a state of charging the electronic device.

[0381] Specifically, the electronic device 100 has two or more Type-C interfaces. When the second external device is connected to the second Type-C interface 2012, the power transmission module 202 in the electronic device 100 and the second external device 300 handshake through the CC pin of the second Type-C interface 2012 to determine whether it is a Source device and whether the connected second external device is a Sink device.

[0382] If the electronic device 100 determines that it is a Sink device and the second external device connected is a Source device, it is determined that the second Type-C interface 2012 is in a state of charging the electronic device 100, and the electronic device 100 continues to provide 5V / 2A charging power to the external device.

[0383] If it is determined that the second Type-C interface 2012 is not in a state of charging the electronic device 100 , step S1007 is executed.

[0384] S1007: The first external device sends a third message to the power transmission module.

[0385] The third message is used to request the electronic device to support the highest voltage and current level, for example, 12V / 2A.

[0386] S1008: The power transmission module sends a third message to the control unit.

[0387] Specifically, the power transmission module sends a third message to the control unit through I2C, and the fourth message is used to request the control unit to configure the highest gear voltage and current supported by the first external device.

[0388] S1009: The control unit sends a message to the power module to enable the OTG function.

[0389] Specifically, the control unit configures the OTG voltage and current of the charger chip in the power module according to the requirements from the power transmission module, and turns on the OTG function.

[0390] S1010: Enable the OTG function of the power module.

[0391] Specifically, the power module turns on the OTG function according to the configuration of the control unit.

[0392] S1011: The control unit sends a fourth message to the power transmission module.

[0393] The fourth message is used to indicate that the OTG function has been configured.

[0394] S1012: The power transmission module turns off the first switch corresponding to the first Type-C interface and turns on the second switch corresponding to the first Type-C interface.

[0395] Specifically, after receiving the message that the OTG function has been configured, the power transmission module turns on the second switch corresponding to the first Type-C interface and turns off the first switch corresponding to the first Type-C interface.

[0396] S1013: The power module outputs the highest level of voltage and current supported by the first external device.

[0397] Specifically, after the second switch corresponding to the first Type-C interface is turned on, the power module can output the highest-level voltage and current requested by the first external device to the first external device through the charger chip.

[0398] S1014: The first external device sends a third request to the power transmission module.

[0399] Specifically, the first external device may send a third request to the electronic device, such as "get PPS state", where the third request is used to request voltage and current adjustment.

[0400] S1015: The power transmission module sends a voltage and current adjustment request to the control unit.

[0401] S1016, the control unit adjusts the voltage and current.

[0402] Specifically, the control unit adjusts the OTG voltage and current of the charger chip in the power module according to the requirements of the power transmission module.

[0403] S1017: The power module outputs a voltage and current corresponding to the third request to the first external device.

[0404] In some embodiments, after the first external device is disconnected from the electronic device, the power transmission module turns off the second switch and sends a message to the control unit to turn off the second switch. The control unit controls the first switch switching circuit to switch to the processor end and wait for the next external device to be connected.

[0405] In some possible implementations, after any step between S1007 and S1017 shown in FIG13A , one or more steps from S1018 to S1023 shown in FIG13B are further included.

[0406] S1018: The second external device establishes a connection with the power transmission module.

[0407] Specifically, a second external device (such as a charger) is connected to the electronic device through the second Type-C interface and establishes a connection with the power transmission module. The second external device is identified as the source end and the electronic device as the sink end, and the second external device can charge the electronic device.

[0408] S1019: The power transmission module sends a fifth message to the control unit.

[0409] The fifth message is used to inform the control unit that a second external device is connected to the electronic device.

[0410] S1020: The control unit sends a message to the power module to disable the OTG function.

[0411] S1021: The power module disables the OTG function.

[0412] S1022: The control unit turns off the second switch corresponding to the first Type-C interface and turns on the first switch corresponding to the first Type-C interface.

[0413] Among them, turning off the second switch indicates that the power module cannot output high power to the first external device through the charger chip, and turning on the first switch indicates that the power module can output 5V / 2A power to the first external device through the Buck circuit.

[0414] S1023: The power module outputs 5V / 2A charging power to the first external device.

[0415] In some possible implementations, after any step between S1007 - S1017 shown in FIG. 13A , steps S1024 - S1030 shown in FIG. 13C are further included.

[0416] S1024: The control unit detects that the electronic device is in the power-on state.

[0417] Specifically, in response to a user operation of a power button on the electronic device, the detection unit may detect that the electronic device is in a power-on state.

[0418] S1025: The control unit sends a message to the power module to disable the OTG function.

[0419] S1026: The power module disables the OTG function.

[0420] S1027: The control unit turns off the second switch corresponding to the first Type-C interface.

[0421] S1028, the control unit configures the switch to switch the circuit to the processor end.

[0422] Specifically, the control unit configures the first switch circuit to switch to the processor end, and configures the second switch circuit to switch to the processor end.

[0423] S1029: The control unit turns on the first switch corresponding to the first Type-C interface.

[0424] S1030: The power module outputs 5V / 2A charging power to the first external device.

[0425] Because the first Type-C interface can be connected to the processor via the first switch switching circuit, after the electronic device is powered on, the first external device can communicate data with the electronic device via the first Type-C interface. Similarly, the second external device connected to the second Type-C interface can communicate data with the electronic device via the second switch switching circuit.

[0426] Please refer to FIG. 14 , which is a flowchart of a charging method provided by an embodiment of the present application. The method is applied to an electronic device, such as the electronic device 100 shown in FIG. 1 , FIG. 2 , or FIG. 7 . The method includes but is not limited to the following steps:

[0427] S1401: The electronic device sends a first message to a first external device through a first USB interface.

[0428] Specifically, the detailed description may refer to S401-S402 shown in Figure 4, or S501-S502 in Figure 6, or S701-S702 shown in Figure 9, or S801-S802 shown in Figure 10, or S901-S902 shown in Figure 12A, or S1001-S1002 shown in Figure 13A.

[0429] S1402: The electronic device receives a request for a charging power of a first specification from a first external device.

[0430] Specifically, the detailed description may refer to S403 shown in FIG. 4 , or S503 in FIG. 6 , or S703 shown in FIG. 9 , or S803 shown in FIG. 10 , or S903 shown in FIG. 12A , or S1003 shown in FIG. 13A .

[0431] S1403: The electronic device outputs a first specification of charging power to a first external device through a first USB interface.

[0432] For detailed description, please refer to S404-S405 shown in Figure 4, or S504-S505 in Figure 6, or S704-S705 shown in Figure 9, or S804-S805 shown in Figure 10, or S904-S905 shown in Figure 12A, or S1004-S1005 shown in Figure 13A.

[0433] S1404: The electronic device receives a request for a charging power of a second specification from a first external device.

[0434] Specifically, detailed description may refer to S406 shown in FIG. 4 , or S506 shown in FIG. 6 .

[0435] In one possible implementation, the electronic device further includes a switch circuit and a processor, wherein the switch circuit corresponds to one or more USB ports and connects the processor to a short-circuited 0-ohm resistor. For a detailed description, see FIG7 .

[0436] In one implementation, the switch switching circuit is used to connect the first USB interface and the processor. After the electronic device outputs a first specification of charging power to the first external device through the first USB interface, before the electronic device receives a request for a second specification of charging power from the first external device, the electronic device can also receive a fast charging request from the first external device; in response to the fast charging request, the switch switching circuit is controlled to switch from connecting to the processor to connecting to a 0-ohm resistor; and a protocol interaction is performed with the first external device through the first USB interface to determine that the electronic device is a dedicated charging port (DCP). For detailed descriptions, please refer to S706-S709 shown in Figure 9, or S907-S911 shown in Figure 12A.

[0437] In one implementation, the electronic device connects to a second external device via a second USB interface among the one or more USB interfaces, and receives a fast charge request from the first external device when it determines that the second external device located at the second USB interface is not charging the electronic device. For detailed descriptions, please refer to S906-S907 shown in Figure 12A or S1006-S1007 shown in Figure 13A.

[0438] In one possible implementation, when the switch circuit is connected to the first USB port and the 0-ohm resistor, the electronic device is a DCP terminal. Detailed descriptions can be found in S806-S807 shown in FIG10 or S1007-S1008 shown in FIG13A.

[0439] S1405: The electronic device outputs a second-specification charging power to the first external device through the first USB interface.

[0440] In one possible implementation, the electronic device includes one or more of a power transmission module, a control unit, and a power supply module, and the active OTG function of the power supply module is turned on by the control unit; the second switch of the power supply module is turned on by the power transmission module, wherein the second switch is used to connect the first USB interface and the charger chip in the power supply module, and the charger chip in the power supply module is used to provide a charging power of a second specification; based on the OTG function and the second switch in the on state, the charging power of the second specification is output to the first external device through the first USB interface.

[0441] In one possible implementation, if it is determined that the electronic device's system is not in an operating state and / or the electronic device's battery level is greater than or equal to a preset threshold, the electronic device outputs a second-specified charging power to the first external device via the first USB interface. For a detailed description, see S407-S413 in FIG. 4 .

[0442] In one possible implementation, the electronic device is connected to a second external device via a second USB interface among one or more USB interfaces. If it is determined that the second external device located at the second USB interface is not charging the electronic device, and if it is determined that the system of the electronic device is not in an operating state and / or the battery level of the electronic device is greater than or equal to a preset threshold, the electronic device outputs a second-specified charging power to the first external device via the first USB interface. For a detailed description, please refer to S507-S518 shown in FIG. 6 .

[0443] In one possible implementation, the switching circuit is configured to connect the first USB interface to the processor, the electronic device connects to the second external device via a second USB interface among the one or more USB interfaces, and outputs a second charging power specification to the first external device via the first USB interface. For a detailed description, see S710-S715 in FIG9 .

[0444] In one possible implementation, when the switch circuit connects the first USB port to the 0-ohm resistor, the electronic device functions as a DCP terminal and outputs the second-spec charging power to the first external device via the first USB port. For a detailed description, see S807-S812 in FIG10 .

[0445] In one possible embodiment, the switch switching circuit is used to connect the first USB interface and the processor, and the electronic device is connected to the second external device through the second USB interface among the one or more USB interfaces. When it is determined that the second external device located at the second USB interface is not charging the electronic device, the charging power of the second specification is output to the first external device through the first USB interface. For detailed description, please refer to S912-S917 shown in Figure 12A. In one possible embodiment, when the switch switching circuit is connected to the first USB interface and the 0 ohm resistor, the electronic device is a DCP end, and the electronic device is connected to the second external device through the second USB interface among the one or more USB interfaces. When it is determined that the second external device located at the second USB interface is not charging the electronic device, the charging power of the second specification is output to the first external device through the first USB interface. For detailed description, please refer to S1008-S1013 shown in Figure 13A.

[0446] In one possible implementation, after outputting a second-specification charging power to a first external device via a first USB interface, the electronic device receives a request for a third-specification charging power from the electronic device; adjusts the voltage and current based on the third-specification charging power request, and outputs the voltage and current corresponding to the third-specification charging power request. For detailed descriptions, see S716-S719 in FIG. 9 , S813-S816 in FIG. 10 , S918-S921 in FIG. 12A , or S1014-S1017 in FIG. 13A .

[0447] The term "user interface (UI)" in the specification, claims and drawings of this application refers to the media interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is a source code written in a specific computer language such as Java and Extensible Markup Language (XML). The interface source code is parsed and rendered on the terminal device, and finally presented as content that the user can recognize, such as pictures, text, buttons and other controls. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, pictures and text. The properties and contents of controls in the interface are defined by tags or nodes, such as XML through <textview> 、 <imgview> 、 <videoview>The controls contained in the interface are specified by nodes such as <head> and <body>. A node corresponds to a control or attribute in the interface, and the node is presented as user-visible content after parsing and rendering. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is a source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser. The specific content contained in a web page is also defined by tags or nodes in the web page source code, such as HTML through <body>. 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.

[0448] A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operations that uses graphics. It can be an icon, window, control, or other interface element displayed on the display of an electronic device. Controls can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and other visual interface elements.

[0449] It should be understood that each step in the above method embodiments provided herein can be implemented by hardware integrated logic circuits in a processor or by software instructions. The method steps disclosed in the embodiments of this application can be directly implemented as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0450] The present application also provides an electronic device, which may include: a memory and a processor, wherein the memory may be used to store a computer program; and the processor may be used to call the computer program in the memory so that the electronic device executes the method in any one of the above embodiments.

[0451] The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the method executed by the electronic device in any of the above embodiments.

[0452] In one possible design, the chip system further includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.

[0453] The chip system can be composed of chips, or can include chips and other discrete devices.

[0454] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0455] Optionally, the memory in the chip system may be one or more. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in the embodiments of the present application. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or provided on different chips. The embodiments of the present application do not specifically limit the type of memory or the configuration of the memory and the processor.

[0456] Exemplarily, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0457] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute the method executed by the electronic device in any of the above embodiments.

[0458] The present application also provides a computer-readable storage medium storing a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the electronic device in any of the above embodiments.

[0459] The various implementation modes of this application can be combined arbitrarily to achieve different technical effects.

[0460] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described herein are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive).

[0461] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0462] In short, the above description is only an embodiment of the technical solution of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of the present invention should be included in the scope of protection of the present invention.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. A charging method, characterized in that: Applied to an electronic device, the electronic device includes one or more universal serial bus (USB) interfaces, the electronic device is connected to a first external device via a first USB interface among the one or more USB interfaces, the method includes: sending a first message to the first external device through the first USB interface, wherein the first message includes a charging power that the electronic device supports outputting to the first external device; receiving a request for a charging power of a first specification from the first external device, wherein the charging power of the first specification belongs to the charging power supported by the electronic device to output to the first external device; Outputting the charging power of the first specification to the first external device through the first USB interface; receiving a request for a charging power of a second specification from the first external device, wherein the charging power of the second specification includes the charging power of the highest charging gear that the first external device can receive, the charging power of the second specification belongs to the charging power that the electronic device supports to output to the first external device, and the charging power of the second specification is greater than the charging power of the first specification; The charging power of the second specification is output to the first external device through the first USB interface.

2. The method according to claim 1, characterized in that The electronic device further comprises a switch switching circuit and a processor, wherein the switch switching circuit corresponds to the one or more USB interfaces, and the switch switching circuit connects the processor and a short-circuited 0 ohm resistor.

3. The method according to claim 1, characterized in that The outputting the second-specification charging power to the first external device through the first USB interface includes: When it is determined that the system of the electronic device is not in a working state and / or the battery power of the electronic device is greater than or equal to a preset threshold, the charging power of the second specification is output to the first external device through the first USB interface.

4. The method according to claim 2 or 3, characterized in that: The electronic device is connected to a second external device through a second USB interface among the one or more USB interfaces, and the outputting the second-specification charging power to the first external device through the first USB interface includes: When it is determined that the second external device located at the second USB interface is not charging the electronic device, the charging power of the second specification is output to the first external device through the first USB interface.

5. The method according to claim 2, characterized in that: The switch switching circuit is used to connect the first USB interface and the processor, and after outputting the first specification of charging power to the first external device through the first USB interface and before receiving a request for a second specification of charging power from the first external device, further includes: Receiving a fast charging request from the first external device; In response to the fast charge request, control the switch circuit from connecting to the processor to connecting to the 0 ohm resistance; The first USB interface performs protocol interaction with the first external device to determine that the electronic device is a dedicated charging port DCP end.

6. The method according to claim 5, characterized in that The electronic device is connected to a second external device via a second USB interface among the one or more USB interfaces, and the receiving a fast charging request from the first external device includes: When it is determined that the second external device located at the second USB interface is not charging the electronic device, a fast charging request from the first external device is received.

7. The method according to claim 2, characterized in that When the switch circuit connects the first USB interface and the 0-ohm resistor, the electronic device is a DCP terminal.

8. The method according to claim 7, characterized in that The electronic device is connected to a second external device through a second USB interface among the one or more USB interfaces, and the outputting the second-specification charging power to the first external device through the first USB interface includes: When it is determined that the second external device located at the second USB interface is not charging the electronic device, the charging power of the second specification is output to the first external device through the first USB interface.

9. The method according to claim 2, characterized in that: After outputting the second-specification charging power to the first external device through the first USB interface, the method further includes: receiving a request for a charging power of a third specification from the first external device; The voltage and current are adjusted according to the request for the charging power of the third specification, and the voltage and current corresponding to the request for the charging power of the third specification are output.

10. The method according to claim 1 or 2, characterized in that: The electronic device includes one or more of a power transmission module, a control unit, and a power supply module, and outputting the second-specification charging power to the first external device through the first USB interface includes: Turning on the active OTG function of the power module by the control unit; Turning on a second switch of the power module through the power transmission module, wherein the second switch is used to connect the first USB interface and a charger chip in the power module, and the charger chip in the power module is used to provide the charging power of the second specification; Based on the OTG function and the second switch being in the on state, the charging power of the second specification is output to the first external device through the first USB interface.

11. An electronic device, characterized in that: The electronic device comprises one or more of one or more USB interfaces, a power transmission module, a control unit, and a power supply module, wherein the electronic device is connected to a first external device through a first USB interface among the one or more USB interfaces, The power transmission module is configured to send a first message to the first external device through the first USB interface, wherein the first message includes a charging power that the electronic device supports outputting to the first external device; The power transmission module is configured to receive a request for a charging power of a first specification from the first external device through the first USB interface, wherein the charging power of the first specification belongs to the charging power that the electronic device supports to output to the first external device; The control unit is used to control the power module to output a charging power of a first specification; The power transmission module is used to output the charging power of the first specification to the first external device through the first USB interface; The power transmission module is further configured to receive a request for a second specification of charging power from the first external device through the first USB interface, wherein the second specification of charging power includes a charging power of a highest charging gear that can be received by the first external device, the second specification of charging power belongs to the charging power supported by the electronic device to output to the first external device, and the second specification of charging power is greater than the first specification of charging power; The control unit is used to control the power module to output a charging power of a second specification; The power transmission module is used to output the charging power of the second specification to the first external device through the first USB interface.

12. The electronic device according to claim 11, characterized in that: The electronic device further comprises a switch switching circuit and a processor, wherein the switch switching circuit corresponds to the one or more USB interfaces, and the switch switching circuit connects the processor and a short-circuited 0 ohm resistor.

13. An electronic device, characterized in that: The electronic device comprises: one or more USB interfaces, one or more processors; and a memory; wherein the USB interface is used to establish a connection with a device, the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions so that the electronic device executes the method as described in any one of claims 1 to 10.

14. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 10.

15. A computer program product comprising instructions, characterized in that When the computer program product is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 10.

16. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Charging method, electronic device and related device

    CN117254568B

  • Charging circuit, electronic equipment, and charging control method and device

    CN112928787A

  • Charging circuit, electronic equipment and reverse charging method

    CN116707055A

  • Electronic equipment and charging method

    CN116914878A

  • Charging method, electronic equipment and related device

    CN117254568A