Charging control method and apparatus, electronic device, and power supply device

By sending control messages between electronic devices and power supply devices and time-division multiplexing the D+ and D- pins, the mutual interference problem between UFCS protocol fast charging and peripheral data communication is solved, and efficient charging and data transmission are achieved in tandem.

WO2025223247A1PCT designated stage Publication Date: 2025-10-30VIVO MOBILE COMM CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/088908
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-04-22
Filing Date
2025-04-15
Publication Date
2025-10-30

AI Technical Summary

Technical Problem

The problem of reduced charging efficiency when existing electronic devices are connected to fast charging and peripherals at the same time is mainly due to the mutual interference between UFCS protocol fast charging and peripheral data communication, which makes it impossible to support efficient charging and data transmission at the same time.

Method used

By sending different control messages between electronic devices and power supply devices, and time-division multiplexing the D+ and D- pins according to data transmission requirements, fast charging and data communication can be carried out in a coordinated manner, avoiding exiting the UFCS protocol.

Benefits of technology

While maintaining UFCS protocol fast charging, it enables normal data communication with peripherals to ensure that charging efficiency does not decrease and meets users' needs for efficient charging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025088908_30102025_PF_FP_ABST
    Figure CN2025088908_30102025_PF_FP_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of electronics, and discloses a charging control method and apparatus, an electronic device, and a power supply device. The method comprises: sending a first control message or a second control message to a power supply device by means of a data port of an electronic device. When a data transmission requirement does not exist between the electronic device and an external device, the first control message is sent to the power supply device by means of the data port, the first control message being used for instructing the power supply device to carry out fast charging communication with the electronic device by means of the data port. When a data transmission requirement exists between the electronic device and the external device, after the second control message is sent to the power supply device by means of the data port, data transmission with the external device is carried out by means of the data port, the second control message being used for instructing the power supply device to maintain charging parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Charging control methods, devices, electronic equipment and power supply equipment

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese Patent Application No. 202410480794.X, filed in China on April 22, 2024, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application belongs to the field of electronic technology, specifically relating to a charging control method, device, electronic equipment, and power supply equipment. Background Technology

[0004] Currently, most mobile phones and other electronic devices use the Universal Fast Charging Specification (UFCS) protocol for fast charging, and use the D+ and D- pins as the transmission medium for protocol data packets during fast charging. When electronic devices connect to external devices such as USB flash drives, they use the Universal Serial Bus (USB) communication protocol to transmit data, and also transmit data packets through the D+ and D- pins.

[0005] When a user connects an electronic device to both a charger and a USB flash drive via a docking station, both UFCS wired fast charging and data communication with the USB flash drive require the use of the D+ and D- pins, causing mutual interference. This means that electronic devices currently cannot effectively support both UFCS fast charging and data communication with the peripheral device simultaneously. The mainstream approach in existing technology is to switch from UFCS charging to 5V2A charging, but this charging power is significantly lower than UFCS wired fast charging, resulting in reduced charging efficiency. Summary of the Invention

[0006] The purpose of this application is to provide a charging control method, device, electronic device, and power supply device that can solve the problem of reduced charging efficiency of existing electronic devices when simultaneously connected to fast charging and peripherals.

[0007] In a first aspect, embodiments of this application provide a charging control method, executed by an electronic device, the electronic device being connected to a power supply device and an external device, the method comprising:

[0008] The electronic device sends a first control message or a second control message to the power supply device through its data port.

[0009] In the case where there is no data transmission requirement between the electronic device and the external device, a first control message is sent to the power supply device through the data port. The first control message is used to instruct the power supply device and the electronic device to perform fast charging communication through the data port.

[0010] When there is a data transmission requirement between the electronic device and the external device, after sending a second control message to the power supply device through the data port, data transmission is performed with the external device through the data port. The second control message is used to instruct the power supply device to maintain the charging parameters.

[0011] Secondly, embodiments of this application provide a charging control method, executed by a power supply device connected to an electronic device, the electronic device also being connected to an external device, the method comprising:

[0012] Upon receiving the first control message sent by the electronic device, the charging parameter adjustment restriction is lifted;

[0013] Upon receiving a second control message from the electronic device, the charging parameter adjustment restriction is enabled.

[0014] Thirdly, embodiments of this application provide a charging control device, disposed in an electronic device, the electronic device being connected to a power supply device and an external device, the charging control device comprising:

[0015] The transmitting module is used to send a first control message or a second control message to the power supply device through the data port of the electronic device;

[0016] In the case where there is no data transmission requirement between the electronic device and the external device, the sending module sends a first control message to the power supply device through the data port. The first control message is used to instruct the power supply device and the electronic device to perform fast charging communication through the data port.

[0017] When a data transmission requirement is detected between the electronic device and the external device, the sending module sends a second control message to the power supply device through the data port, and then transmits data with the external device through the data port. The second control message is used to instruct the power supply device to maintain the charging parameters.

[0018] Fourthly, embodiments of this application provide a charging control device, disposed in a power supply device connected to an electronic device, the electronic device also being connected to an external device, the charging control device comprising:

[0019] The execution module is configured to cancel the charging parameter adjustment restriction upon receiving a first control message from the electronic device, and to enable the charging parameter adjustment restriction upon receiving a second control message from the electronic device.

[0020] Fifthly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions, when executed by the processor, implementing the steps of the method described in the first aspect.

[0021] In a sixth aspect, embodiments of this application provide a power supply device, the electronic device including a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions, when executed by the processor, implementing the steps of the method described in the second aspect.

[0022] In a seventh aspect, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect, or implement the steps of the method described in the second aspect.

[0023] Eighthly, embodiments of this application provide a chip, the 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 method as described in the first aspect, or to implement the steps of the method as described in the second aspect.

[0024] Ninthly, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect, or to implement the method described in the second aspect.

[0025] In this embodiment, an electronic device is connected to a power supply and an external device. The electronic device sends a first control message or a second control message to the power supply through its data port. When there is no data transmission requirement between the electronic device and the external device, the first control message is sent to the power supply through the data port, instructing the power supply to communicate with the electronic device via fast charging through the data port. When there is a data transmission requirement between the electronic device and the external device, the second control message is sent to the power supply through the data port, and then data transmission occurs between the electronic device and the external device through the data port. The second control message instructs the power supply to maintain charging parameters. Thus, when the electronic device is simultaneously connected to both a power supply and an external device, different control messages can be sent to the power supply depending on whether there is a data transmission requirement between the electronic device and the external device. This allows the power supply to communicate with the electronic device via fast charging or maintain the current charging parameters without exiting fast charging mode, ensuring that fast charging power is maintained even when fast charging and external device connection are active simultaneously, thus preventing a decrease in charging efficiency. Attached Figure Description

[0026] Figure 1 is a flowchart of one of the charging control methods provided in the embodiments of this application;

[0027] Figure 2 is a structural diagram of the charging control circuit of the electronic device provided in this application embodiment, which is simultaneously connected to a charger and an external device via a docking station.

[0028] Figure 3 is a second flowchart of the charging control method provided in an embodiment of this application;

[0029] Figure 4 is one of the structural diagrams of the charging control device provided in the embodiments of this application;

[0030] Figure 5 is a second structural diagram of the charging control device provided in an embodiment of this application;

[0031] Figure 6 is a structural diagram of the electronic device provided in an embodiment of this application;

[0032] Figure 7 is a hardware structure diagram of the electronic device provided in an embodiment of this application. Detailed Implementation

[0033] 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.

[0034] 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 terms can be used interchangeably 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.

[0035] To make the embodiments of this application clearer, the relevant technical knowledge involved in the embodiments of this application will be introduced as follows:

[0036] The UFCS protocol is a fast charging protocol standard jointly developed by several major mobile phone manufacturers. The process of entering the UFCS protocol can be divided into three steps: fast charging handshake -> requesting voltage and current -> monitoring for anomalies during charging and fine-tuning the charging voltage and current. In this process, the UFCS protocol defines the message data packets used in each step, such as the handshake message format used in the fast charging handshake and the message format for requesting voltage. According to the protocol's hardware layer standard, these data are ultimately converted into a sequence of high and low voltage signals, transmitted through the D+ and D- pins. The D+ and D- pins serve as the transmission medium for protocol data packets during UFCS wired fast charging.

[0037] When peripherals such as USB flash drives transfer data with mobile phones, such as during file copying, the standard Universal Serial Bus (USB) communication protocol is followed. The file data is divided into data packets, which are then converted into voltage signals and transmitted through the D+ and D- pins. The D+ and D- pins are also used as the transmission medium for USB flash drive data.

[0038] When users connect an external charging dock and want to simultaneously charge and communicate data, the UFCS protocol standard uses the D+ and D- pins for charging data packet communication during wired charging, occupying these pins. Since USB flash drive peripherals also require the D+ and D- pins for data communication, they interfere with each other. This means that currently, it's not ideal to simultaneously support UFCS fast charging and peripheral data communication. The current mainstream approach is to exit UFCS charging and switch to 5V2A charging. This charging method offers significantly lower charging power compared to UFCS wired fast charging, resulting in slower charging and a poorer user experience.

[0039] Therefore, the purpose of this application is to overcome the shortcomings of the prior art and provide a design scheme for simultaneously maintaining UFCS protocol fast charging and data communication, which time-division multiplexes the D+ and D- pins to meet the user's needs for UFCS fast charging, while also being able to communicate normally with peripherals such as USB flash drives to transfer file data.

[0040] The charging control method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0041] Please refer to Figure 1, which is a flowchart of a charging control method provided in an embodiment of this application. The method is executed by an electronic device connected to a power supply and an external device. As shown in Figure 1, the method includes the following steps:

[0042] Step 101: Establish connections between the electronic device and the power supply and external devices;

[0043] Alternatively, the following situations may occur:

[0044] If an electronic device detects the power supply first and then the external device, the electronic device will first establish a connection with the power supply and then with the external device. If the electronic device detects the external device first and then the power supply, the electronic device will first establish a connection with the power supply and then with the external device. If the electronic device detects both the power supply and the external device simultaneously, for example, if a docking station is connected to both the external device and the power supply, and the electronic device is then physically connected to the docking station, the electronic device can either first establish a connection with the power supply and then with the external device, or vice versa.

[0045] Step 102: Send a first control message or a second control message to the power supply equipment through the data port of the electronic device;

[0046] In the case where there is no data transmission requirement between the electronic device and the external device, a first control message is sent to the power supply device through the data port. The first control message is used to instruct the power supply device and the electronic device to perform fast charging communication through the data port.

[0047] When there is a data transmission requirement between the electronic device and the external device, after sending a second control message to the power supply device through the data port, data transmission is performed with the external device through the data port. The second control message is used to instruct the power supply device to maintain the charging parameters.

[0048] In this embodiment, when the electronic device is connected to both a power supply and an external device, such as when the electronic device is simultaneously connected to both a power supply and an external device via a docking station, to avoid interference caused by both communication with the power supply and communication with the external device occupying the data ports (such as D+ and D- pins) of the peripheral interface (such as the Type-C interface) of the electronic device, thus affecting charging efficiency, a charging control scheme to prevent exiting fast charging is designed. Depending on whether there is a need for data transmission with the external device in actual use, different control messages are sent to the power supply to indicate whether the power supply can currently perform normal fast charging communication with the electronic device. Specifically, if the D+ and D- pins need to be occupied by the external device for communication, the power supply can be instructed to maintain the current charging parameters unchanged, thereby avoiding exiting fast charging mode and reducing charging power. If the D+ and D- pins are not occupied by the external device for communication, the power supply can be instructed to perform fast charging communication with the electronic device to adjust the charging parameters according to the request of the electronic device. This achieves time-sharing multiplexing of the D+ and D- pins between the power supply and the external device, meeting the user's needs for UFCS fast charging, while also enabling normal data communication with external devices such as USB flash drives for file transfer.

[0049] The aforementioned docking station, also known as a port replicator, is an external interface device designed specifically for electronic devices. It can replicate or even expand the ports of electronic devices, allowing them to connect to multiple accessories or external devices.

[0050] The aforementioned power supply equipment may refer to a charger, especially a charger that supports the UFCS fast charging protocol. The aforementioned external devices may be external devices such as USB flash drives and portable hard drives that support reading and writing data with electronic devices.

[0051] The aforementioned first control message and second control message can be messages used to instruct the power supply device on how to control charging parameters such as output voltage and output current. In specific implementation, different information can be indicated by carrying different bit indication bits. For example, if the indication bit in the first control message is 0, it indicates that the power supply device communicates with the electronic device for fast charging and adjusts the charging parameters according to the charging parameters requested by the electronic device. If the indication bit in the second control message is 1, it indicates that the power supply device maintains the current charging state or charging parameters.

[0052] In cases where there is no data transmission requirement between the aforementioned electronic device and the external device, the operation of reading or writing to the external device may not be received; in cases where there is a data transmission requirement between the aforementioned electronic device and the external device, the operation of reading or writing to the external device may be received.

[0053] In this embodiment, when there is no data transmission requirement between the electronic device and the external device, a first control message can be sent to the power supply device through the data port. The first control message instructs the power supply device to perform fast charging communication with the electronic device, so as to adjust the charging parameters according to the charging parameters requested by the electronic device. That is, it informs the power supply device that the D+ and D- pins are not currently occupied by the external device and can be used to transmit messages with the power supply device. Thus, when the power supply device receives the first control message, it can perform fast charging communication with the electronic device through the D+ and D- pins, transmit relevant messages, and adjust the output charging parameters based on the charging parameters requested by the electronic device, that is, to perform a normal fast charging process.

[0054] When there is a data transmission requirement between the electronic device and the external device, a second control message can be sent to the power supply device first. The second control message instructs the power supply device to maintain the current charging state unchanged. That is, it tells the power supply device that the D+ and D- pins are currently used for data transmission to the external device, and the D+ and D- pins can be temporarily not used to transmit messages with the power supply device. Thus, when the power supply device receives the second control message, it can stop fast charging communication with the electronic device through the D+ and D- pins and maintain the current charging parameters unchanged, maintaining the current high charging power, instead of switching to the normal charging mode of 5A2V.

[0055] Optionally, the method further includes:

[0056] When the electronic device is only connected to the power supply device, it can communicate with the power supply device for fast charging through the data port;

[0057] Upon detecting the external device, after sending the second control message to the power supply device through the data port, communication is established with the external device through the data port to establish a connection with the external device.

[0058] In one implementation scenario, the electronic device initially connects only to the power supply device and then connects to external devices, such as connecting to the power supply device first via a docking station and then connecting to the external devices. In this scenario, the electronic device determines that the power supply device is connected by observing the voltage change of the USB Power Delivery Bus Voltage (VBUS) input on the peripheral interface. It detects that the external device has not yet been inserted by observing the connection status of the communication ports of the peripheral interface, such as the CC1 / CC2 pins. At this time, it can first communicate with the power supply device through the data ports of the peripheral interface, namely the D+ and D- pins, and send messages to the power supply device through the D+ and D- pins to perform the UFCS protocol handshake according to the UFCS protocol standard handshake process.

[0059] Then, the electronic device receives information from the external device by detecting changes in the CC1 / CC2 pin states, indicating that the external device has been connected. If the UFCS protocol handshake with the power supply device is not yet complete, it will wait for the handshake to finish. Once the handshake is successful and the device enters the UFCS fast charging state, the electronic device continues to check whether the output voltage, output current, and other charging parameters of the power supply device have reached the range requested by the electronic device. If the output voltage and output current of the power supply device have reached the range requested by the electronic device, it indicates that the charging voltage and current adjustment has been completed. At this time, the electronic device can send the second control message to the power supply device, notifying it to maintain the current output voltage and output current and maintain the current charging state. Then, it pauses the transmission of charging-related messages with the power supply device via the D+ and D- pins. Then, it communicates with the external device via the D+ and D- pins, triggering the USB driver module to perform an enumeration operation and begin identifying the external device.

[0060] After identifying the external device and establishing a connection with it, if no read / write operation is received for the external device, the processing of the external device can be suspended, and the first control message can be sent to the power supply device to notify the power supply device that the restriction can be lifted, that is, the output voltage and current can be modified, and fast charging communication with the power supply device can continue through the D+ and D- pins. The output voltage and current can be adjusted according to the voltage and current requested by the electronic device. The electronic device can also read and monitor the charging status through other monitoring message packets.

[0061] This implementation provides a set of data communication and charging control logic for scenarios where electronic devices are first connected to a power supply and then to external devices. It enables time-division multiplexing of the D+ and D- pins during charging communication and data transmission with external devices, ensuring that charging efficiency does not decrease.

[0062] Optionally, the method further includes:

[0063] Upon detecting the external device, communication is established with the external device via the data port to establish a connection with the external device;

[0064] Upon detecting the power supply device, communication is established with the power supply device via the data port to establish a connection with the power supply device.

[0065] In another implementation scenario, the electronic device is initially connected to an external device and then to the power supply device. For example, the external device is first connected via a docking station, followed by the power supply device. In this scenario, the electronic device detects the external device connection through the connection status of the communication port, such as the CC / CC2 pin. However, there is no voltage on the VBUS pin, indicating that the external device is detected but the power supply device is not. In this case, the electronic device can first communicate with the external device through the data port of the peripheral interface, namely the D+ and D- pins, to trigger the USB driver module to perform an enumeration operation and begin to identify the external device.

[0066] Then, the electronic device detects a charging voltage on the VBUS pin, indicating that a power supply has been connected. At this point, it waits for the operation on the external device to complete, including the completion of external device identification and read / write operations (if no external device operation is currently being performed, this waiting period is unnecessary). Then, it suspends the processing of the external device, halting communication with it via the D+ and D- pins. Following the UFCS protocol handshake procedure, it sends messages to the power supply via the D+ and D- pins to initiate a UFCS protocol handshake. Upon successful handshake, it enters the UFCS fast charging state. If no read / write operation is received from the external device, the first control message is sent to the power supply, informing it that restrictions are lifted and the output voltage and current can be modified according to the electronic device's request. The electronic device can also read and monitor the charging status through other monitoring message packets.

[0067] This implementation provides a set of data communication and charging control logic for scenarios where electronic devices connect to external devices first and then to the power supply. It enables time-division multiplexing of the D+ and D- pins during charging communication and data transmission with external devices, ensuring that charging efficiency does not decrease.

[0068] Optionally, the method further includes:

[0069] When both the power supply device and the external device are detected simultaneously, communication is established with the power supply device through the data port to establish a connection with the power supply device;

[0070] The second control message is sent to the power supply equipment through the data port;

[0071] The device communicates with the external device through the data port to establish a connection with the external device.

[0072] In another implementation scenario, the electronic device can simultaneously detect both the power supply device and the external device. For example, both the power supply device and the external device are first connected to a docking station, and then the docking station is connected to the electronic device. In this scenario, the electronic device determines that it has simultaneously detected both the external device and the power supply device based on the connection status of the CC1 / CC2 pins and the voltage status on the VBUS pin. In this case, a fast charging handshake can be prioritized. First, the peripheral interface's data ports (D+ and D- pins) communicate with the power supply device. Following the UFCS protocol handshake procedure, messages are sent to the power supply device via the D+ and D- pins to initiate the UFCS protocol handshake. After a successful handshake, the device enters the UFCS protocol fast charging state. Subsequent processing is similar to the first scenario described above. The electronic device continues to monitor whether the power supply device's output voltage, output current, and other charging parameters have reached the range requested by the electronic device. If the power supply device's output voltage and output current have reached the range requested by the electronic device, it indicates that the charging voltage and current adjustment has been completed. At this time, the electronic device can send the second control message to the power supply device, notifying the power supply device to maintain the current output voltage and output current without change, and to maintain the current charging state. Then, it pauses the transmission of charging-related messages with the power supply device via the D+ and D- pins. It can then communicate with the external device via the D+ and D- pins, triggering the USB driver module to perform an enumeration operation and begin recognizing the external device.

[0073] After identifying the external device, if no read / write operation is received for the external device, the processing of the external device can be suspended, and the first control message can be sent to the power supply device to notify the power supply device that the restriction can be lifted, that is, the output voltage and current can be modified, and fast charging communication with the power supply device can continue through the D+ and D- pins. The output voltage and current can be adjusted according to the voltage and current requested by the electronic device. The electronic device can also read and monitor the charging status through other monitoring message packets.

[0074] This implementation provides a set of data communication and charging control logic for scenarios where electronic devices are simultaneously connected to power supply equipment and external devices. It enables time-division multiplexing of the D+ and D- pins during charging communication and data transmission with external devices, ensuring that charging efficiency does not decrease.

[0075] Optionally, when there is a data transmission requirement between the electronic device and the external device, after sending a second control message to the power supply device through the data port, data transmission is performed with the external device through the data port, including:

[0076] Upon receiving a read / write operation on the external device, a second control message is sent to the power supply device, and data is transmitted with the external device through the data port of the peripheral interface.

[0077] In some embodiments, when a user operates an external device, such as attempting to open a USB flash drive, read data from the USB flash drive, or write data to the USB flash drive from an electronic device, the user can send the second control message to the power supply device to notify the power supply device to maintain the current charging state, suspend charging communication with the power supply device via the D+ and D- pins, resume the previously suspended processing of the external device, communicate with the external device via the D+ and D- pins, and transmit corresponding data according to the specific read / write operation performed by the user on the external device.

[0078] After the data transmission operation with the external device is completed, the operation process of the external device can be suspended, and charging communication with the power supply device can be restarted through the D+ and D- pins.

[0079] In this way, when a read / write operation is received on the external device, the power supply device can be instructed to maintain the current charging current, thereby maintaining fast charging power and ensuring high charging efficiency when transmitting data with the external device.

[0080] Optionally, the method further includes:

[0081] When there is a data transmission requirement between the electronic device and the external device, a watchdog configuration message is sent to the power supply device. The watchdog configuration message is used to instruct the power supply device to disable the watchdog function. The watchdog function is used to exit the fast charging mode when there is no fast charging protocol communication between the power supply device and the electronic device within a preset time period.

[0082] In some embodiments, the watchdog function can be configured based on whether there is a data transmission requirement between the electronic device and the external device. Specifically, it can be configured by sending a watchdog configuration message to the power supply device.

[0083] In a specific implementation, when the electronic device needs to transmit data with the external device through the data port of the peripheral interface, a watchdog configuration message can be sent to the power supply device to instruct the power supply device to disable the watchdog function. Upon receiving the message, the power supply device can temporarily disable the watchdog and temporarily not handle the communication timeout situation between the electronic device and the power supply device. This can prevent the fast charging from exiting during the data transmission process between the electronic device and the external device, and ensure that charging is always performed at a high charging power.

[0084] In some embodiments, the method further includes: when there is no data transmission requirement between the electronic device and the external device, sending a watchdog configuration message to the power supply device, wherein the watchdog configuration message is used to instruct the power supply device to enable the watchdog function.

[0085] In other words, when the electronic device needs to communicate with the power supply device through the data port of the peripheral interface, it can send a watchdog configuration message to the power supply device to instruct the power supply device to enable the watchdog function. Upon receiving the message, the power supply device can enable the watchdog to monitor whether the communication between the two is normal during the fast charging communication with the electronic device. If an abnormality is detected, such as the power supply device not receiving data, it will trigger the power supply device to exit fast charging, thereby ensuring the safety of charging communication.

[0086] Optionally, the target bit in the data content field carried in the first control message has a first value; the target bit in the data content field carried in the second control message has a second value.

[0087] In some embodiments, the format of the control message data packet can be customized for controlling the charging logic.

[0088] Specifically, the manufacturer-defined message data packet format specified by the UFCS protocol is shown in Table 1 below:

[0089] Table 1

[0090] Here, CRC stands for Cyclic Redundancy Check. Based on this format, this application defines a new manufacturer-defined data packet for controlling the charging process. The data content length is newly defined as 2 bytes, totaling 16 bits, and the definitions of each bit are shown in Table 2 below:

[0091] Table 2

[0092] The control message data packets used in this application follow the manufacturer's default data rules in the previous protocol for the positions of fields such as message header and reserved bits, without any additional modifications. The data length field is set to 2, indicating that the following data is 2 bytes. In the subsequent data content field, the first byte can send bits 15 to 8, and the second byte can send bits 7 to 0. In the following control logic description, this custom message will be referred to as a control message. The first control message and the second control message mentioned in the embodiments of this application belong to the custom control message, distinguished by assigning 0 or 1 to bits 1 to the data content field. In the first control message, if bits 1 to 0 of the data content field are 0, it indicates that the power supply device cancels the restriction and adjusts the charging current according to the charging current requested by the electronic device. In the second control message, if bits 1 to 0 of the data content field are 1, it indicates that the power supply device maintains the current charging current and does not make any adjustments.

[0093] This implementation method enables charging logic control through custom control messages, and the message format is simple and easy to transmit.

[0094] Optionally, the watchdog configuration message used to indicate that the watchdog function is enabled configures the watchdog timer's overflow time to be a first duration, and the watchdog configuration message used to indicate that the watchdog function is disabled configures the watchdog timer's overflow time to be 0.

[0095] In some embodiments, the watchdog configuration message (i.e., Config_Watchdog) already defined in the UFCS standard can be used, and the message format is shown in Table 3 below:

[0096] Table 3

[0097] The intermediate control command field contains 1 byte of the command number 0x08 corresponding to the Config_Watchdog message. The configuration information field contains 2 bytes of data, as shown in Table 4. Entering values ​​into these two bytes configures the watchdog timer's overflow time. The default watchdog overflow time is configurable to 1 second. If the watchdog timer overflow time configured in the Config_Watchdog message is 0, the watchdog function will be disabled.

[0098] Table 4

[0099] The watchdog function in the UFCS protocol is used to monitor the fast charging process. During charging, the power supply device resets the counter to zero each time it receives valid data. If the power supply device does not receive any data and the counter value exceeds the watchdog timer overflow time, the power supply device will actively exit fast charging and return to the initial 5V2A charging state.

[0100] In the charging control flow designed in this application, the watchdog function can be controlled to be turned on and off by configuring the Config_Watchdog message. The watchdog configuration message described in this embodiment belongs to the Config_Watchdog message. It is distinguished by assigning a timer duration or 0 to bits 15 to 0 of the configuration information field. Specifically, the values ​​of bits 15 to 0 of the configuration information field in the watchdog configuration message indicating that the watchdog function is enabled represent the timer duration, indicating that the power supply device enables the watchdog function and sets the watchdog timer to this duration. The values ​​of bits 15 to 0 of the configuration information field in the watchdog configuration message indicating that the watchdog function is disabled represent that the power supply device disables the watchdog function.

[0101] In this implementation, the watchdog timer duration can be configured through the Config_Watchdog message to monitor charging communication, which can prevent the electronic device from exiting fast charging when it is simultaneously connected to the power supply and external devices.

[0102] Optionally, the electronic device includes a power management integrated circuit, a switching component, and an application processing module. The stationary terminal of the switching component is connected to the data port of the peripheral interface of the electronic device, the first moving terminal of the switching component is connected to the data port of the power management integrated circuit, the second moving terminal of the switching component is connected to the data port of the application processing module, and the communication port of the power management integrated circuit is connected to the communication port of the peripheral interface.

[0103] The electronic device and the power supply device communicate via the data port for fast charging, including:

[0104] The stationary end of the switch assembly is connected to the first moving end, so that the power management integrated circuit can communicate with the power supply device for fast charging through the data port of the peripheral interface;

[0105] The electronic device and the external device transmit data through the data port, including:

[0106] The stationary end of the switch assembly is connected to the second moving end, so that the application processing module can communicate with the external device through the data port of the peripheral interface.

[0107] In some embodiments, a hardware circuit structure can also be designed for simultaneous UFCS protocol fast charging and data communication with peripherals to achieve time-division multiplexing of the data ports of the peripheral interface. The specific circuit structure is shown in Figure 2. The electronic device 20 includes a power management integrated circuit (PMIC) chip 21, a switching component 22, and an application processing module (AP) chip 23. The peripheral interface of the electronic device 20 includes D+ / D- and CC1 / CC2 pins. The D+ / D- pins of the peripheral interface are connected to the D+ / D- pins of the PMIC chip 21 and the AP chip 23 respectively via the switching component 22. Thus, the switching component 22 can control whether the D+ / D- pins of the peripheral interface of the electronic device 20 are connected to the PMIC chip 21 or the AP chip 23. The switching component 22 can be a toggle switch.

[0108] The electronic device 20, power supply device 30, and external device 40 all use standard Type-C interfaces with pins VBUS, GND, D+ / D-, and CC1 / CC2. Following the port orientation of the docking station 50, the Type-C interfaces of electronic device 20, power supply device 30, and external device 40 are connected to the docking station 50. The external docking station 50 connects the D+, D-, and CC1 / CC2 pins of the power supply device 30 and external device 40 in parallel. Then, the docking station 50 is connected to electronic device 20, and the CC1 / CC2 pins are connected to the PMIC chip 21 of electronic device 20.

[0109] The electronic device 20 internally includes a switch assembly 22. The front end of the switch assembly 22 is connected to the D+ / D- pin of the Type-C interface of the electronic device 20. The signal from this pin, after passing through the switch assembly 22, is split into two paths at the rear end. One path connects to the D+ / D- signal pin of the AP chip 23 of the electronic device 20. This chip is responsible for USB protocol communication, identifying the external device 40, and performing data transmission. The other path connects to the D+ / D- pin of the PMIC chip 21, which is responsible for UFCS fast charging protocol communication. The switch assembly 22 can be controlled by the processor of the electronic device 20, such as a Central Processing Unit (CPU), or the AP chip 23, to determine whether the D+ / D- pin is connected to the PMIC chip 21 or the AP chip 23.

[0110] Specifically, when the power supply device 30 is newly connected and a handshake communication is required, or when data transmission with external devices is not required, the stationary end of the control switch assembly 22 is connected to the end connected to the PMIC chip 21, so that the D+ / D- pin of the PMIC chip 21 is connected to the D+ / D- pin of the power supply device 30 through the type-C interface, and then fast charging communication is performed with the power supply device 30 through the D+ / D- pin.

[0111] When an external device 40 is newly connected and needs to perform a handshake communication or data transmission with the external device, the stationary end of the control switch assembly 22 is connected to the end connected to the AP chip 23, so that the D+ / D- pin of the AP chip 23 is connected to the D+ / D- pin of the external device 40 through the type-C interface, and then communication or data transmission with the external device 40 is performed through the D+ / D- pin.

[0112] This implementation method allows for the control of the use of data ports for peripheral interfaces by combining hardware circuit design, thereby achieving better time-division multiplexing of data ports in scenarios where charging and communication with external devices are carried out simultaneously through a combination of hardware and software.

[0113] Optionally, the control terminal of the switch assembly is connected to the general purpose input / output port (GPIO) of the application processing module; the control of the stationary terminal of the switch assembly to connect to the first moving terminal includes:

[0114] The GPIO port is controlled to output a first level, so as to control the stationary terminal of the switching component to connect to the first moving terminal;

[0115] The control of the stationary terminal of the switch assembly to connect to the second moving terminal includes:

[0116] The GPIO port is controlled to output a second level, so as to control the stationary terminal of the switching component to connect to the second moving terminal.

[0117] In some embodiments, the connectivity of the port of the switching component 22 can be controlled by outputting different levels on the GPIO pins of the AP chip. Specifically, as shown in FIG2, the GPIO pins of the AP chip 23 are connected to the control pins of the switching component 22, so that the GPIO pins can be output high or low by the software of the electronic device 20, controlling whether the back end of the switching component 22 is connected to the D+ / D- pin of the PMIC chip 21 or the D+ / D- pin of the AP chip 23.

[0118] This implementation method enables control of the switching components through the ports of existing modules without increasing hardware costs, and it is easy to implement.

[0119] Optionally, the method further includes:

[0120] When the electronic device is detected to be disconnected from the power supply device, the GPIO port is controlled to output the second level to control the stationary terminal of the switching component to connect to the second moving terminal;

[0121] When the electronic device is detected to be disconnected from the external device, the GPIO port is controlled to output the first level to control the stationary terminal of the switching component to connect to the first moving terminal.

[0122] In some embodiments, if one of the power supply device and external device connected to the electronic device is disconnected, a corresponding level control switch component can be output through the GPIO port based on the currently remaining connected device, so that the corresponding processing chip of the electronic device can communicate with the currently connected device through the data port of the peripheral interface.

[0123] For example, when the electronic device detects that a power supply device has been unplugged based on the disappearance of the VBUS voltage, it returns to a non-charging state. It can also control the GPIO pin to output a low level via software, connecting the back end of the switching component to the D+ / D- pins of the AP chip. The D+ / D- pin signals remain on the AP chip side until the next power supply device connection is detected, at which point the switching is initiated. Similarly, if the connection status of the CC1 / CC2 pins detects that an external device has been unplugged, it returns to a state without external device connection. It can also control the GPIO pin to output a high level via software, connecting the back end of the switching component to the D+ / D- pins of the PMIC chip. The D+ / D- pin signals remain on the PMIC chip side until the next external device connection is detected, at which point the switching is initiated.

[0124] In this way, even if the electronic device is disconnected from one of the devices, the communication processing logic can be restored to the state when connected to a single device by controlling the output level of the GPIO pin.

[0125] The following example, using a mobile phone communicating with a charger and a USB flash drive via a docking station, illustrates the specific processing logic in different scenarios, with reference to Figure 2:

[0126] Scenario 1: The phone is connected to the docking station, then the charger is connected first, followed by the USB flash drive.

[0127] 1) The phone connects to the charger via VBUS on the Type-C port. It detects that the USB flash drive is not yet inserted by checking the connection status of the CC1 / CC2 pins. The phone's program controls the GPIO pins to output a high level, connecting the back end of the switching component to the D+ / D- pins of the PMIC chip. The D+ / D- pins of the charging PMIC chip inside the phone are then connected to the D+ / D- pins of the charger. Following the UFCS protocol handshake process, the phone sends a message on the D+ / D- pins to initiate a UFCS protocol handshake with the charger. A successful handshake initiates UFCS fast charging.

[0128] 2) When the USB flash drive is connected, the phone detects the change in the CC1 / CC2 pin status via the PMIC, receives information from the USB flash drive peripheral, and detects the USB flash drive connection. At this point, it waits for the charger's UFCS protocol handshake to complete. After the handshake is successful and UFCS fast charging is initiated, if the charger's output voltage and current have reached the range requested by the phone, it indicates that the charging voltage and current adjustment is complete. The phone sends a Config_Watchdog message on the D+ / D- pins, configuring the watchdog timer overflow time to 0, thereby notifying the charger to temporarily disable watchdog monitoring and not handle communication timeouts. Then, a control message is sent, setting Bit1…Bit0 of the data content field to 1, notifying the charger to maintain the current voltage and current without change to maintain the current charging state. Then, the phone program controls the GPIO pins to output a low level, connecting the back end of the switching component to the D+ / D- pins of the AP chip. At this time, the D+ / D- pins of the AP chip and the D+ / D- pins of the USB flash drive are connected.

[0129] 3) After the control switch assembly is connected to the D+ / D- pins of the AP chip, the mobile phone program will notify the USB module's driver code, triggering the USB module to perform an enumeration operation and begin recognizing the external USB flash drive. After the external USB flash drive is recognized, the USB module will return a successful recognition status to the charging module driver to continue subsequent operations.

[0130] 4) After the USB module enumeration completes and notifies the charging module, the USB module driver code in the phone program will temporarily suspend the USB flash drive process. Then, the phone program controls the GPIO pin to output a high level, connecting the back end of the switching component to the D+ / D- pins of the PMIC chip. Next, the phone program sends a Config_Watchdog message, reconfiguring the watchdog timer overflow time to 1 second. The charger receives this message on the D+ / D- pins and resumes watchdog monitoring. Then, a control message is sent, automatically setting Bits 1…0 of the data content to 0, notifying the charger to remove the restriction. At this point, the charger's output voltage and current can be modified. Following the protocol standard, the phone sends voltage and current request messages to the charger, which adjusts the charging voltage and current accordingly. The electronic device can also read and monitor the charging status through other monitoring message packets.

[0131] 5) When a user operates the USB flash drive, such as attempting to open it on a mobile phone, the USB module driver on the phone sends a notification to the charging module driver. The charging module driver sends a Config_Watchdog message, configuring the watchdog timer overflow time to 0, thereby notifying the charger to temporarily disable watchdog monitoring and temporarily suspend communication timeout handling. Then, a control message is sent, setting Bit1...Bit0 of the data content field to 1, notifying the charger to maintain the current voltage and current without change, thus maintaining the current charging state. Afterwards, the mobile phone program controls the GPIO pin to output a low level, connecting the back end of the switching component to the D+ / D- pins of the AP chip. After switching control to the peripheral, the charging module replies to the USB module, resuming the previously suspended USB flash drive operation process. The phone begins transferring data to or copying data from the USB flash drive. After the data transfer operation is complete, the USB module sends its current status to the charging module. Upon receiving the status notification, the charging module suspends the USB flash drive operation process again and restarts charging communication according to step 4).

[0132] 6) When the next USB drive operation command is received, repeat step 5) to complete one round of data communication.

[0133] 7) Finally, when one device is unplugged, for example, when the charger is detected as unplugged by the disappearance of the VBUS voltage, the charging module initializes its state and returns to the non-charging state. The mobile phone program controls the GPIO pin to output a low level, connecting the back end of the switching component to the D+ / D- pin of the AP chip. The D+ / D- signal then remains on the AP chip side until the charger is detected again, at which point the switching occurs. A similar process occurs if the USB flash drive is detected as unplugged via the CC1 / CC2 connection status. In this case, the USB module initializes its state and returns to the state of no external device connection. The mobile phone program controls the GPIO pin to output a high level, connecting the back end of the switching component to the D+ / D- pin of the PMIC chip. The D+ / D- signal then remains on the PMIC chip side until the external USB flash drive is detected again, at which point the switching occurs according to steps 2) to 6).

[0134] Scenario 2: The phone is connected to the docking station, then the USB flash drive is connected first, followed by the charger.

[0135] 1) The phone detects the USB flash drive connection via the connection status of the CC1 / CC2 pins, but there is no voltage on the VBUS pin, indicating the charger is not connected. At this time, the phone's program controls the GPIO pins to output a low level, defaulting to switching the D+ / D- switch control to the USB flash drive side. The phone's USB module then receives the USB flash drive connection notification, and the phone's D+ / D- pins connect normally with the USB flash drive's D+ / D- pins. This triggers the USB module to perform an enumeration operation to begin recognizing the external USB flash drive device. After the external USB flash drive device recognition is complete, the USB module returns a successful recognition status to the charging module before proceeding with subsequent operations.

[0136] 2) When the charger is connected, the phone detects the charging voltage on VBUS, indicating that the charger is connected. Upon detecting this, the phone first waits for the current USB drive operation to finish. Then, the USB module suspends the USB drive control process and sends a notification to the charging module. At this point, the phone program controls the GPIO pins to output a high level, connecting the back end of the switching component to the D+ / D- pins of the PMIC chip. Next, following the UFCS protocol handshake process, the phone program sends messages on the D+ / D- pins to initiate a UFCS protocol handshake with the charger. A successful handshake initiates UFCS fast charging. The Config_Watchdog message is set, configuring the watchdog timer overflow time to 1 second, and the charger begins normal watchdog monitoring. A control message is then sent, setting Bits 1…Bit 0 of the data content field to 0, notifying the charger that there are no restrictions. At this point, the charger's output voltage and current can be modified. Following the protocol standard, the phone sends voltage and current request messages to the charger, which adjusts the charging voltage and current. The electronic device also reads and monitors the charging status through other monitoring message packets.

[0137] 3) If the two are connected at the same time, the operation steps are the same as steps 5) to 7) in scenario one, and the same set of logic is used to handle the case where the two are connected at the same time.

[0138] Scenario 3: First connect the charger and USB flash drive to the docking station, then connect the docking station to the phone.

[0139] 1) The docking station determines that the USB flash drive and charger are connected simultaneously based on the connection status of the CC1 / CC2 pins and the voltage status on VBUS. At this time, the mobile phone program defaults to controlling the GPIO pin to output a high level, connecting the back end of the switching component to the D+ / D- pins of the PMIC chip. The D+ / D- pins of the mobile phone and the charger are normally connected, and the handshake process of the UFCS protocol standard is prioritized. Messages are sent on the D+ / D- pins to perform the UFCS protocol handshake between the mobile phone and the charger. After a successful handshake, the UFCS protocol fast charging begins.

[0140] 2) If both devices are connected simultaneously, the scenario is similar to scenario one. Therefore, the operation steps 2) to 7) of scenario one will be followed to complete the identification of the USB flash drive and the subsequent charging and data transmission time-sharing multiplexing functions.

[0141] Based on the above embodiments, this application presents a hardware structure design scheme for an electronic device, along with a corresponding protocol control flow, to simultaneously achieve UFCS fast charging and data communication with peripherals. By time-division multiplexing the D+ and D- pins, the user's need for UFCS fast charging can be met, while also enabling normal data communication with peripherals such as USB flash drives, and file data transfer.

[0142] The charging control method in this embodiment involves an electronic device connected to a power supply and an external device. The electronic device sends a first control message or a second control message to the power supply through its data port. When there is no data transmission requirement between the electronic device and the external device, the first control message is sent to the power supply through the data port, instructing the power supply to communicate with the electronic device via fast charging through the data port. When there is a data transmission requirement between the electronic device and the external device, the second control message is sent to the power supply through the data port, and then data transmission occurs between the electronic device and the external device via the data port. The second control message instructs the power supply to maintain charging parameters. Thus, when the electronic device is simultaneously connected to both a power supply and an external device, different control messages can be sent to the power supply depending on whether there is a data transmission requirement between the electronic device and the external device. This allows the power supply to communicate with the electronic device via fast charging or maintain the current charging parameters without exiting fast charging mode, ensuring that fast charging power is maintained even when fast charging and external device connection are active simultaneously, thus preventing a decrease in charging efficiency.

[0143] Please refer to Figure 3, which is a flowchart of a charging control method provided in an embodiment of this application. The method is executed by a power supply device connected to an electronic device, which is also connected to an external device. As shown in Figure 3, the method includes the following steps:

[0144] Step 301: Upon receiving the first control message sent by the electronic device, cancel the charging parameter adjustment restriction;

[0145] Step 302: Upon receiving the second control message sent by the electronic device, enable the charging parameter adjustment restriction.

[0146] Optionally, the method further includes:

[0147] Upon receiving a watchdog configuration message from the electronic device instructing the watchdog function to be enabled, the watchdog function is enabled.

[0148] Upon receiving a watchdog configuration message from the electronic device instructing the watchdog function to be disabled, the watchdog function is disabled.

[0149] Optionally, the value of the target bit of the data content field carried in the first control message is a first value;

[0150] The target bit value of the data content field carried in the second control message is the second value.

[0151] Optionally, the watchdog configuration message used to indicate that the watchdog function is enabled configures the watchdog timer's overflow time to be a first duration, and the watchdog configuration message used to indicate that the watchdog function is disabled configures the watchdog timer's overflow time to be 0.

[0152] It should be noted that this embodiment is an implementation method on the power supply equipment side corresponding to the embodiment shown in Figure 1. For specific implementation methods, please refer to the relevant descriptions in the embodiment shown in Figure 1. To avoid repetition, it will not be repeated here.

[0153] In the charging control method of this application embodiment, a power supply device is connected to an electronic device, which is also connected to an external device. Upon receiving a first control message from the electronic device, the power supply device cancels the charging parameter adjustment restriction; upon receiving a second control message from the electronic device, it enables the charging parameter adjustment restriction. Thus, when the electronic device is simultaneously connected to both the power supply device and the external device, the power supply device can determine whether to cancel or enable the charging parameter adjustment restriction based on the received control messages, ensuring that it does not exit fast charging mode. This maintains the fast charging power even when fast charging and connecting to external devices simultaneously, preventing a decrease in charging efficiency.

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

[0155] Please refer to Figure 4, which is a schematic diagram of the structure of the charging control device provided in an embodiment of this application. The charging control device is installed in an electronic device, which is connected to a power supply device and an external device. As shown in Figure 4, the charging control device 400 includes:

[0156] The sending module 401 is used to send a first control message or a second control message to the power supply device through the data port of the electronic device;

[0157] In the case where there is no data transmission requirement between the electronic device and the external device, the sending module 401 sends a first control message to the power supply device through the data port. The first control message is used to instruct the power supply device and the electronic device to perform fast charging communication through the data port.

[0158] When a data transmission requirement is detected between the electronic device and the external device, the sending module 401 sends a second control message to the power supply device through the data port, and then transmits data with the external device through the data port. The second control message is used to instruct the power supply device to maintain the charging parameters.

[0159] Optionally, the sending module 401 is also used for:

[0160] When there is a data transmission requirement between the electronic device and the external device, a watchdog configuration message is sent to the power supply device. This watchdog configuration message instructs the power supply device to disable the watchdog function. The watchdog function is used to exit fast charging mode if there is no fast charging protocol communication between the power supply device and the electronic device within a preset time period.

[0161] Optionally, the sending module 401 is also used for:

[0162] When the electronic device is only connected to the power supply device, it can communicate with the power supply device for fast charging through the data port;

[0163] Upon detecting the external device, after sending the second control message to the power supply device through the data port, communication is established with the external device through the data port to establish a connection with the external device.

[0164] Optionally, the sending module 402 is also used for:

[0165] Upon detecting the external device, communication is established with the external device via the data port to establish a connection with the external device;

[0166] Upon detecting the power supply device, communication is established with the power supply device via the data port to establish a connection with the power supply device.

[0167] Optionally, the sending module 401 is also used for:

[0168] When both the power supply device and the external device are detected simultaneously, communication is established with the power supply device through the data port to establish a connection with the power supply device;

[0169] The second control message is sent to the power supply equipment through the data port;

[0170] The device communicates with the external device through the data port to establish a connection with the external device.

[0171] Optionally, the electronic device includes a power management integrated circuit, a switching component, and an application processing module. The stationary terminal of the switching component is connected to the data port of the peripheral interface of the electronic device, the first moving terminal of the switching component is connected to the data port of the power management integrated circuit, the second moving terminal of the switching component is connected to the data port of the application processing module, and the communication port of the power management integrated circuit is connected to the communication port of the peripheral interface.

[0172] The charging control device 400 also includes:

[0173] The first control module is used to control the stationary end of the switch assembly to connect to the first moving end when there is no data transmission requirement between the electronic device and the external device, so that the power management integrated circuit can communicate with the power supply device for charging through the data port of the peripheral interface.

[0174] The second control module is used to control the stationary end of the switch assembly to connect to the second moving end when there is a data transmission requirement between the electronic device and the external device, so that the application processing module can communicate with the external device through the data port of the peripheral interface.

[0175] Optionally, the control terminal of the switch assembly is connected to the general purpose input / output (GPIO) port of the application processing module; the first control module is used to control the GPIO port to output a first level so as to control the stationary terminal of the switch assembly to connect to the first moving terminal;

[0176] The second control module is used to control the GPIO port to output a second level, so as to control the stationary terminal of the switch component to connect to the second moving terminal.

[0177] Optionally, the value of the target bit of the data content field carried in the first control message is a first value;

[0178] The target bit value of the data content field carried in the second control message is the second value.

[0179] The charging control device 400 in this embodiment of the application includes an electronic device connected to a power supply and an external device. The device sends a first control message or a second control message to the power supply through a data port. When there is no data transmission requirement between the electronic device and the external device, the first control message is sent to the power supply through the data port, instructing the power supply to communicate with the electronic device via fast charging through the data port. When there is a data transmission requirement between the electronic device and the external device, the second control message is sent to the power supply through the data port, and then data transmission occurs between the electronic device and the external device via the data port. The second control message instructs the power supply to maintain charging parameters. Thus, when the electronic device is simultaneously connected to both a power supply and an external device, different control messages can be sent to the power supply depending on whether there is a data transmission requirement between the electronic device and the external device. This allows the power supply to communicate with the electronic device via fast charging or maintain the current charging parameters without exiting fast charging mode, ensuring that fast charging power is maintained even when fast charging and external device connection are active simultaneously, thus preventing a decrease in charging efficiency.

[0180] The charging 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 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 set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.

[0181] The charging control device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.

[0182] The charging control device provided in this application embodiment can implement all the processes implemented in the method embodiment of FIG1 and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0183] Please refer to Figure 5, which is a schematic diagram of the structure of the charging control device provided in this embodiment. The charging control device is installed in a power supply device, which is connected to an electronic device. The electronic device is also connected to an external device. As shown in Figure 5, the charging control device 500 includes:

[0184] Execution module 501 is used for:

[0185] Upon receiving the first control message sent by the electronic device, the charging parameter adjustment restriction is lifted;

[0186] Upon receiving a second control message from the electronic device, the limitation on canceling charging parameter adjustment is enabled.

[0187] Optionally, execution module 501 is also used for:

[0188] Upon receiving a watchdog configuration message from the electronic device instructing the watchdog function to be enabled, the watchdog function is enabled.

[0189] Upon receiving a watchdog configuration message from the electronic device instructing the watchdog function to be disabled, the watchdog function is disabled.

[0190] Optionally, the value of the target bit of the data content field carried in the first control message is a first value;

[0191] The target bit value of the data content field carried in the second control message is the second value.

[0192] The charging control device 500 in this embodiment connects a power supply device to an electronic device, which is also connected to an external device. Upon receiving a first control message from the electronic device, the power supply device cancels the charging parameter adjustment restriction; upon receiving a second control message from the electronic device, it enables the charging parameter adjustment restriction. Thus, when the electronic device is simultaneously connected to both the power supply device and the external device, the power supply device can determine whether to cancel or enable the charging parameter adjustment restriction based on the received control messages, ensuring that it does not exit fast charging mode. This maintains the fast charging power even when fast charging and connecting external devices simultaneously, preventing a decrease in charging efficiency.

[0193] Optionally, as shown in FIG6, this application embodiment also provides an electronic device 600, including a processor 601 and a memory 602. The memory 602 stores a program or instructions that can run on the processor 601. When the program or instructions are executed by the processor 601, they implement the various steps of the above-described charging control method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0194] 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.

[0195] Figure 7 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of this application.

[0196] The electronic device 700 includes, but is not limited to, components such as: radio frequency unit 701, network module 702, audio output unit 703, input unit 704, sensor 705, display unit 706, user input unit 707, interface unit 708, memory 709, and processor 710.

[0197] Those skilled in the art will understand that the electronic device 700 may also include a power supply (such as a battery) for powering various components. The power supply can be logically connected to the processor 710 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The electronic device structure shown in Figure 7 does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0198] The electronic device is connected to a power supply and external devices. The processor 710 is used for:

[0199] The electronic device sends a first control message or a second control message to the power supply device through its data port.

[0200] In the case where there is no data transmission requirement between the electronic device and the external device, a first control message is sent to the power supply device through the data port. The first control message is used to instruct the power supply device and the electronic device to perform fast charging communication through the data port.

[0201] When there is a data transmission requirement between the electronic device and the external device, after sending a second control message to the power supply device through the data port, data transmission is performed with the external device through the data port. The second control message is used to instruct the power supply device to maintain the charging parameters.

[0202] Optionally, the processor 710 is also used for:

[0203] When there is a data transmission requirement between the electronic device and the external device, a watchdog configuration message is sent to the power supply device. The watchdog configuration message is used to instruct the power supply device to disable the watchdog function. The watchdog function is used to exit the fast charging mode when there is no fast charging protocol communication between the power supply device and the electronic device within a preset time period.

[0204] Optionally, the processor 710 is also used for:

[0205] When the electronic device is only connected to the power supply device, it can communicate with the power supply device for fast charging through the data port;

[0206] Upon detecting the external device, after sending the second control message to the power supply device through the data port, communication is established with the external device through the data port to establish a connection with the external device.

[0207] Optionally, the processor 710 is also used for:

[0208] Upon detecting the external device, communication is established with the external device via the data port to establish a connection with the external device;

[0209] Upon detecting the power supply device, communication is established with the power supply device via the data port to establish a connection with the power supply device.

[0210] Optionally, the processor 710 is also used for:

[0211] When both the power supply device and the external device are detected simultaneously, communication is established with the power supply device through the data port to establish a connection with the power supply device;

[0212] The second control message is sent to the power supply equipment through the data port;

[0213] The device communicates with the external device through the data port to establish a connection with the external device.

[0214] Optionally, the electronic device includes a power management integrated circuit, a switching component, and an application processing module. The stationary terminal of the switching component is connected to the data port of the peripheral interface of the electronic device, the first moving terminal of the switching component is connected to the data port of the power management integrated circuit, the second moving terminal of the switching component is connected to the data port of the application processing module, and the communication port of the power management integrated circuit is connected to the communication port of the peripheral interface.

[0215] The processor 710 is also used for:

[0216] When there is no data transmission requirement between the electronic device and the external device, the stationary end of the switch assembly is connected to the first moving end, so that the power management integrated circuit can communicate with the power supply device for charging through the data port of the peripheral interface;

[0217] When there is a data transmission requirement between the electronic device and the external device, the stationary end of the switch assembly is connected to the second moving end, so that the application processing module can communicate with the external device through the data port of the peripheral interface.

[0218] Optionally, the control terminal of the switch assembly is connected to the general purpose input / output (GPIO) port of the application processing module;

[0219] The processor 710 is also used for:

[0220] The GPIO port is controlled to output a first level, so as to control the stationary terminal of the switching component to connect to the first moving terminal;

[0221] The GPIO port is controlled to output a second level, so as to control the stationary terminal of the switching component to connect to the second moving terminal.

[0222] Optionally, the value of the target bit of the data content field carried in the first control message is a first value;

[0223] The target bit value of the data content field carried in the second control message is the second value.

[0224] It should be understood that, in this embodiment, the input unit 704 may include a graphics processing unit (GPU) 7041 and a microphone 7042. The GPU 7041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 706 may include a display panel 7061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

[0225] The memory 709 can be used to store software programs and various data. The memory 709 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 709 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 709 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0226] Processor 710 may include one or more processing units; optionally, processor 710 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 710.

[0227] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described charging control method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.

[0228] 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.

[0229] 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 charging control method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0230] 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.

[0231] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the charging control method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0232] 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.

[0233] 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 prior art, 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.

[0234] 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.

Claims

1. A charging control method, executed by an electronic device, said electronic device being connected to a power supply device and an external device, said method comprising: The electronic device sends a first control message or a second control message to the power supply device through its data port. In the case where there is no data transmission requirement between the electronic device and the external device, a first control message is sent to the power supply device through the data port. The first control message is used to instruct the power supply device and the electronic device to perform fast charging communication through the data port. When there is a data transmission requirement between the electronic device and the external device, after sending a second control message to the power supply device through the data port, data transmission is performed with the external device through the data port. The second control message is used to instruct the power supply device to maintain the charging parameters.

2. The method according to claim 1, further comprising: When there is a data transmission requirement between the electronic device and the external device, a watchdog configuration message is sent to the power supply device. The watchdog configuration message is used to instruct the power supply device to disable the watchdog function. The watchdog function is used to exit the fast charging mode when there is no fast charging protocol communication between the power supply device and the electronic device within a preset time period.

3. The method according to claim 1, further comprising: When the electronic device is only connected to the power supply device, it can communicate with the power supply device for fast charging through the data port; Upon detecting the external device, after sending the second control message to the power supply device through the data port, communication is established with the external device through the data port to establish a connection with the external device.

4. The method according to claim 1, further comprising: Upon detecting the external device, communication is established with the external device via the data port to establish a connection with the external device; Upon detecting the power supply device, communication is established with the power supply device via the data port to establish a connection with the power supply device.

5. The method according to claim 1, further comprising: When both the power supply device and the external device are detected simultaneously, communication is established with the power supply device through the data port to establish a connection with the power supply device; The second control message is sent to the power supply equipment through the data port; The device communicates with the external device through the data port to establish a connection with the external device.

6. The method according to claim 1, wherein, The electronic device includes a power management integrated circuit, a switching component, and an application processing module. The stationary terminal of the switching component is connected to the data port of the peripheral interface of the electronic device. The first moving terminal of the switching component is connected to the data port of the power management integrated circuit. The second moving terminal of the switching component is connected to the data port of the application processing module. The communication port of the power management integrated circuit is connected to the communication port of the peripheral interface. The electronic device and the power supply device communicate via the data port for fast charging, including: The stationary end of the switch assembly is connected to the first moving end, so that the power management integrated circuit can communicate with the power supply device for fast charging through the data port of the peripheral interface; The electronic device and the external device transmit data through the data port, including: The stationary end of the switch assembly is connected to the second moving end, so that the application processing module can communicate with the external device through the data port of the peripheral interface.

7. The method according to claim 6, wherein, The control terminal of the switch assembly is connected to the general purpose input / output (GPIO) port of the application processing module; the stationary terminal controlling the switch assembly is connected to the first moving terminal, including: The GPIO port is controlled to output a first level, so as to control the stationary terminal of the switching component to connect to the first moving terminal; The control of the stationary terminal of the switch assembly to connect to the second moving terminal includes: The GPIO port is controlled to output a second level, so as to control the stationary terminal of the switching component to connect to the second moving terminal.

8. The method according to claim 1, wherein, The target bit value of the data content field carried in the first control message is a first value; The target bit value of the data content field carried in the second control message is the second value.

9. A charging control method, executed by a power supply device, the power supply device being connected to an electronic device, the electronic device being further connected to an external device, the method comprising: Upon receiving the first control message sent by the electronic device, the charging parameter adjustment restriction is lifted; Upon receiving a second control message from the electronic device, the charging parameter adjustment restriction is enabled.

10. A charging control device, disposed in an electronic device, the electronic device being connected to a power supply device and an external device, the charging control device comprising: The transmitting module is used to send a first control message or a second control message to the power supply device through the data port of the electronic device; In the case where there is no data transmission requirement between the electronic device and the external device, the sending module sends a first control message to the power supply device through the data port. The first control message is used to instruct the power supply device and the electronic device to perform fast charging communication through the data port. When there is a data transmission requirement between the electronic device and the external device, the sending module sends a second control message to the power supply device through the data port, and then transmits data with the external device through the data port. The second control message is used to instruct the power supply device to maintain the charging parameters.

11. A charging control device, disposed in a power supply device, the power supply device being connected to an electronic device, the electronic device being further connected to an external device, the charging control device comprising: The execution module is configured to cancel the charging parameter adjustment restriction upon receiving a first control message from the electronic device, and to enable the charging parameter adjustment restriction upon receiving a second control message from the electronic device.

12. An electronic device comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the charging control method as claimed in any one of claims 1 to 8.

13. A power supply device, comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the charging control method of claim 9.

14. A readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the charging control method as described in any one of claims 1 to 8, or implement the steps of the charging control method as described in claim 9.

Citation Information

Patent Citations

  • Method, system, and device for charging terminal device

    CN107425570A

  • Charging control method and device, electronic equipment and charger

    CN112769196A

  • Charging control method, charging control device and storage medium

    CN115441522A

  • Charging control method and device, electronic equipment and power supply equipment

    CN118300230A

  • Electronic device and control method thereof

    US20170033558A1