Mobile power supplies, data communication control methods, devices, electronic devices and chips

By incorporating a DPDM fast charging communication circuit and a USB data communication circuit into the power bank, and enabling one of these circuits in different modes through a control circuit, the problem of the power bank being unable to simultaneously achieve fast charging and USB data communication is solved. This enables reliable communication mode switching on the same interface, meets the requirements of the new national standard, and reduces hardware costs.

CN123074016APending Publication Date: 2026-11-10ZHUHAI ISMARTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611084357.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing power banks cannot simultaneously achieve fast charging communication and USB data communication, thus failing to meet the information reading requirements of the new national standard for power banks, and integrating a USB host controller is costly.

Method used

A DPDM fast charging communication circuit and a USB data communication circuit are set in the power bank. One of the circuits is enabled in different modes by the control circuit, while the other circuit is controlled to be in a high-impedance state to avoid signal conflict and achieve the coexistence of the two communication modes on the same interface.

Benefits of technology

This technology enables power banks to simultaneously support fast charging and USB data communication on the same USB port, meeting the requirements of the new national standard. It eliminates the need for an additional USB host controller, thus reducing hardware overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123074016A_ABST
    Figure CN123074016A_ABST
Patent Text Reader

Abstract

This application discloses a power bank, a data communication control method, a device, an electronic device, and a chip, belonging to the field of power bank technology. The power bank includes: a Type-C interface; a DPDM fast charging communication circuit connected to the DP and DM pins of the Type-C interface; a USB data communication circuit connected to the DP and DM pins; and a control circuit connected to both the DPDM fast charging communication circuit and the USB data communication circuit. The control circuit is configured to: switch the communication modes of the DP and DM pins in response to a first user input; in fast charging communication mode, enable the DPDM fast charging communication circuit and control the USB data communication circuit to be in a high-impedance state; in USB data communication mode, enable the USB data communication circuit and control the DPDM fast charging communication circuit to be in a high-impedance state. The power bank of this application meets the information reading requirements of the new national standard for power banks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of mobile power technology, and particularly relates to a mobile power supply, a data communication control method, a device, an electronic device, and a chip. Background Technology

[0002] In recent years, power bank safety incidents have occurred frequently, especially in public transportation scenarios, where incidents of power banks spontaneously combusting or emitting smoke have increased significantly, seriously threatening public safety. The new national standard for power banks requires monitoring parameters such as battery voltage and temperature, storing abnormal status information, and allowing users to access relevant data. Traditional power banks' USB interfaces are only used for communication negotiation of fast charging protocols. Some power banks with integrated USB data communication functions require an integrated USB host controller to establish USB communication with mobile phones, which is more difficult to develop and has higher hardware costs, making it impossible to meet the new national standard requirements for power banks in a low-cost manner. Summary of the Invention

[0003] This invention aims to solve at least one of the technical problems existing in the prior art. To this end, this invention proposes a power bank, a data communication control method, a device, an electronic device, and a chip, enabling the power bank to achieve fast charging functionality through a DPDM fast charging communication circuit and USB protocol data communication through a USB data communication circuit, thereby meeting the information reading requirements of the new national standard for power banks.

[0004] In a first aspect, this application provides a portable power bank, comprising: Type-C interface; The DPDM fast charging communication circuit is connected to the DP and DM pins of the Type-C interface for fast charging protocol communication. The USB data communication circuit is connected to the DP pin and the DM pin and is used for USB protocol data communication. The control circuit is connected to both the DPDM fast charging communication circuit and the USB data communication circuit, and the control circuit is configured as follows: In response to the user's first input, the communication modes of the DP pin and the DM pin are switched; In fast charging communication mode, the DPDM fast charging communication circuit is enabled, and the USB data communication circuit is controlled to be in a high-impedance state. In USB data communication mode, the USB data communication circuit is enabled, and the DPDM fast charging communication circuit is controlled to be in a high-impedance state.

[0005] According to the power bank provided in this application embodiment, by simultaneously setting a DPDM fast charging communication circuit and a USB data communication circuit in the power bank, and connecting both to the DP pin and DM pin of the same Type-C interface, the coexistence of DPDM fast charging communication and USB data communication functions on the same USB interface of the power bank is realized. The communication mode is switched in response to the user's first input by the control circuit, and the other mode is controlled to be in a high-impedance state when one mode is enabled. This avoids the signal conflict problem caused by two circuits driving the same DP pin and DM pin at the same time, and ensures the reliable implementation of the two communication modes on the same interface. This allows the power bank to realize fast charging function through the DPDM fast charging communication circuit and USB protocol data communication through the USB data communication circuit, thereby meeting the requirements of the new national standard for power banks for information reading.

[0006] In one embodiment of the mobile power supply of this application, the control circuit is further configured as follows: In the USB data communication mode, USB PD communication is established with the peer device of the power bank through the Type-C interface; Send a data role switching message to the peer device so that the power bank acts as a USB slave in the data role and as a power supply device in the power supply role.

[0007] In one embodiment of the mobile power supply of this application, the control circuit is further configured as follows: After entering the USB data communication mode, and before sending the data role switching message, the Type-C interface is controlled to actively disconnect and re-establish the connection after a preset time. The control circuit is also configured to: During initialization, the DP pin and the DM pin are configured by default to the fast charging communication mode.

[0008] One embodiment of the portable power bank of this application includes a USB data communication circuit comprising: A differential receiver, wherein the two input terminals of the differential receiver are respectively connected to the DP pin and the DM pin, for receiving differential signals and converting them into digital signals; A first single-ended receiver, the input of which is connected to the DP pin, is used to detect the absolute level state of the DP pin; A second single-ended receiver, the input of which is connected to the DM pin, is used to detect the absolute level state of the DM pin; A first differential driver is connected to the DP pin and is used to drive the DP pin to send differential communication signals; The second differential driver is connected to the DM pin and is used to drive the DM pin to send differential communication signals; A first pull-up resistor, one end of which is connected to the power supply; A first switch, the other end of the first pull-up resistor is connected to the DP pin through the switch; The USB data communication circuit is also configured to: When the USB data communication circuit is off, the first differential driver and the second differential driver are in a high-impedance state, and the first switch is open.

[0009] One embodiment of the portable power bank in this application further includes: The CC connection circuit is connected to the CC1 and CC2 pins of the Type-C interface and is used to perform at least one of the following operations: Type-C connection detection, connection direction determination, and role recognition. The PD communication circuit is connected to the CC pin when it is in the connected state and is used for PD protocol communication.

[0010] In one embodiment of this application, the mobile power supply includes a CC connection circuit comprising: The first current source and the second switch are connected in series between the power supply and the CC1 pin; The second current source and the third switch are connected in series between the power supply and the CC2 pin; The first pull-down resistor and the fourth switch are connected in series between the CC1 pin and ground. The second pull-down resistor and the fifth switch are connected in series between the CC2 pin and ground. A first comparator, wherein the positive input terminal of the first comparator is used to receive a first reference voltage; The second comparator, the negative input of the second comparator is used to receive the second reference voltage; A switching switch is used to select, in a time-division manner, whether the CC1 pin or the CC2 pin is connected to the negative input terminal of the first comparator and the positive input terminal of the second comparator; The AND gate is configured such that the output of the first comparator is connected to the first input of the AND gate, the output of the second comparator is connected to the second input of the AND gate, and the output of the AND gate outputs a connection indication signal.

[0011] One embodiment of the portable power bank in this application further includes: A charging and discharging circuit is connected to the VBUS pin of the Type-C interface. When the power bank is used as a power receiving device, it draws power from the VBUS pin to charge the battery of the power bank. When the power bank is used as a power supply device, it discharges power to the outside through the VBUS pin.

[0012] A portable power bank according to one embodiment of this application further includes a button detection circuit; the button detection circuit includes: The second pull-up resistor is connected between the KEY pin and the power supply. A Schmitt inverter, the input of which is connected to the KEY pin; An inverter, the input of which is connected to the output of the Schmitt inverter; A debouncing circuit, wherein the input terminal of the debouncing circuit is connected to the output terminal of the inverter; A key action recognition circuit is provided, wherein the input terminal of the key action recognition circuit is connected to the output terminal of the debounce circuit, and is used to recognize the user's first input and output the recognition result to the control circuit.

[0013] Secondly, this application provides a data communication control method based on the mobile power supply as described in the first aspect, comprising: Configure the DP and DM pins of the Type-C interface to fast charging communication mode, enable the DPDM fast charging communication circuit, and control the USB data communication circuit to be in a high-impedance state. In response to the user's first input, the DP pin and the DM pin are switched to USB data communication mode, enabling the USB data communication circuit and controlling the DPDM fast charging communication circuit to be in a high-impedance state. In the USB data communication mode, USB PD communication is established with the peer device of the power bank; Send a data role switching message to the peer device so that the power bank acts as a USB slave in the data role and as a power supply device in the power supply role.

[0014] According to the data communication control method provided in the embodiments of this application, by default configuring the DP and DM pins to fast charging communication mode, switching to USB data communication mode in response to user input, establishing USB PD communication in USB data communication mode and sending a data role switching message, the reliable switching of the power bank from fast charging mode to data mode and data communication as a USB slave in data mode are realized. This enables the two functions of DPDM fast charging communication and USB data communication to be realized on the same USB interface of the power bank without the need to set up a USB host controller, thus reducing hardware overhead.

[0015] One embodiment of the data communication control method of this application is characterized in that, After switching the DP pin and the DM pin to USB data communication mode, the method further includes: When the Type-C interface is in a powered connection state, the Type-C interface is controlled to disconnect, and after maintaining the connection for a preset time, the connection is re-established to perform the steps of establishing USB PD communication; If the Type-C interface is not in the power supply connection state and an operation to exit USB data communication mode is detected, the DP pin and the DM pin will be reconfigured to fast charging communication mode. If the Type-C interface is not in the power supply connection state and no operation to exit the USB data communication mode is detected, the USB data communication mode is maintained. After the power bank acts as a USB slave and establishes USB PD communication with the peer device, the following is also included: Upon detecting an operation to exit USB data communication mode, the DP pin and the DM pin are reconfigured for fast charging communication mode; If no action to exit USB data communication mode is detected and the Type-C interface is disconnected, the USB data communication mode shall be maintained. If no action to exit USB data communication mode is detected and the Type-C interface is not disconnected, USB data communication with the peer device is maintained.

[0016] Thirdly, this application provides a data communication control device based on the mobile power supply as described in the first aspect, comprising: The first processing module is used to configure the DP pin and DM pin of the Type-C interface to fast charging communication mode, enable the DPDM fast charging communication circuit, and control the USB data communication circuit to be in a high-impedance state. The second processing module is used to switch the DP pin and the DM pin to USB data communication mode in response to the user's first input, enable the USB data communication circuit, and control the DPDM fast charging communication circuit to be in a high-impedance state. The third processing module is used to establish USB PD communication with the peer device of the power bank in the USB data communication mode. The fourth processing module is used to send a data role switching message to the peer device so that the power bank acts as a USB slave in the data role and as a power supply device in the power supply role.

[0017] According to the data communication control device provided in the embodiments of this application, by default configuring the DP and DM pins to fast charging communication mode, switching to USB data communication mode in response to user input, establishing USB PD communication in USB data communication mode and sending data role switching messages, the power bank can reliably switch from fast charging mode to data mode and perform data communication as a USB slave in data mode. This enables both DPDM fast charging communication and USB data communication functions to be implemented on the same USB interface of the power bank, eliminating the need to set up a USB host controller and reducing hardware overhead.

[0018] Fourthly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data communication control method for a mobile power supply as described in the second aspect above.

[0019] Fifthly, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the data communication control method for a mobile power supply as described in the second aspect.

[0020] The above-described one or more technical solutions in the embodiments of this application have at least one of the following technical effects: By simultaneously incorporating a DPDM fast charging communication circuit and a USB data communication circuit within the power bank, and connecting both to the DP and DM pins of the same Type-C interface, the coexistence of DPDM fast charging communication and USB data communication functions on the same USB interface of the power bank is achieved. The control circuit switches the communication mode in response to the user's first input, and controls the other mode to a high-impedance state when one mode is enabled. This avoids signal conflicts caused by two circuits simultaneously driving the same DP and DM pins, ensuring reliable implementation of both communication modes on the same interface. This allows the power bank to achieve fast charging via the DPDM fast charging communication circuit and USB protocol data communication via the USB data communication circuit, thus meeting the information reading requirements of the new national standard for power banks.

[0021] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0022] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1This is one of the structural schematic diagrams of the mobile power supply provided in the embodiments of this application; Figure 2 This is a second schematic diagram of the structure of the mobile power supply provided in the embodiments of this application; Figure 3 This is the third structural schematic diagram of the mobile power supply provided in the embodiments of this application; Figure 4 This is one of the signal waveform diagrams of the mobile power supply provided in the embodiments of this application; Figure 5 This is the fourth structural schematic diagram of the mobile power supply provided in the embodiments of this application; Figure 6 This is the second schematic diagram of the signal waveform of the mobile power supply provided in the embodiments of this application; Figure 7 This is the fifth structural schematic diagram of the mobile power supply provided in the embodiments of this application; Figure 8 This is the sixth structural schematic diagram of the mobile power supply provided in the embodiments of this application; Figure 9 This is the seventh structural schematic diagram of the mobile power supply provided in the embodiments of this application; Figure 10 This is the eighth schematic diagram of the structure of the mobile power supply provided in the embodiments of this application; Figure 11 This is the third schematic diagram of the signal waveform of the mobile power supply provided in the embodiments of this application; Figure 12 This is one of the flowcharts illustrating the data communication control method provided in the embodiments of this application; Figure 13 This is a second schematic flowchart of the data communication control method provided in the embodiments of this application; Figure 14 This is a schematic diagram of the data communication control device provided in the embodiments of this application; Figure 15 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application.

[0023] Figure label: 1. DPDM fast charging communication circuit; Protocol handshake detection circuit 11; 2. USB data communication circuit; RxD, differential receiver; RxDP, first single-ended receiver; RxDM, second single-ended receiver; TxDP, first differential driver; TxDM, second differential driver; R1, first pull-up resistor; S1, first switch; 3. Control circuit; 4. CC connection circuit; Ip1, first current source; S2, second switch; Ip2, second current source; S3, third switch; Rd1, first pull-down resistor; S4, fourth switch; S5, fifth switch; Rd2, second pull-down resistor; CMP1, first comparator; CMP2, second comparator; K1, toggle switch; AND, AND gate; 5. PD communication circuit; 51. BMC encoding / decoding circuit; 6. Charging and discharging circuit; 7. Key detection circuit; R2, second pull-up resistor; SMITINV, Schmitt inverter; INV, inverter; 71. Debouncing circuit; 72. Key action recognition circuit. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0025] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0026] The mobile power supply, data communication control method, electronic device, and readable storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0027] like Figure 1 As shown, this application embodiment provides a portable power bank, including: Type-C interface; DPDM fast charging communication circuit 1 is connected to the DP and DM pins of the Type-C interface for fast charging protocol communication; USB data communication circuit 2, connected to the DP pin and DM pin, is used for USB protocol data communication; Control circuit 3 is connected to DPDM fast charging communication circuit 1 and USB data communication circuit 2 respectively. Control circuit 3 is configured as follows: In response to the user's first input, switch the communication mode of the DP pin and the DM pin; In fast charging communication mode, enable DPDM fast charging communication circuit 1 and control USB data communication circuit 2 to be in a high-impedance state. In USB data communication mode, enable USB data communication circuit 2 and control DPDM fast charging communication circuit 1 to be in a high-impedance state.

[0028] In this embodiment, the power bank is a portable, rechargeable power supply device that can provide power to external electronic devices (such as mobile phones, tablets, etc.). It typically includes a rechargeable battery (such as a lithium-ion battery or a lithium polymer battery), a charge and discharge management circuit, and related control circuits.

[0029] The Type-C interface is a physical interface that conforms to the USB Type-C standard specification. It contains multiple pins, including the DP and DM pins for data transmission, the CC1 and CC2 pins for Type-C connection detection and role recognition, the VBUS pin for power supply, and the GND pin for ground.

[0030] The DPDM fast charging communication circuit 1 is a circuit module used to implement fast charging protocol communication. It is connected to the DP and DM pins of the Type-C interface. DP is the D+ data line pin in the USB interface, and DM is the D- data line pin in the USB interface. The DPDM fast charging communication circuit 1 uses the DP and DM pins as signal transmission channels to achieve fast charging between the power bank and external devices through handshaking and communication negotiation of the fast charging protocol. The fast charging protocol may include, but is not limited to, the domestic converged fast charging UFCS protocol, Qualcomm's QC (Quick Charge) protocol, and other proprietary fast charging protocols defined by other manufacturers.

[0031] like Figure 8As shown, in some embodiments, the DPDM fast charging communication circuit 1 includes: a protocol handshake detection circuit 11, a transmitting circuit TX, a receiving circuit RX, a protocol layer, and an application layer. The protocol handshake detection circuit 11 is connected to the DM pin and is used to identify the set pulse sequence sent by the powered device to perform a UFCS protocol handshake. The output of the transmitting circuit TX is connected to the DP pin and is used to drive the DP pin to transmit protocol data. The input of the receiving circuit RX is connected to the DM pin and is used to identify and receive data signals on the DM pin. The protocol handshake detection circuit 11, the transmitting circuit TX, and the receiving circuit RX constitute the physical layer, all of which are connected to the protocol layer. The other end of the protocol layer is connected to the application layer. The protocol layer enables communication between the power supply device and the powered device, facilitating information exchange. The protocol layer provides a command and data transmission interface for the application layer and passes the received commands and data to the application layer for processing. The physical layer, protocol layer, and application layer work together to realize DPDM fast charging communication.

[0032] The transmitting circuit TX of the DPDM fast charging communication circuit 1 is enabled or disabled by the OE (Output Enable) signal: when OE is 1, the transmitting circuit TX drives the DP pin, and the DPDM fast charging communication circuit 1 works normally; when OE is 0, the transmitting circuit TX is configured to output high impedance and does not drive the DP pin. At this time, the DPDM fast charging communication circuit 1 is electrically disconnected from the DP pin and DM pin, and will not cause signal interference to other circuits on these two pins.

[0033] USB data communication circuit 2 is a circuit module used to implement USB protocol data communication, and it is connected to the DP and DM pins. USB data communication circuit 2 uses the DP and DM pins as data transmission channels to achieve USB protocol data communication between the power bank and external devices. Specifically, USB data communication circuit 2 can be used for sending and receiving communication signals in USB 2.0 full-speed mode. USB data communication circuit 2 is enabled or disabled by the OE signal: when OE is 1, USB data communication circuit 2 operates normally; when OE is 0, USB data communication circuit 2 outputs a high-impedance state and does not drive the DP and DM pins.

[0034] Control circuit 3 is connected to DPDM fast charging communication circuit 1 and USB data communication circuit 2, respectively. Control circuit 3 can be implemented by microcontroller unit (MCU), digital signal processor (DSP), field-programmable gate array (FPGA), application-specific integrated circuit (ASIC), or other chips with processing capabilities. Control circuit 3 controls the operating state of DPDM fast charging communication circuit 1 and USB data communication circuit 2 by outputting control signals (such as OE enable signal).

[0035] The user's first input can be an input signal triggered by a key, touch, voice, or other human-computer interaction method. In some embodiments, the user's first input can be a key action, including a long press, a short press, a double press, and other actions or combinations of actions.

[0036] The DP and DM pins support two operating modes: fast charging communication mode and USB data communication mode. In fast charging communication mode, the DP and DM pins are used for fast charging protocol negotiation; in USB data communication mode, the DP and DM pins are used for USB protocol data transmission. Only one mode can be active at any given time, and switching between them enables the multiplexing of the DP and DM pin functions.

[0037] In fast charging communication mode, the DP and DM pins are configured for fast charging protocol communication. In fast charging communication mode, the DPDM fast charging communication circuit 1 is enabled (i.e., operates normally), while the USB data communication circuit 2 is disabled.

[0038] In USB data communication mode, the DP and DM pins are configured for USB protocol data communication. In this mode, USB data communication circuit 2 is enabled (i.e., operates normally), while DPDM fast charging communication circuit 1 is disabled.

[0039] During the research and development process, the inventors discovered that the DP and DM pins of the power bank in the relevant technology are only used for fast charging communication and cannot perform USB data communication. If the USB data communication function is to be added, the two circuits will cause signal conflict when connected to the same pin at the same time.

[0040] In this application, a DPDM fast charging communication circuit 1 and a USB data communication circuit 2 are simultaneously incorporated within the power bank. Both are connected to the same DP and DM pins. However, a control circuit 3 enables one circuit in different modes while simultaneously controlling the other circuit to be in a high-impedance state, i.e., electrically disconnected from the pin. This ensures that the two circuits do not simultaneously drive the same pin, preventing signal conflicts. In this way, the power bank simultaneously possesses both fast charging and USB data communication capabilities on the same Type-C interface, and can switch between them via a single user input. This meets the requirement of the new national standard for power banks to read internal data via wired connection, without the need for additional interfaces.

[0041] According to the power bank provided in this application embodiment, by simultaneously setting a DPDM fast charging communication circuit 1 and a USB data communication circuit 2 in the power bank, and connecting both to the DP pin and DM pin of the same Type-C interface, the coexistence of DPDM fast charging communication and USB data communication functions on the same USB interface of the power bank is realized. The communication mode is switched in response to the user's first input by the control circuit 3, and the other mode is controlled to be in a high-impedance state when one mode is enabled. This avoids the signal conflict problem caused by two circuits driving the same DP pin and DM pin at the same time, and ensures the reliable implementation of the two communication modes on the same interface. This allows the power bank to realize fast charging function through the DPDM fast charging communication circuit 1 and USB protocol data communication through the USB data communication circuit 2, thereby meeting the requirements of the new national standard for power banks for information reading.

[0042] In some embodiments, the control circuit 3 may also be configured as follows: During initialization, the DP and DM pins are configured to fast charging communication mode by default.

[0043] In this embodiment, initialization refers to the initialization phase performed by the control circuit 3 (such as an MCU or other control chip) after power-on reset and before it begins normal operation. Specifically, this includes: after the power bank is powered on (e.g., after the battery is connected, the system establishes power supply after the protection board is activated), the control circuit 3 is released from its reset state and begins to perform operations such as internal register configuration, GPIO (General Purpose Input / Output) direction setting, and initial state setting of each functional module. During this stage, the control circuit 3 has not yet responded to any user input, nor has it engaged in any communication or interaction with external devices. In this embodiment, initialization can be the initialization phase after the control circuit 3 is powered on and reset.

[0044] Without any user input or external triggering conditions, control circuit 3 automatically sets the DP and DM pins to a predetermined initial operating state. The default configuration is a setting action that is automatically executed by control circuit 3 after power-on and can be completed without any user operation.

[0045] In actual operation, the power bank automatically enters fast charging mode after being powered on. At this time, the user can directly fast charge the device by plugging it in. If the user needs to read the data inside the power bank, he can switch to data mode by pressing the button to complete the reading. After reading, the user can return to fast charging mode by pressing the button again or replugging the cable.

[0046] According to the power bank provided in the embodiments of this application, by configuring the DP pin and DM pin to fast charging communication mode by default during initialization, it is ensured that the power bank can directly communicate with the fast charging protocol without any user operation after being powered on. Users can get a fast charging experience simply by plugging in the other end device, which is in line with the conventional usage habits and user expectations of power banks as charging devices. Moreover, the default configuration provides a definite starting state for subsequent response to user input to switch to USB data communication mode, making the entire mode switching logic complete and clear.

[0047] In some embodiments, the control circuit 3 is further configured as follows: In USB data communication mode, USB PD communication is established with the peer device of the power bank through the Type-C interface; Send a data role switching message to the peer device so that the power bank acts as a USB slave in the data role and as a power supply device in the power supply role.

[0048] In this embodiment, the peer device is an external device connected to the power bank via a Type-C interface. This external device can be a mobile phone, tablet computer, laptop computer, or other electronic device with a Type-C interface that supports USB PD communication.

[0049] In USB data communication mode, the power bank and the peer device establish a communication connection according to the USB PD (USB Power Delivery) protocol specification via the CC pin (in connected state) of the Type-C interface. USB PD is a communication protocol that transmits data through the CC pin of the Type-C interface, supporting various functions such as power supply capability negotiation and data role switching between devices. The specific process of establishing USB PD communication can include: the PD communication circuit 5 of the power bank converts the digital signal encoded by BMC into an analog signal according to the electrical characteristics of the transmission through the transmitting circuit TX and transmits it to the CC pin. The peer device receives the signal through its CC pin and decodes it; at the same time, the response signal of the peer device is also transmitted through the CC pin to the receiving circuit RX of the PD communication circuit 5 of the power bank. The receiving circuit RX recovers the BMC analog signal received on the CC pin into a digital signal and sends it to the BMC encoding and decoding circuit 51 for decoding, thereby completing the establishment of bidirectional communication.

[0050] Data role switching messages, defined in the USB PD protocol, are used to negotiate and change USB data roles; specifically, they are DR_Swap (Data Role Swap) messages. In USB communication, data roles fall into two categories: USB Host (or downstream port) and USB Device (or upstream port). The USB Host initiates and manages data communication, responsible for managing data transfer on the USB bus; the USB Device responds passively to requests from the Host. By sending a data role switching message, the two communicating parties can negotiate and exchange their respective data roles.

[0051] After the data role switch, the power bank acts as a slave in USB data communication. That is, the power bank no longer acts as a USB host to manage and initiate data transfers, but instead passively responds to data requests from the USB host. This allows the power bank to provide its internally stored information (such as battery voltage, temperature, and abnormal status records) to the USB host device as a slave, without needing to integrate a complex USB host controller.

[0052] In USB PD, a power bank acts as a Source (power supply device), meaning it provides power to the peer device by outputting voltage through the VBUS pin of its Type-C interface. In the USB PD protocol, the power supply role (Source / Sink) and the data role (Host / Device) are two independent concepts that can be configured separately.

[0053] According to the embodiments of this application, the power bank establishes USB PD communication in USB data communication mode and sends a data role switching message, so that the power bank can switch to USB slave in data role while maintaining the role of power supply device. This avoids integrating a complex and costly USB host controller into the power bank, reducing the complexity of the power bank's USB data communication system design and hardware overhead. In addition, during USB data communication, the power bank acts as the power supply device and the peer device acts as the power receiving device. The peer device can receive power from the power bank while obtaining the internal information of the power bank through the USB data communication protocol, which improves the user experience.

[0054] In some embodiments, the control circuit 3 is further configured as follows: After entering USB data communication mode, and before sending the data role switching message, control the Type-C interface to actively disconnect and re-establish the connection after a preset duration.

[0055] In this embodiment, the control circuit 3 can actively disconnect the pull-up resistor or pull-up current source of the CC pin by controlling the CC connection circuit 4, so that there is no pull-up voltage on the CC pin of the Type-C interface, thereby causing the Type-C connection to be disconnected.

[0056] The preset duration is a pre-defined time period during which the power bank keeps the Type-C interface disconnected. The preset duration can be 1 second or other suitable time periods.

[0057] After a preset period of disconnection, control circuit 3 re-enables the pull-up resistor or pull-up current source of the CC pin, causing the Type-C interface to re-establish the Source connection state.

[0058] According to the mobile power supply provided in the embodiments of this application, after entering the USB data communication mode and before sending the data role switching message, the Type-C interface is actively controlled to disconnect and re-establish the connection after a preset time. The hot-plug mechanism in the Type-C specification forces the peer device to re-enumerate the USB when reconnecting, which ensures that the data role switching message can be processed at the correct time and improves the success rate and reliability of data role switching.

[0059] like Figure 9 As shown, in some embodiments, the USB data communication circuit 2 includes: The differential receiver RxD has two input terminals connected to the DP pin and the DM pin, respectively, to receive differential signals and convert them into digital signals. The first single-ended receiver RxDP has its input connected to the DP pin and is used to detect the absolute level state of the DP pin. The second single-ended receiver RxDM has its input connected to the DM pin and is used to detect the absolute level state of the DM pin. The first differential driver TxDP is connected to the DP pin and is used to drive the DP pin to send differential communication signals. The second differential driver TxDM is connected to the DM pin and is used to drive the DM pin to send differential communication signals; The first pull-up resistor R1, one end of which is connected to the power supply; The first switch S1 and the other end of the first pull-up resistor R1 are connected to the DP pin via the switch.

[0060] In this embodiment, the differential receiver RxD is an electronic circuit for receiving differential signals. The differential receiver RxD has two input terminals, which are connected to the DP pin and the DM pin, respectively.

[0061] The differential receiver RxD converts the differential signals received from the DP and DM pins into digital signals. Differential signaling uses the voltage difference between two signal lines (DP and DM) to represent information. When the voltage on the DP pin is higher than the voltage on the DM pin, the digital signal RxDdata output by the differential receiver RxD is 1; when the voltage on the DM pin is higher than the voltage on the DP pin, the digital signal RxDdata output by the differential receiver RxD is 0. The differential receiver RxD restores the analog differential signals received from the DP and DM pins into digital signals for subsequent digital circuit processing.

[0062] Single-ended receivers are used to detect idle status, reset status, signal level validity, and speed identification on the bus.

[0063] The first single-ended receiver RxDP is an electronic circuit used to detect the level of a single-ended signal, and its input is connected to the DP pin. The first single-ended receiver RxDP is used to detect the absolute level state of the DP pin. When the voltage of the DP pin is higher than a specific voltage threshold, the first single-ended receiver RxDP outputs a single-ended 1 (i.e., RxDPdata=1); when the voltage of the DP pin is lower than the specific voltage threshold, the first single-ended receiver RxDP outputs a single-ended 0 (i.e., RxDPdata=0).

[0064] The second single-ended receiver RxDM is an electronic circuit used to detect the level of a single-ended signal. Its input is connected to the DM pin. The second single-ended receiver RxDM is used to detect the absolute level state of the DM pin. When the voltage of the DM pin is higher than a specific voltage threshold, the second single-ended receiver RxDM outputs a single-ended 1 (i.e., RxDMdata=1); when the voltage of the DM pin is lower than the specific voltage threshold, the second single-ended receiver RxDM outputs a single-ended 0 (i.e., RxDMdata=0). The second single-ended receiver RxDM, used in conjunction with the first single-ended receiver RxDP, can detect the complete level states of the DP and DM pins.

[0065] A differential driver is an electronic circuit used to transmit differential signals. The first differential driver, TxDP, is connected to the DP pin and drives the DP pin to transmit differential communication signals. The second differential driver, TxDM, is connected to the DM pin and drives the DM pin to transmit differential communication signals. In other words, it can convert the digital signal to be transmitted into differential voltage signals on the DP and DM pins.

[0066] The differential driver is enabled or disabled via an OE (Output Enable) signal: when OE is 1, the differential driver normally drives the DP and DM pins to transmit differential signals; when OE is 0, the differential driver is in a high-impedance output state and does not drive the DP and DM pins.

[0067] The first pull-up resistor R1 may be a resistor with a resistance value of 1.5kΩ, one end of which is connected to a power supply (the power supply voltage VDD may range from 3.0V<VDD<3.6V). The first pull-up resistor R1 is configured to implement connection detection between master and slave devices and identification of the USB 2.0 full-speed mode in USB communication.

[0068] One end of the first switch S1 is connected to the other end of the first pull-up resistor R1, and the other end is connected to the DP pin. The control terminal of the first switch S1 is connected to the control circuit 3, and the control circuit 3 controls it to close or open.

[0069] In some embodiments, the USB data communication circuit 2 is further configured to: When the USB data communication circuit 2 is disabled, the first differential driver TxDP and the second differential driver TxDM are in a high-impedance state, and the first switch S1 is open.

[0070] In this embodiment, when the mobile power supply is currently in the fast charging communication mode, the USB data communication circuit 2 is not enabled, that is, the OE signal output by the control circuit 3 to the USB data communication circuit 2 is in a state of 0 (invalid).

[0071] When the OE signal is 0, the output terminals of the first differential driver TxDP and the second differential driver TxDM in the USB data communication circuit 2 present a high-impedance state, which neither drives the DP and DM pins to a high level nor drives the DP and DM pins to a low level, equivalent to being electrically disconnected from the DP and DM pins.

[0072] After the first switch S1 is opened, the electrical connection between the 1.5kΩ pull-up resistor and the DP pin is cut off, and the pull-up resistor no longer has any influence on the voltage of the DP pin.

[0073] In the present application, complete electrical isolation of the USB data communication circuit 2 when it is disabled is realized, so that the DPDM fast charging communication circuit 1 can exclusively use the DP and DM pins for fast charging protocol communication without any interference.

[0074] As Figure 1 shown, in some embodiments, the mobile power supply may further include: A CC connection circuit 4, connected to the CC1 pin and the CC2 pin of the Type-C interface, configured to perform at least one of Type-C connection detection, connection direction judgment and role identification; PD communication circuit 5 is connected to the CC pin in the connected state and is used for PD protocol communication.

[0075] In this embodiment, the CC connection circuit 4 is a circuit module used to implement Type-C interface connection detection and related functions, and it is connected to the CC1 and CC2 pins of the Type-C interface. CC (Configuration Channel) is a signal channel in the Type-C interface used for connection detection, direction determination, role recognition, and power supply capability negotiation.

[0076] CC connection circuit 4 can determine whether an external device has been connected to the Type-C interface of the power bank via a Type-C cable by detecting voltage changes on the CC1 and CC2 pins.

[0077] CC connection circuit 4 can determine the insertion direction (positive or negative) of the USB Type-C cable by detecting which pin on the CC1 and CC2 pins has established a connection with an external device.

[0078] CC connection circuit 4 can identify whether the power bank should currently act as a source or a sink by detecting the voltage levels on the CC1 and CC2 pins and the type of the peer device connected to them.

[0079] PD communication circuit 5 is a circuit module used to implement USB PD protocol communication, and it is connected to the CC pin in the connected state. The CC pin in the connected state is the CC pin that has established an electrical connection with the Rd or Rp resistor of the peer device between the CC1 and CC2 pins.

[0080] like Figure 7 As shown, the PD communication circuit 5 may include a transmitting circuit TX, a receiving circuit RX, a BMC encoding / decoding circuit 51, a protocol layer, and a policy layer.

[0081] The transmitting circuit TX has its input connected to the BMC codec circuit 51 and its output connected to the CC pin (in the connected state). The transmitting circuit TX converts the BMC-encoded digital signal into an analog signal according to the electrical characteristics required for transmission and sends it to the CC pin. The receiving circuit RX has its input connected to the CC pin (in the connected state) and its output connected to the BMC codec circuit 51. The receiving circuit RX recovers the BMC analog signal received on the CC pin into a digital signal and sends it to the BMC codec circuit 51 for decoding. The transmitting circuit TX, the receiving circuit RX, and the BMC codec circuit 51 constitute the physical layer. One end of the protocol layer is connected to the policy layer, and the other end is connected to the BMC codec circuit 51. The protocol layer organizes and deconstructs messages according to the format specified by the protocol, as instructed by the policy layer. The physical layer, protocol layer, and policy layer work together to enable USB PD communication between devices.

[0082] According to the embodiments of this application, the mobile power bank improves the Type-C interface communication capability of the mobile power bank by setting up the CC connection circuit 4 and the PD communication circuit 5, and provides the necessary hardware foundation for the mobile power bank to establish USB PD communication and send data role switching messages in USB data communication mode.

[0083] like Figure 2 As shown, in some embodiments, the CC connection circuit 4 includes: The first current source Ip1 and the second switch S2 are connected in series between the power supply and the CC1 pin; The second current source Ip2 and the third switch S3 are connected in series between the power supply and the CC2 pin; The first pull-down resistor Rd1 and the fourth switch S4 are connected in series between the CC1 pin and ground. The second pull-down resistor Rd2 and the fifth switch S5 are connected in series between the CC2 pin and ground. The positive input of the first comparator CMP1 is used to receive the first reference voltage. The negative input of the second comparator CMP2 is used to receive the second reference voltage. Switch K1 is used to select, in a time-division manner, whether the CC1 pin or the CC2 pin is connected to the negative input of the first comparator CMP1 or the positive input of the second comparator CMP2. The AND gate is configured such that the output of the first comparator CMP1 is connected to the first input of the AND gate, the output of the second comparator CMP2 is connected to the second input of the AND gate, and the output of the AND gate outputs a connection indication signal.

[0084] In this embodiment, the values ​​of the first reference voltage vRd and the second reference voltage vRa can be determined based on the USB Type-CCable and Connector Specification (the official standard specification for the USB Type-C interface), which will not be elaborated here.

[0085] The ATTACH connection indication signal is a digital signal output by the AND gate, used to indicate whether a valid device connection has been detected by the Type-C interface. When the voltage on the CC pin falls within the voltage range greater than the second reference voltage vRa and less than the first reference voltage vRd, the output of the first comparator CMP1 is high, the output of the second comparator CMP2 is also high, both inputs of the AND gate are 1, and the ATTACH signal changes from 0 to 1, indicating that a valid external device connection has been detected.

[0086] It should be noted that the current magnitudes of the first current source Ip1 and the second current source Ip2 are the same, meaning that the circuit structures connected to the CC1 and CC2 pins are symmetrical. In some embodiments, the current values ​​of the first current source Ip1 and the second current source Ip2 are the same, the second switch S2 and the third switch S3 are switching elements of the same specification, the first pull-down resistor Rd1 and the second pull-down resistor Rd2 are resistors with the same resistance value, and the fourth switch S4 and the fifth switch S5 are switching elements of the same specification. This ensures that regardless of whether the Type-C cable is connected in the correct or reverse manner, the CC connection circuit 4 can perform connection detection, direction determination, and role recognition with the same electrical parameters, ensuring the consistency and reliability of the detection results.

[0087] Figure 3 This example illustrates the circuit structure of CC connection circuit 4 for detecting the connection and disconnection of the powered device (Sink). Figure 4 The example illustrates the signal waveforms of the CC connection circuit 4 detecting the connection and disconnection of a powered device (Sink). When the second switch S2 and the third switch S3 are closed, the first current source Ip1 and the second current source Ip2 pull up the CC1 and CC2 pins. At this time, if the Rd resistor of the powered device is connected to the CC1 or CC2 pin, the voltage V_CC of the CC1 or CC2 pin falls into the voltage range greater than vRa and less than vRd, and the ATTACH signal changes from 0 to 1, thus detecting that a powered device is connected. If the Rd resistor of the powered device is disconnected from the CC1 or CC2 pin, the voltage of the CC1 or CC2 pin is greater than vRd, and the ATTACH signal changes from 1 to 0, thus detecting that the powered device is disconnected.

[0088] Figure 5 The example illustrates the circuit structure of CC connection circuit 4 for detecting the connection and disconnection of power supply equipment. Figure 6The example illustrates the signal waveforms of the CC connection circuit 4 detecting the connection and disconnection of a power supply device. When the fourth switch S4 and the fifth switch S5 are closed, the first pull-down resistor Rd1 and the second pull-down resistor Rd2 pull down the CC1 and CC2 pins. At this time, if the power supply device's Rp resistor is connected to the CC1 or CC2 pin, the voltage V_CC at the CC1 or CC2 pin falls within the voltage range greater than vRa and less than vRd, and the ATTACH signal changes from 0 to 1, thus detecting that a power supply device is connected. If the power supply device's Rp resistor is disconnected from the CC1 or CC2 pin, the voltage at the CC1 or CC2 pin is less than vRa, and the ATTACH signal changes from 1 to 0, thus detecting that the power supply device is disconnected.

[0089] like Figure 1 As shown, in some embodiments, the power bank may further include: The charging and discharging circuit 6 is connected to the VBUS pin of the Type-C interface. It is used to draw power from the VBUS pin to charge the battery of the power bank when the power bank is used as a receiving device, and to discharge to the outside through the VBUS pin when the power bank is used as a power supply device.

[0090] In this embodiment, the charging and discharging circuit 6 is a circuit module for managing the charging and discharging process of the power bank battery, and it is connected to the VBUS pin of the Type-C interface. The charging and discharging circuit 6 is responsible for controlling the bidirectional flow of electrical energy between the external device and the internal battery.

[0091] The VBUS (Voltage Bus) pin is used to transmit electrical energy in the Type-C interface. In a Type-C connection, the power supply device (Source) outputs voltage through the VBUS pin, and the power receiving device (Sink) receives electrical energy through the VBUS pin.

[0092] When the power bank is connected to an external power supply device (such as a USB power adapter) via a Type-C interface, the power bank draws power from the external device to charge its internal battery. When the power bank acts as a sink, the charging / discharging circuit 6 draws power from the external power supply device via the VBUS pin of the Type-C interface and stores the power drawn from the VBUS pin into the battery inside the power bank.

[0093] When the power bank is connected to an external powered device (such as a mobile phone) via a Type-C interface, the power bank outputs the electrical energy stored in its internal battery to the external device. When the power bank acts as a power source, the charging and discharging circuit 6 converts the electrical energy from the power bank's internal battery into a voltage suitable for the external device to receive, and outputs it to the external device through the VBUS pin of the Type-C interface.

[0094] like Figure 1 As shown, in some embodiments, the power bank may also include a button detection circuit 7.

[0095] like Figure 10 As shown, the key detection circuit 7 includes: The second pull-up resistor R2 is connected between the KEY pin and the power supply; Schmitt inverter SMITINV, the input of Schmitt inverter SMITINV is connected to the KEY pin; Inverter INV, the input of inverter INV is connected to the output of Schmitt inverter SMITINV; Debouncing circuit 71, the input terminal of debouncing circuit 71 is connected to the output terminal of inverter INV; The input terminal of the key action recognition circuit 72 is connected to the output terminal of the debounce circuit 71, and is used to recognize the user's first input and output the recognition result to the control circuit 3.

[0096] In this embodiment, the key detection circuit 7 is a circuit module used to detect user key operations and identify the type of key action, and it is connected to key K2. The key detection circuit 7 converts the user's physical key operation into an electrical signal, processes the electrical signal to identify the specific key action type (such as short press, long press, double press, etc.), and then outputs the identification result to the control circuit 3.

[0097] The second pull-up resistor R2 is used to pull the KEY pin high when button K2 is not pressed, so that the KEY pin maintains a stable high level in the idle state. When button K2 is pressed, the KEY pin is connected to ground through button K2, and the level of the KEY pin is pulled low.

[0098] The KEY pin is the input pin in the key detection circuit 7 used to connect key K2. One end is connected to the second pull-up resistor R2, and the other end is connected to ground through key K2. Figure 11 As shown, the level state of the KEY pin reflects the pressed or released state of the button K2: when the button K2 is released, the KEY pin is pulled up to a high level by the second pull-up resistor R2; when the button K2 is pressed, the KEY pin is connected to ground through the button K2 and becomes low level.

[0099] The Schmitt inverter SMITINV is an inverter INV circuit with hysteresis characteristics, and its input is connected to the KEY pin. The function of the Schmitt inverter SMITINV is to shape and invert the level signal of the KEY pin. Its hysteresis characteristic can effectively eliminate the jitter caused by the button K2 when it is pressed and released.

[0100] The inverter INV is used to invert the level of the input signal: when the input is high, the output is low, and when the input is low, the output is high.

[0101] The debouncing circuit 71 is used to filter out the brief level jumps caused by the mechanical spring vibration at the moment the button K2 is pressed and released, and to identify a stable pressed state and a stable released state.

[0102] The key action recognition circuit 72 extracts the user's key action type based on the stable press and release state sequence output by the debounce circuit 71, including long press, short press, double press, and other actions or combinations thereof. Typically, a stable press lasting less than 0.3 seconds is defined as a short press, a stable press lasting more than 2 seconds is defined as a long press, and two consecutive short presses within 0.5 seconds are defined as a double press. The key action recognition circuit 72 outputs the identified key action type as the recognition result to the control circuit 3.

[0103] According to the mobile power supply provided in the embodiments of this application, by setting the button detection circuit 7, it can accurately identify different button action types such as long press, short press, and double press, providing a flexible human-computer interaction method.

[0104] This application also provides a data communication control method, which can be applied to the mobile power supply described in any of the above embodiments. The data communication control method can be applied to a terminal, and can be executed by hardware or software within the terminal.

[0105] The data communication control method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the data communication control method. The electronic devices mentioned in this application embodiment include, but are not limited to, power banks, mobile phones, tablets, computers, cameras, and wearable devices.

[0106] like Figure 12 As shown, the data communication control method includes steps S1, S2, S3 and S4.

[0107] Step S1: Configure the DP and DM pins of the Type-C interface to fast charging communication mode, enable the DPDM fast charging communication circuit, and control the USB data communication circuit to be in a high-impedance state. Step S2: In response to the user's first input, switch the DP pin and DM pin to USB data communication mode, enable the USB data communication circuit, and control the DPDM fast charging communication circuit to be in a high-impedance state. Step S3: In USB data communication mode, establish USB PD communication with the peer device of the power bank; Step S4: Send a data role switching message to the peer device so that the power bank acts as a USB slave in the data role and as a power supply device in the power supply role.

[0108] In this embodiment, the DP and DM pins can be configured in fast charging communication mode by default, enabling the DPDM fast charging communication circuit to operate and the USB data communication circuit to have high impedance. In this mode, the power bank performs fast charging normally. When the user performs the first input, the system switches to USB data communication mode, enabling the USB data communication circuit to operate and the DPDM fast charging communication circuit to have high impedance. The power bank then enters data mode, preparing to communicate with the peer device via USB data. Subsequently, USB PD communication is established in USB data communication mode, and a data role switching message is sent, causing the power bank to act as a USB slave in the data role and as a power supply device in the power supply role.

[0109] According to the data communication control method provided in the embodiments of this application, by default configuring the DP and DM pins to fast charging communication mode, switching to USB data communication mode in response to user input, establishing USB PD communication in USB data communication mode and sending a data role switching message, the reliable switching of the power bank from fast charging mode to data mode and data communication as a USB slave in data mode are realized. This enables the two functions of DPDM fast charging communication and USB data communication to be realized on the same USB interface of the power bank without the need to set up a USB host controller, thus reducing hardware overhead.

[0110] like Figure 13 As shown, in some embodiments, after switching the DP pin and DM pin to USB data communication mode, the method may further include: When the Type-C interface is in a powered connection state, control the Type-C interface to disconnect, and re-establish the connection after maintaining the connection for a preset time, and execute the steps to establish USB PD communication; If the Type-C interface is not in a power-connected state and an operation to exit USB data communication mode is detected, reconfigure the DP pin and DM pin to fast charging communication mode; The USB data communication mode is maintained when the Type-C interface is not in a powered state and no operation to exit USB data communication mode is detected; After the power bank acts as a USB slave and establishes USB PD communication with the peer device, the method may further include: Upon detecting an action to exit USB data communication mode, the DP and DM pins are reconfigured for fast charging communication mode. If no action to exit USB data communication mode is detected and the Type-C interface is disconnected, the USB data communication mode will be maintained. Maintain USB data communication with the peer device if no action to exit USB data communication mode is detected and the Type-C interface is not disconnected.

[0111] In actual implementation, such as Figure 13 As shown in step 901, the DP and DM pins are configured in fast charging communication mode by default. The USB data communication circuit is turned off and presents a high-impedance output state.

[0112] Step 902: Determine whether a button press to enter USB data communication mode has been detected. If yes, proceed to step 903; otherwise, return to step 901.

[0113] Step 903: Configure the DP and DM pins to USB data communication mode. The DPDM fast charging communication circuit is turned off and exhibits a high-impedance output state.

[0114] Step 904: Determine whether the Type-C interface is in the Source connection state, that is, whether the Type-C interface of the power bank is connected and acting as a power supply. If yes, proceed to step 906; otherwise, jump to step 905.

[0115] Step 905: Determine whether a button press to exit USB data communication mode has been detected. If yes, return to step 901; otherwise, return to step 903.

[0116] Step 906: Control the Type-C connection to actively disconnect for 1 second. By disconnecting the pull-up resistor Rp or pull-up current source Ip of the CC pin, the Type-C connection is disconnected and maintained for 1 second, then proceed to step 907.

[0117] Step 907: Re-enable the pull-up resistor Rp or pull-up current source Ip on the CC pin, causing the Type-C to re-establish the Source connection state. At this time, in terms of the data role in USB communication, the power bank defaults to acting as the DFP, i.e., USB Host; while the peer device, as the powered device, defaults to acting as the UFP, i.e., USB Device.

[0118] Step 908: Initiate and establish USB PD communication with the peer device (the powered device). The power bank sends a DR_Swap message, working together with the peer device to switch roles in USB communication data transfer.

[0119] Step 909: The power bank acts as a USB slave device, and the peer device acts as a USB host to establish USB data communication and realize information transmission.

[0120] Step 910: Determine whether a button press to exit USB data communication mode has been detected. If yes, proceed to step 901; otherwise, proceed to step 911.

[0121] Step 911: Determine if the Type-C connection is down. If yes, proceed to step 903; otherwise, return to step 909.

[0122] The data communication control method provided in this application can be executed by a data communication control device. This application uses an example of a data communication control device executing the data communication control method to illustrate the data communication control device provided in this application.

[0123] This application also provides a data communication control device.

[0124] like Figure 14 As shown, the data communication control device includes: a first processing module 1410, a second processing module 1420, a third processing module 1430, and a fourth processing module 1440.

[0125] The first processing module 1410 is used to configure the DP pin and DM pin of the Type-C interface to fast charging communication mode, enable the DPDM fast charging communication circuit, and control the USB data communication circuit to be in a high-impedance state. The second processing module 1420 is used to switch the DP pin and DM pin to USB data communication mode in response to the user's first input, enable the USB data communication circuit, and control the DPDM fast charging communication circuit to be in a high-impedance state. The third processing module 1430 is used to establish USB PD communication with the peer device in USB data communication mode; The fourth processing module 1440 is used to send a data role switching message to the peer device so that the power bank acts as a USB slave in the data role and as a power supply device in the power supply role.

[0126] The data communication control device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a power bank, mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0127] The data communication control device in this application embodiment can be a device with an operating system. This operating system can be a Microsoft (Windows) operating system, an Android operating system, an iOS operating system, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.

[0128] The data communication control device provided in this application embodiment can achieve... Figures 12 to 13 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0129] In some embodiments, such as Figure 15 As shown, this application embodiment also provides an electronic device 1500, including a processor 1501, a memory 1502, and a computer program stored in the memory 1502 and executable on the processor 1501. When the program is executed by the processor 1501, it implements the various processes of the above-described data communication control method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0130] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0131] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described data communication control method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0132] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0133] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described data communication control method.

[0134] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0135] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described data communication control method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0136] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0137] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0139] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

[0140] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0141] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.

Claims

1. A portable power bank, characterized in that, include: Type-C interface; The DPDM fast charging communication circuit is connected to the DP and DM pins of the Type-C interface for fast charging protocol communication. The USB data communication circuit is connected to the DP pin and the DM pin and is used for USB protocol data communication. The control circuit is connected to both the DPDM fast charging communication circuit and the USB data communication circuit, and the control circuit is configured as follows: In response to the user's first input, the communication modes of the DP pin and the DM pin are switched; In fast charging communication mode, the DPDM fast charging communication circuit is enabled, and the USB data communication circuit is controlled to be in a high-impedance state. In USB data communication mode, the USB data communication circuit is enabled, and the DPDM fast charging communication circuit is controlled to be in a high-impedance state.

2. The portable power bank according to claim 1, characterized in that, The control circuit is further configured to: In the USB data communication mode, USBPD communication is established with the peer device of the power bank through the Type-C interface; Send a data role switching message to the peer device so that the power bank acts as a USB slave in the data role and as a power supply device in the power supply role.

3. The portable power bank according to claim 2, characterized in that, The control circuit is further configured to: After entering the USB data communication mode, and before sending the data role switching message, the Type-C interface is controlled to actively disconnect and re-establish the connection after a preset time. The control circuit is further configured to: During initialization, the DP pin and the DM pin are configured by default to the fast charging communication mode.

4. The portable power bank according to any one of claims 1-3, characterized in that, The USB data communication circuit includes: A differential receiver, wherein the two input terminals of the differential receiver are respectively connected to the DP pin and the DM pin, for receiving differential signals and converting them into digital signals; A first single-ended receiver, the input of which is connected to the DP pin, is used to detect the absolute level state of the DP pin; A second single-ended receiver, the input of which is connected to the DM pin, is used to detect the absolute level state of the DM pin; A first differential driver is connected to the DP pin and is used to drive the DP pin to send differential communication signals; The second differential driver is connected to the DM pin and is used to drive the DM pin to send differential communication signals; A first pull-up resistor, one end of which is connected to the power supply; A first switch, the other end of the first pull-up resistor is connected to the DP pin through the switch; The USB data communication circuit is also configured to: When the USB data communication circuit is off, the first differential driver and the second differential driver are in a high-impedance state, and the first switch is open.

5. The portable power bank according to any one of claims 1-3, characterized in that, Also includes: The CC connection circuit is connected to the CC1 and CC2 pins of the Type-C interface and is used to perform at least one of the following operations: Type-C connection detection, connection direction determination, and role recognition. The PD communication circuit is connected to the CC pin when it is in the connected state and is used for PD protocol communication.

6. The portable power bank according to claim 5, characterized in that, The CC connection circuit includes: The first current source and the second switch are connected in series between the power supply and the CC1 pin; The second current source and the third switch are connected in series between the power supply and the CC2 pin; The first pull-down resistor and the fourth switch are connected in series between the CC1 pin and ground. The second pull-down resistor and the fifth switch are connected in series between the CC2 pin and ground. A first comparator, wherein the positive input terminal of the first comparator is used to receive a first reference voltage; The second comparator, the negative input of the second comparator is used to receive the second reference voltage; A switching switch is used to select, in a time-division manner, whether the CC1 pin or the CC2 pin is connected to the negative input terminal of the first comparator and the positive input terminal of the second comparator; The AND gate is configured such that the output of the first comparator is connected to the first input of the AND gate, the output of the second comparator is connected to the second input of the AND gate, and the output of the AND gate outputs a connection indication signal.

7. The portable power bank according to any one of claims 1-3, characterized in that, Also includes: A charging and discharging circuit is connected to the VBUS pin of the Type-C interface. When the power bank is used as a power receiving device, it draws power from the VBUS pin to charge the battery of the power bank. When the power bank is used as a power supply device, it discharges power to the outside through the VBUS pin.

8. The portable power bank according to any one of claims 1-3, characterized in that, It also includes a key detection circuit; the key detection circuit includes: The second pull-up resistor is connected between the KEY pin and the power supply. A Schmitt inverter, the input of which is connected to the KEY pin; An inverter, the input of which is connected to the output of the Schmitt inverter; A debouncing circuit, wherein the input terminal of the debouncing circuit is connected to the output terminal of the inverter; A key action recognition circuit is provided, wherein the input terminal of the key action recognition circuit is connected to the output terminal of the debounce circuit, and is used to recognize the user's first input and output the recognition result to the control circuit.

9. A data communication control method for a mobile power bank as described in any one of claims 1-8, characterized in that, include: Configure the DP and DM pins of the Type-C interface to fast charging communication mode, enable the DPDM fast charging communication circuit, and control the USB data communication circuit to be in a high-impedance state. In response to the user's first input, the DP pin and the DM pin are switched to USB data communication mode, enabling the USB data communication circuit and controlling the DPDM fast charging communication circuit to be in a high-impedance state. In the USB data communication mode, USB PD communication is established with the peer device of the power bank; Send a data role switching message to the peer device so that the power bank acts as a USB slave in the data role and as a power supply device in the power supply role.

10. The data communication control method for a mobile power bank according to claim 9, characterized in that, After switching the DP pin and the DM pin to USB data communication mode, the method further includes: When the Type-C interface is in a powered connection state, the Type-C interface is controlled to disconnect, and after maintaining the connection for a preset time, the connection is re-established to perform the steps of establishing USB PD communication; If the Type-C interface is not in the power supply connection state and an operation to exit USB data communication mode is detected, the DP pin and the DM pin will be reconfigured to fast charging communication mode. If the Type-C interface is not in the power supply connection state and no operation to exit the USB data communication mode is detected, the USB data communication mode is maintained. After the power bank acts as a USB slave and establishes USB PD communication with the peer device, the following is also included: Upon detecting an operation to exit USB data communication mode, the DP pin and the DM pin are reconfigured for fast charging communication mode; If no action to exit USB data communication mode is detected and the Type-C interface is disconnected, the USB data communication mode shall be maintained. If no action to exit USB data communication mode is detected and the Type-C interface is not disconnected, USB data communication with the peer device is maintained.

11. A data communication control device based on a mobile power supply as described in any one of claims 1-10, characterized in that, include: The first processing module is used to configure the DP pin and DM pin of the Type-C interface to fast charging communication mode, enable the DPDM fast charging communication circuit, and control the USB data communication circuit to be in a high-impedance state. The second processing module is used to switch the DP pin and the DM pin to USB data communication mode in response to the user's first input, enable the USB data communication circuit, and control the DPDM fast charging communication circuit to be in a high-impedance state. The third processing module is used to establish USBPD communication with the peer device of the power bank in the USB data communication mode. The fourth processing module is used to send a data role switching message to the peer device so that the power bank acts as a USB slave in the data role and as a power supply device in the power supply role.

12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the data communication control method as described in claims 9 and 10.

13. A chip, the chip comprising a processor and a communication interface, the communication interface being coupled to the processor, characterized in that, The processor is used to run programs or instructions, and when the processor executes the programs or instructions, it implements the data communication control method as described in claims 9 and 10.