Charging Control Method, Charging Control Device and Storage Medium
By detecting and determining the supported charging protocol between the charging device and the power supply device, and sending charging control instructions, the problem of lack of universality between the existing fast charging technology protocols is solved, and a simpler and more general charging control method is achieved.
Patent Information
- Application Number
- CN202110613939.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-02
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2041-06-02
AI Technical Summary
The lack of universality between existing fast charging technology protocols has led to the fact that charging equipment from different manufacturers can only be compatible with power supply equipment from their own manufacturers, and the communication methods are complex and cumbersome.
By establishing a communication connection between the charging device and the power supply device, detecting and determining the charging protocol supported by both parties. If the preset protocol is supported, a charging control command is sent to instruct the power supply device to charge.
The charging control process is simplified, the charging process between the charging device and the power supply device is improved, and the charging process between the charging device and the power supply device is more convenient and efficient.
Smart Images

Figure CN115441522B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of electronic technologies, and in particular, to a charging control method, a charging control device, and a storage medium. Background Art
[0002] With the rapid development of the fast charging technology of mobile terminals, especially the fast charging technology of smart phones, many fast charging technology protocols for mobile terminals have emerged in the market. For example, the fast charging technology protocol may include: Fast Charge Protocol (FCP for short), Super Charge Protocol (SCP for short), VOOC flash charging protocol, etc. Different manufacturers specify different fast charging technology protocols, resulting in the lack of generality among the fast charging technology protocols, which are only for the use of their own manufacturers.
[0003] In the prior art, the Power Delivery (PD) protocol and the Quick Charge (QC) protocol have relatively high generality. However, the communication methods adopted by the above two protocols are relatively complex, and the implementation methods are too cumbersome. Summary of the Invention
[0004] To overcome the problems existing in the related art, the present disclosure provides a charging control method, a charging control device, and a storage medium.
[0005] According to the first aspect of the embodiments of the present disclosure, a charging control method is provided. The charging control method includes: detecting a charging protocol in response to the establishment of a communication connection between the charging device and the power supply device. If it is determined that both the charging device and the power supply device support a preset charging protocol, a charging control instruction for controlling the charging is determined. The charging control instruction is sent to the power supply device to instruct the power supply device to charge the charging device.
[0006] In an embodiment, the sending the charging control instruction to the power supply device includes: determining a physical layer data frame for sending the charging control instruction to the power supply device, where the physical layer data frame includes a start bit, a data bit, and an end bit. Based on the change of the data bits from low to high in the physical layer data frame, the charging control instruction is sent to the power supply device.
[0007] In another embodiment, sending the charging control instruction to the power supply device includes: determining a physical layer data packet for sending the charging control instruction to the power supply device, where the physical layer data packet includes data information and control information. The data information includes a message header, data length, data, and a data verification function, and the control information includes a message header, a control command, and a data verification function. Based on the physical layer data packet, send the data information and the control information from the high byte to the low byte, and send the charging control instruction to the power supply device.
[0008] In yet another embodiment, determining that the charging protocols supported by the charging device and the power supply device are preset charging protocols includes: if, within a first time period, the level signal change sequences of the D- data line of the charging device and the D+ data line of the power supply device both satisfy a specified pulse sequence, and within a second time period, the level signal output by the D- data line or the level signal output by the D+ data line is a target level, then determine that the charging protocols supported by the charging device and the power supply device are preset charging protocols.
[0009] In yet another embodiment, the charging control method further includes: determining a third time period, where the third time period is the time when the target level is not detected in the D- data line of the charging device or the time when the target level is not detected in the D+ data line of the power supply device within the second time period. If the third time period is greater than or equal to a specified time window, then determine the number of detections that the level signal of the D- data line does not output the target level within the second time period, or determine the number of detections that the level signal of the D+ data line does not output the target level within the second time period, and determine the charging protocols supported by the charging device and the power supply device based on the number of detections. If the third time period is less than the specified time window, then continue to detect the level signal output by the D- data line within the second time period, or the level signal output by the D+ data line within the second time period.
[0010] In yet another embodiment, determining the charging protocols supported by the charging device and the power supply device based on the number of detections includes: if the number of detections is less than a detection number threshold, then re-determine the level signal change sequence of the D- data line or the level signal change sequence of the D+ data line. If the number of detections is greater than or equal to the detection number threshold, and the level signal of the D- data line or the level signal of the D+ data line does not output the target level within the second time period, then determine that both the charging device and the power supply device support the default charging protocol.
[0011] In yet another embodiment, the charging control method further includes: initializing the level signal states of the D+ data line and the D- data line of the charging device through a hardware reset.
[0012] According to a second aspect of the embodiments of the present disclosure, a charging control device is provided. The charging control device includes: a detection unit configured to perform a charging protocol detection in response to establishing a communication connection between the charging device and the power supply device. A determination unit configured to determine a charging control instruction for controlling charging if it is determined that both the charging device and the power supply device support a preset charging protocol. An indication unit configured to send the charging control instruction to the power supply device to instruct the power supply device to charge the charging device.
[0013] In one embodiment, the indication unit sends the charging control instruction to the power supply device in the following manner: determining a physical layer data frame used to send the charging control instruction to the power supply device, where the physical layer data frame includes a start bit, data bits, and an end bit. Based on the change of the data bits of the physical layer data frame from the low bit to the high bit, sending the charging control instruction to the power supply device.
[0014] In another embodiment, the indication unit sends the charging control instruction to the power supply device in the following manner: determining a physical layer data packet used to send the charging control instruction to the power supply device, where the physical layer data packet includes data information and control information. The data information includes a message header, a data length, data, and a data check function, and the control information includes a message header, a control command, and a data check function. Based on sending the data information and the control information of the physical layer data packet from the high byte to the low byte, sending the charging control instruction to the power supply device.
[0015] In yet another embodiment, the determination unit determines that the charging protocol supported by the charging device and the power supply device is a preset charging protocol in the following manner: if within a first time, the level signal change sequences of the D- data line of the charging device and the D+ data line of the power supply device both satisfy a specified pulse sequence, and within a second time, the level signal output by the D- data line or the level signal output by the D+ data line is a target level, then determining that the charging protocol supported by the charging device and the power supply device is a preset charging protocol.
[0016] In another embodiment, the determining unit is further configured to: determine a third time, where the third time is the time when the target level is not detected on the D- data line of the charging device or the time when the target level is not detected on the D+ data line of the power supply device within the second time. If the third time is greater than or equal to the specified time window, determine the number of times the level signal of the D- data line does not output the target level within the second time, or determine the number of times the level signal of the D+ data line does not output the target level within the second time, and determine the charging protocol supported by the charging device and the power supply device based on the number of detections. If the third time is less than the specified time window, continue to detect the level signal output by the D- data line within the second time, or the level signal output by the D+ data line within the second time.
[0017] In another embodiment, the determining unit determines the charging protocol supported by the charging device and the power supply device based on the number of detections in the following manner: If the number of detections is less than the detection number threshold, re-determine the change sequence of the level signal of the D- data line or the change sequence of the level signal of the D+ data line. If the number of detections is greater than or equal to the detection number threshold, and the level signal of the D- data line or the level signal of the D+ data line does not output the target level within the second time, determine that both the charging device and the power supply device support the default charging protocol.
[0018] In another embodiment, the charging control device further includes: a reset unit configured to initialize the level signal state of the D+ data line and the level signal state of the D- data line of the charging device through hardware reset.
[0019] According to a third aspect of the embodiments of the present disclosure, there is provided a charging control device, characterized in that the charging control device includes: a memory for storing instructions; and a processor for calling the instructions stored in the memory to execute the charging control method provided in any of the above embodiments.
[0020] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium storing computer-executable instructions, and when the computer-executable instructions are executed by a processor, the charging control method provided in any of the above embodiments is executed.
[0021] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: Through the charging control method provided by the present disclosure, during the communication connection between the charging device and the power supply device, after determining to charge using the preset charging protocol, it is possible to control the power supply device to charge the charging device according to the determined charging control instruction, thereby making the charging control method simpler and more general.
[0022] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.
[0024] Figure 1 is a flowchart of a charging control method shown according to an exemplary embodiment.
[0025] Figure 2 is a schematic diagram of a physical layer data frame structure shown according to an exemplary embodiment.
[0026] Figure 3 is a schematic diagram of a data message structure shown according to an exemplary embodiment.
[0027] Figure 4 is a schematic diagram of a control message structure shown according to an exemplary embodiment.
[0028] Figure 5 is a flowchart of another charging control method shown according to an exemplary embodiment.
[0029] Figure 6 is a schematic diagram of a pulse sequence shown according to an exemplary embodiment.
[0030] Figure 7 is a schematic diagram of another pulse sequence shown according to an exemplary embodiment.
[0031] Figure 8 is a flowchart of yet another charging control method shown according to an exemplary embodiment.
[0032] Figure 9 is a flowchart of yet another charging control method shown according to an exemplary embodiment.
[0033] Figure 10 is a flowchart of a method for detecting a charging protocol shown according to an exemplary embodiment.
[0034] Figure 11 is a flowchart of yet another charging control method shown according to an exemplary embodiment.
[0035] Figure 12 is a schematic diagram of a level signal shown according to an exemplary embodiment.
[0036] Figure 13It is a flowchart of yet another charging control method shown according to an exemplary embodiment.
[0037] Figure 14 It is a block diagram of a charging control device shown according to an exemplary embodiment.
[0038] Figure 15 It is a block diagram of another charging control device shown according to an exemplary embodiment.
[0039] Figure 16 It is a block diagram of yet another charging control device shown according to an exemplary embodiment. Detailed implementation
[0040] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0041] In the related art, the charging device and the power supply device are communicatively connected through a Configuration Channel (CC) line. When charging according to the charging protocol, the charging device determines the input voltage input by the power supply device based on the input voltages at both ends of the D+ data line and the D- data line, and then determines the required charging voltage, thereby adjusting the input voltage of the power supply device to control the power supply device to charge the charging device. For example: when the input voltages at both ends of the D+ data line and the D- data line are both 0.6V, it is determined to charge with the first charging voltage. If the input voltage of the D+ data line is 0.6V and the input voltage of the D- data line is 0.3V, it is determined to charge with the second charging voltage. However, when charging in this way, the communication method used is relatively complex, and communication needs to be carried out in a half-duplex working mode, which reduces the occurrence of errors when communicating on the physical layer channel, resulting in a very complex communication method and communication data packet format, and it is not universal.
[0042] In view of this, the present disclosure provides a charging control method. When the charging device and the power supply device are communicatively connected and it is determined that charging needs to be carried out according to a preset charging protocol, the power supply device can be controlled to charge the charging device through a charging control instruction, thereby reducing the complexity of the charging control process, simplifying the communication process, and enhancing the universality of the charging control.
[0043] In some examples, the charging control method provided by the present disclosure can be applied to a charging device. In some embodiments, the types of charging devices may include: mobile phones, tablets, iPods, laptops, etc. In other embodiments, the structure of the terminal may include: dual-screen electronic devices, foldable-screen electronic devices, full-screen electronic devices, curved-screen electronic devices, etc. In still other embodiments, the power supply device may be a charger or a charging device capable of reverse charging.
[0044] Figure 1 is a flowchart of a charging control method shown according to an exemplary embodiment. As Figure 1 shown, the charging control method includes the following steps S11 to step S13.
[0045] In step S11, in response to establishing a communication connection between the charging device and the power supply device, a charging protocol detection is performed.
[0046] In the embodiments of the present disclosure, after the charging device determines that a communication connection is established with the power supply device, when detecting the power supply voltage transmitted by the power supply device, it detects the charging protocol required for charging. In one example, the charging protocol may include the BC1.2 protocol. The BC1.2 protocol includes multiple charging modes: SDP, DCP, and CDP. The SDP mode indicates that when the charger used for the current charging is a non-standard charger, it can support a charging voltage of 5V and a maximum charging current of 500mA, and can communicate using USB2.0. The DCP mode indicates that the charger used for the current charging is a dedicated charging port, which can support a charging voltage of 5V and a charging current of 1.5A, but cannot communicate using USB2.0. The CDP mode indicates that the port used for the current charging is a high-current charging port, which can support a charging voltage of 5V and a charging current of 1.5A, and can also communicate using USB2.0.
[0047] Through the charging protocol detection, it can be determined whether the charging protocol supported by the power supply device is the same as or has the same charging protocol as that supported by the charging device. If the charging protocols supported by both are the same or have the same charging protocol, it indicates that the power supply device can charge the charging device, and then it can further detect whether the charging protocols supported by both can perform fast charging. Thus, when charging, it can be determined whether to use a charging protocol capable of fast charging or a normal charging protocol for charging. If they do not have the same charging protocol, it indicates that the power supply device cannot charge the charging device.
[0048] In step S12, if it is determined that both the charging device and the power supply device support a preset charging protocol, a charging control instruction for controlling the charging is determined.
[0049] In the embodiments of the present disclosure, the preset charging protocol can be understood as a charging protocol based on a handshake protocol for fast charging between a charging device and a power supply device. In one example, a specific charging protocol can be a charging protocol that supports fast charging. For example: the PD protocol.
[0050] If it is determined that both the charging device and the power supply device support the preset charging protocol, it indicates that the charging device and the power supply device can perform fast charging based on the preset charging protocol, and thus it can be determined to reduce the charging time and improve the user experience. Therefore, after determining that both the charging device and the power supply device support the preset charging protocol, based on the handshake protocol, a charging control instruction for controlling the charging is determined, so as to indicate through the charging control instruction that both power supply devices can use the preset charging protocol for fast charging, thereby simplifying the determination process of instructing the power supply device to determine to use the preset charging protocol to charge the charging device, and making the communication process between the two parties simpler and more convenient.
[0051] In step S13, a charging control instruction is sent to the power supply device to instruct the power supply device to charge the charging device.
[0052] In one embodiment, a full-duplex communication mode can be adopted to send a charging control instruction to the power supply device to instruct the power supply device to charge the charging device.
[0053] Through the above embodiments, after the charging device determines that the charging protocol jointly supported by the charging device and the power supply device is the preset charging protocol, it can directly instruct the power supply device to use the preset charging protocol for charging through the charging control instruction, thereby simplifying the determination process of the power supply device to determine to use the preset charging protocol to charge the charging device, making the control method of the power supply device to charge the charging device more convenient and more general. And, since the determination process of the power supply device to determine to use the preset charging protocol to charge the charging device is simplified, when instructing the power supply device to charge the charging device, it can respond quickly, which helps to achieve fast charging and improve the user experience.
[0054] In one embodiment, when the charging device sends a charging control instruction to the power supply device, it can be transmitted based on the physical layer data frame of the physical layer communication mechanism. The physical layer data frame includes a start bit (frame header), data bits (data part), and an end bit (frame tail). The logical representation method of the charging control instruction is determined in advance, and then during the data transmission process, the charging control instruction is transmitted through the data bits of the physical layer data frame. Based on the change of the data bits of the physical layer data frame from low to high during the transmission process, the charging control instruction is sent to the power supply device.
[0055] In one example, the physical layer data frame structure can be as Figure 2 shown. Figure 2It is a schematic diagram of a physical layer data frame structure shown according to an exemplary embodiment. The start bit (Start) is used to indicate the start of the transmission of the current physical layer data frame. A logical "0" low-level signal can be used to represent the start of data transmission. The data bit contains 8-bit logic, and the logic on each bit can be "0" or "1". Among them, the logical "0" represents a low-level signal, and the logical "1" represents a high-level signal. In one example, when data is transmitted on the communication bus, the least significant bit (LSB) is sent first, and then the most significant bit (MSB) is sent. The stop bit (Stop) is used to indicate the end of the transmission of the current physical layer data frame. A logical "1" high-level signal can be used to represent the end of data transmission. The idle bit (IDLE) is used to indicate the idle state. On the communication bus, when the transmission of the current physical layer data frame ends and before the next physical layer data frame is transmitted, IDLE is used for interruption to avoid transmission errors or incorrect instruction recognition during the transmission process. That is, in one frame of data, there is 1 bit of start bit, 8 bits of data bit, and 1 bit of stop bit.
[0056] In an implementation scenario, during the process of sending a physical layer data frame, when the communication bus is in the idle state, the communication bus line is at a high level. When a send instruction is received, the data transmission (TX) line is pulled low for the time of one data bit (1 bit) to start the communication. Then the data is sent in sequence from the low bit to the high bit. After the data is sent, the TX line is pulled high for the time of one data bit to stop the transmission, thus completing the transmission of one frame of data.
[0057] In another implementation scenario, during the process of receiving a physical layer data frame, when in the idle state, the communication bus line is at a high level. When a falling edge (from high level to low level) of the line is detected, it indicates that there is data transmission on the communication bus line. The data is received from the low bit to the high bit according to the agreed baud rate (also known as the modulation rate). After 8 bits of data are received, the line is pulled high, thus completing the reception of one frame of data.
[0058] In another embodiment, when the charging device sends a charging control instruction to the power supply device, it can be transmitted based on the physical layer data packet of the physical layer communication mechanism. Among them, the physical layer data packet includes data information and control information. It can be understood that a single message is divided into multiple data blocks for transmission, and the set of multiple data blocks is called a packet. The data message is the data for communication. The control information is the data for control. The data information includes a message header, a data length, data, and a data check function. The control information includes a message header, a control command, and a data check function. Among them, the data check function is used to ensure the accuracy during data transmission, thereby avoiding affecting the normal communication of the data. The charging control instruction is sent to the power supply device based on the physical layer data packet by sending the data information and the control information from the high byte to the low byte.
[0059] In one example, the structure of the data message can be as Figure 3 shown. Figure 3 FIG. is a schematic diagram of a data message structure shown according to an exemplary embodiment. Among them, S represents the start bit of the control message, Training represents a single block of data during the transmission process. E represents the stop bit of the control message, I represents an interruption, an idle state. Message Header High represents the high bit of the message header, and Message Header Low represents the low bit of the message header. The control command indicates that this segment of data is a data block used to represent the charging control instruction. Cyclic redundancy check (CRC) is a data check function. It can be used to detect or verify possible errors that may occur after data transmission or storage. The generated number is calculated before transmission or storage and appended to the data, and then the receiver checks to determine whether the data has changed. During the transmission of the data message, it is sent in sequence from the high byte to the low byte.
[0060] In an implementation scenario, when using CRC for verification, the data sender will perform a cyclic redundancy check (CRC) on the message header and the message body data to obtain a one-byte CRC value, which is added to the end of each physical layer data packet. The CRC-8 algorithm is used, and the polynomial used is: X8+X5+X3+1 (0x29). The data receiver needs to calculate the cyclic redundancy check (CRC) of the received data and compare it with the cyclic redundancy check (CRC) byte received in the physical layer data packet, thereby realizing the verification of data transmission.
[0061] In another example, the structure of the control message can be as Figure 4 shown. Figure 4It is a schematic diagram of a control message structure shown according to an exemplary embodiment. Among them, S represents the start bit of the control message, and Training represents a single block of data during the transmission process. E represents the stop bit of the control message, and I represents an interruption, an idle state. Message header high represents the high bit of the message header, and message header low represents the low bit of the message header. Data N represents the data block of the Nth bit, data N-1 represents the data block of the (N-1)th bit, and so on. Data 0 represents the data block of the 0th bit. CRC represents the data check function adopted. It can be used to detect or verify possible errors that may occur after data transmission or storage. The generated number is calculated before transmission or storage and appended to the data, and then the receiver checks to determine whether the data has changed. During the transmission of the control message, it is sent sequentially from the high byte to the low byte.
[0062] In another embodiment, when detecting the charging protocol, the charging protocols supported by the charging device and the power supply device can be determined according to the electronic tags on their respective data receiving buses (D+ data line / D- data line). The electronic tag is used to mark the charging protocol supported by its corresponding charging device or power supply support. When detecting the charging protocol, the charging protocol supported by the charging device can be determined according to the electronic tag on the data receiving bus of the charging device. According to the electronic tag on the data receiving bus of the power supply device, the charging protocol supported by the power supply device can be determined. Furthermore, based on the determined charging protocols supported by the charging device and the power supply device, the charging protocol adopted by the charging device and the power supply device during charging can be determined.
[0063] In an example, through the electronic tag, during the communication process between the charging device and the power supply device, the data receiving party belongs to the D+ data line or the D- data line. In the initial state of the electronic tag, the D+ data line at the power supply device end is the data sender, and the D- data line is the data receiver. The D+ at the charging device end is the data receiver, and the D- is the data sender. Whether it is the charging device end or the power supply device end, both the D+ data line and the D- data line support data sending and receiving. Through the electronic tag, the data receiver of the data receiving bus at each end can be determined according to the received instruction data receiving bus.
[0064] In an implementation scenario, when the D+ data line receives an instruction, the D- data line will switch to data transmission (TX), and the D+ pin will be for data reception (RX). When the D- data line receives an instruction, the D+ data line will switch to data transmission (TX) and the D- pin will switch to data reception (RX). When both the D+ data line and the D- data line receive an instruction simultaneously, the D+ data line will switch to data transmission (TX), and the D- data line will switch to data reception (RX). Both the D+ data line and the D- data line at the cable end can support data transmission and reception, and the initial states of the D+ data line and the D- data line are both data receivers.
[0065] Figure 5 is a flowchart of another charging control method shown according to an exemplary embodiment. As Figure 5 shown, the charging control method includes the following steps.
[0066] In step S21, in response to establishing a communication connection between the charging device and the power supply device, a charging protocol detection is performed.
[0067] In step S22, if within a first time period, both the level signal change sequence of the D- data line of the charging device and the level signal change sequence of the D+ data line of the power supply device satisfy a specified pulse sequence, and within a second time period, the level signal output by the D- data line or the level signal output by the D+ data line is a target level, then it is determined that the charging protocol supported by the charging device and the power supply device is a preset charging protocol.
[0068] In the embodiments of the present disclosure, to determine whether the charging protocol supported by the charging device and the power supply device is a preset charging protocol, it can be determined according to the level signal change sequences of the data reception buses at each end. During the detection process, the D- data line of the charging device and the D+ data line of the power supply device are in a short-circuited state. Therefore, the level signal of the D+ data line of the power supply device can change following the change of the level signal of the D- data line of the charging device. To determine whether the power supply device and the charging device can charge using the preset charging protocol, within a first time period, first determine whether both the level signal change sequence of the D- data line of the charging device and the level signal change sequence of the D+ data line of the power supply device satisfy the specified pulse sequence. Herein, the first time period can be characterized as a period of time interval. The specified pulse sequence can be understood as a set of specified level change sequences.
[0069] By specifying a pulse sequence, it can be determined whether charging between the charging device and the power supply device cannot be carried out using a preset charging protocol. If the level signal change sequence of the D- data line and the level signal change sequence of the D+ data line do not satisfy the specified pulse sequence, it indicates that charging between the charging device and the power supply device cannot be carried out using the preset charging protocol. If the level signal change sequence of the D- data line and the level signal change sequence of the D+ data line both satisfy the specified pulse sequence, it indicates that charging between the charging device and the power supply device may be able to be carried out using the preset charging protocol. To further determine and improve the accuracy of charging using the preset charging protocol and avoid misidentifying other charging protocols as the preset charging protocol, within the second time, the level signal output by the level signal of the D- data line or the D+ data line is determined. The start time of the second time is later than the end time of the first time. If the level signal of the D- data line or the D+ data line outputs the target level, it can be determined that the charging protocol supported by the charging device and the power supply device is the preset charging protocol. If the level signal of the D- data line or the D+ data line does not output the target level, it indicates that charging between the charging device and the power supply device cannot be carried out using the preset charging protocol. In one example, the second time can be understood as the time or a period of time after disconnecting the short circuit between the D- data line of the charging device and the power supply device and the D+ data line of the charging device and the power supply device.
[0070] In step S23, a charging control instruction for controlling charging is determined.
[0071] In step S24, the charging control instruction is sent to the power supply device to instruct the power supply device to charge the charging device.
[0072] In one embodiment, the first time may include multiple time periods. The multiple time periods may include: the 1st time period, the 2nd time period... the Nth time period, where N is any positive integer. The number of multiple time periods included within the first time can be set according to requirements. In one example, to ensure the determination process and avoid long-term verification, the first time may include four time periods. In different time periods, the specified output level signals are different. To avoid misidentification, the level signals between any two adjacent time periods are different. For example: a high level is continuously output within the 1st time period, a low level is continuously output within the 2nd time period, a high level is continuously output within the 3rd time period, and a low level is continuously output within the 4th time period. By setting the changes in high and low levels at different times, it helps to improve the error tolerance rate of determining the charging protocol, and thus increases the possibility of charging using the preset charging protocol.
[0073] The target level can be a high level or a low level. In one example, to avoid false detection, the target level can be set to the opposite level signal of the level signal output in the last time period within the first time. For example: if the level signal output in the last time period within the first time is a low level, then the target level is a high level. If the level signal output in the last time period within the first time is a high level, then the target level is a low level.
[0074] In an implementation scenario, the preset specified pulse sequence and the target level can be as Figure 6 or Figure 7 shown. Figure 6 is a schematic diagram of a pulse sequence shown according to an exemplary embodiment. Figure 7 is another schematic diagram of a pulse sequence shown according to an exemplary embodiment. Within the first time, it can include N time periods, where N is any positive integer. For ease of description, tDet1 represents the 1st time period within the first time, tDet2 represents the 2nd time period within the first time, tDet3 represents the 3rd time period within the first time, tDet n represents the nth time period within the first time, and tDet n+1 represents the (n + 1)th time period within the first time. tDet n+2 represents the second time. Among them, tDetn+1 is the last time period within the first time. The specified pulse sequence is a level sequence composed of high levels or low levels continuously output in each time period from tDet1 to tDetn+1. Taking the preset level signal continuously output in tDetn+1 as a low level and the target level as a high level as an example. During the process of detecting the charging protocol, if the level change sequences continuously output by the D+ data line and the D+ data line within the first time both satisfy the specified pulse sequence, then after tDetn+1 ends, the short circuit between the D+ data line and the D- data line is disconnected. If the level signal of the D+ data line is detected at tDetn+3, then as Figure 6 shown, after tDetn+1 ends, the short circuit between the D+ data line and the D- data line is disconnected, and the level signal of the D+ data line is pulled high, and then the level signal of the D+ data line is detected at tDetn+2. If the D+ data line outputs a high level at tDetn+2, it is determined that both the charging device and the power supply device support the preset charging protocol. If the level signal of the D- data line is detected at tDetn+2, then as Figure 7As shown, after the end of tDetn+1, the short circuit between the D+ data line and the D- data line is disconnected, and the level signal of the D- data line is pulled high, and then the level signal of the D- data line is detected at tDetn+3. If the D- data line outputs a high level at tDetn+2, it is determined that both the charging device and the power supply device support the preset charging protocol. In one example, tDetn+2 also includes a preset time window and tDetn+3. The preset time window can be understood as a detection time period for detecting whether the D+ data line or the D- data line outputs a target level.
[0075] In another implementation scenario, as Figure 8 shown, if during the process of detecting the charging protocol, the level signal change sequences of the D- data lines of the charging device and the power supply device and the level signal change sequences of the D+ data lines of the charging device and the power supply device do not satisfy the specified pulse sequence, the detection of the charging protocol is restarted. Figure 8 is a flowchart of yet another charging control method shown according to an exemplary embodiment.
[0076] In response to the establishment of a communication connection between the charging device and the power supply device, a charging protocol detection is performed. A pulse sequence is transmitted to the D+ data line of the power supply device through the D- data line of the charging device, and the power supply device detects whether the received pulse sequence satisfies the specified pulse sequence. That is, it is detected whether both the level signal change sequence of the D- data line and the level signal change sequence of the D+ data line satisfy the specified pulse sequence. If it is detected that both the level signal change sequences of the D- data line and the D+ data line satisfy the specified pulse sequence, then after the end of the first time, the short circuit between the D+ data line and the D- data line is disconnected, and further it is determined whether the level signal output by the level signal change sequence of the D+ data lines of the charging device and the power supply device within the second time is the target level. If the level signal change sequences of the D- data lines of the charging device and the power supply device and the level signal change sequences of the D+ data lines do not satisfy the specified pulse sequence, then it is redetected whether both the level signal change sequences of the D- data lines of the charging device and the power supply device and the level signal change sequences of the D+ data lines satisfy the specified pulse sequence. When it is detected that both the level signal change sequences of the D- data lines of the charging device and the power supply device and the level signal change sequences of the D+ data lines satisfy the specified pulse sequence, and within the second time it is detected that the level signal change sequence of the D+ data lines of the charging device and the power supply device is the target level, it is determined that both the charging device and the power supply device support the preset charging protocol, the handshake between the charging device and the power supply device is completed, and the charging control instruction for performing charging control is determined. Then, the charging device sends a charging control instruction to the power supply device, instructing the power supply device to enter the preset charging mode and charge the charging device using the preset charging protocol.
[0077] Figure 9is a flowchart of yet another charging control method shown according to an exemplary embodiment. As Figure 9 shown, the charging control method includes the following steps.
[0078] In step S31, in response to establishing a communication connection between the charging device and the power supply device, a charging protocol detection is performed.
[0079] In step S32, if within a first time, the level signal change sequences of the D- data line of the charging device and the D+ data line of the power supply device both satisfy a specified pulse sequence, then within a second time, the level signal output by the D- data line or the level signal output by the D+ data line is detected.
[0080] In step S33, a third time is determined.
[0081] In the embodiment of the present disclosure, the third time is the time when the target level is not detected at the D- data line of the charging device or the time when the target level is not detected at the D+ data line of the power supply device within the second time. If it is detected that the level signal of the D- data line of the charging device does not output the target level within the second time, or the level signal of the D+ data line of the power supply device does not output the target level within the second time, it indicates that the charging protocol supported by both the charging device and the power supply device may not be the preset charging protocol. To improve the accuracy of determining the charging protocol and avoid misidentification, before determining whether the charging device and the power supply device both support the preset charging protocol, first determine the third time when the target level is not output to determine whether it exceeds the time for detecting the level signal of the D- data line or the D+ data line within the second time. By setting a specified time window, the time for detecting the level signal of the D- data line or the D+ data line within the second time can be limited, thereby avoiding the situation of misidentifying the level signal output by the D- data line or the D+ data line within the second time.
[0082] In step S341, if the third time is greater than or equal to the specified time window, then determine the detection times of the level signal of the D- data line not outputting the target level within the second time, or determine the detection times of the level signal of the D+ data line not outputting the target level within the second time, and determine the charging protocol supported by the charging device and the power supply device based on the detection times.
[0083] In an embodiment of the present disclosure, if the third time is greater than or equal to the specified time window, it indicates that the charging protocol supported by both the charging device and the power supply device may not be the preset charging protocol. To enable the charging device and the power supply device to charge using the preset charging protocol as much as possible during the charging process and avoid misdetection of the current detection result, the charging protocols supported by the charging device and the power supply device are redetected, and the detection times when the D - data line does not output the target level within the second time or the detection times when the level signal of the D + data line does not output the target level within the second time are recorded. To avoid excessive time for detecting the charging protocol, which affects the timeliness of the power supply device to charge the charging device and thus affects the user experience, the charging protocols supported by the charging device and the power supply device can be determined based on the detection times.
[0084] In step S342, if the third time is less than the specified time window, continue to detect the level signal output by the D - data line within the second time or the level signal output by the D + data line within the second time.
[0085] In an embodiment of the present disclosure, during the process of detecting the level signal output by the D - data line or the D + data line of the charging device and the power supply device within the sixth time, if the output time is less than the specified time window, it indicates that the current is still in the detection period, and the level signal output by the D - data line or the D + data line within the second time can be continuously detected.
[0086] In step S35, determine the charging control instruction for charging control.
[0087] In step S36, send the charging control instruction to the power supply device to instruct the power supply device to charge the charging device.
[0088] In one embodiment, the process of determining the charging protocol supported by both the charging device and the power supply device based on the detection times can be as Figure 10 shown. Figure 10 It is a flowchart of a method for detecting a charging protocol shown according to an exemplary embodiment.
[0089] In step S41, if the detection times are less than the detection times threshold, redetermine the level signal change sequence of the D - data line or the level signal change sequence of the D + data line.
[0090] In an embodiment of the present disclosure, the detection times threshold is used to limit the number of times of detecting the charging protocol. If the detection times are less than the detection times threshold (such as 3 times), it indicates that detection can be performed again, and the level signal change sequence of the D - data line or the level signal change sequence of the D + data line can be redetermined.
[0091] In step S42, if the number of detections is greater than or equal to the detection number threshold, and the level signal of the D- data line or the level signal of the D+ data line does not output the target level within the second time, it is determined that both the charging device and the power supply device support the default charging protocol.
[0092] In the embodiment of the present disclosure, if the number of detections is greater than or equal to the detection number threshold, and the level signal of the D- data line or the D+ data line does not output the target level within the second time, it indicates that the handshake between the charging device and the power supply device fails, the D+ data line and the D- data line are in a high-impedance state, and charging cannot be performed using the preset charging protocol. To facilitate the power supply device to charge the charging device, it is determined that the charging protocol supported by the charging device and the power supply device is the default charging protocol. In one example, the default charging protocol may be the SDP mode or the DCP mode in the BC1.2 protocol. In another example, the default charging protocol may be a charging protocol that communicates according to the standard process of the BC1.2 protocol.
[0093] Figure 11 It is a flowchart of another charging control method shown according to an exemplary embodiment. As Figure 11 shown, the charging control method includes the following steps.
[0094] In step S51, in response to establishing a communication connection between the charging device and the power supply device, a charging protocol detection is performed.
[0095] In step S52, if within the first time, the level signal change sequences of the D- data line of the charging device and the level signal change sequence of the D+ data line of the power supply device both satisfy the specified pulse sequence, and within the second time, the level signal output by the D- data line or the level signal output by the D+ data line is the target level, it is determined that the charging protocol supported by the charging device and the power supply device is the preset charging protocol.
[0096] In step S53, a charging control instruction for controlling charging is determined.
[0097] In step S54, the charging control instruction is sent to the power supply device to instruct the power supply device to charge the charging device.
[0098] In step S55, through a hardware reset, the level signal state of the D+ data line and the level signal state of the D- data line of the charging device are initialized.
[0099] In an embodiment of the present disclosure, to avoid abnormal data transmission during the process of instructing a power supply device to charge a charging device, the level signal states of the D+ data line and the D- data line of the charging device can be initialized through a hardware reset, thereby restoring normal communication between the charging device and the power supply device. In one example, the hardware reset can be controlled according to the change time of the level signal. For example: pulling down the level signal of the data receiving bus of the charging device or the power supply device to be reset for more than a fourth time (which can be customized) realizes the hardware reset of the device. In another example, the hardware reset level signal for initializing the level signal states of the D+ data line, the cable, and the D- data line can be controlled using the same level signal.
[0100] In an implementation scenario, the hardware reset level signal can be as Figure 12 shown. Figure 12 is a schematic diagram of a level signal shown according to an exemplary embodiment. When the level signal state of the D+ data line or the D- data line has been in a low level signal state within the fourth time, the level signal states of the D+ data line and the D- data line of the charging device are initialized.
[0101] In another implementation scenario, when communicating by connecting a charging device and a power supply device through a USB data cable, the charging control method for instructing the power supply device to charge the charging device can be as Figure 13 shown. Figure 13 is a flowchart of another charging control method shown according to an exemplary embodiment.
[0102] In step S61, it is determined whether there is voltage on the power line.
[0103] In response to establishing a communication connection between the charging device and the power supply device and detecting voltage through the power line (VBUS) in the USB data, a charging protocol detection is performed.
[0104] In step S62, it is identified whether the power supply device is a DCP device that meets the DCP mode. During the charging protocol detection, it is first determined whether the power supply device meets the DCP mode in the BC1.2 protocol to determine whether the current power supply device for charging is a dedicated charging device for the charging device.
[0105] In step S631, when the DCP mode in the BC1.2 protocol is met, the detection count is determined to be 1 through a detection counter.
[0106] In an embodiment of the present disclosure, meeting the DCP mode in the BC1.2 protocol indicates that the current power supply device for charging is a dedicated charging device for the charging device.
[0107] In step S632, through identification, it is determined that the power supply device meets the SDP protocol, CDP protocol, or OCP protocol in the BC1.2 protocol, or it is determined that the power supply device is other device.
[0108] In the embodiments of the present disclosure, when it is determined that the power supply device meets the SDP protocol, CDP protocol, or OCP protocol in the BC1.2 protocol, or it is determined that the power supply device is other device, the default charging protocol is used for charging.
[0109] In step S64, within the first time, it is determined that the level signal change sequence of the D- data line of the charging device and the level signal change sequence of the D+ data line of the power supply device both meet the specified pulse sequence.
[0110] In step S65, within the specified time window, it is detected whether the level signal output by the D- data line or the D+ data line is the target level.
[0111] If it is detected that the level signal output by the D- data line or the D+ data line within the specified time window is the target level, the handshake is successful, and the preset charging protocol can be used for fast charging. At this time, the communication mode between the charging device and the power supply device can adopt the full-duplex mode for communication, and then a charging control instruction is sent to the power supply device to instruct the power supply device to charge the charging device.
[0112] If it is detected that within the specified time window, the level signal output by the D- data line is not the target level, or the level signal output by the D+ data line is not the target level, the detection times of the level signal of the D- data line or the D+ data line not outputting the target level within the specified time window are determined.
[0113] In step S66, it is determined whether the detection times are greater than or equal to the detection times threshold (such as 3).
[0114] In the embodiments of the present disclosure, if it is determined that the detection times are greater than or equal to the detection times threshold, and the level signal change sequence of the D+ data line does not output the target level within the specified time window, it is determined that the charging device and the power supply device do not support the preset charging protocol, the handshake fails, the D+ data line and the D- data line are in the high impedance state, and then the default charging protocol is used for charging, and communication is performed according to the standard process of the BC1.2 protocol.
[0115] Based on the same concept, the embodiments of the present disclosure also provide a charging control device applied to a charging device.
[0116] It can be understood that, in order to implement the above functions, the charging control device provided in the embodiments of the present disclosure includes the corresponding hardware structures and / or software modules for executing each function. Combining the units and algorithm steps of the various examples disclosed in the embodiments of the present disclosure, the embodiments of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiments of the present disclosure.
[0117] Figure 14 is a block diagram of a charging control device shown according to an exemplary embodiment. Referring to Figure 14 , the charging control device 100 includes a detection unit 101, a determination unit 102, and an indication unit 103.
[0118] The detection unit 101 is configured to perform a charging protocol detection in response to the establishment of a communication connection between the charging device and the power supply device.
[0119] The determination unit 102 is configured to determine a charging control instruction for controlling the charging if it is determined that both the charging device and the power supply device support a preset charging protocol.
[0120] The indication unit 103 is configured to send the charging control instruction to the power supply device to instruct the power supply device to charge the charging device.
[0121] In one embodiment, the indication unit 103 sends the charging control instruction to the power supply device in the following manner: determining a physical layer data frame for sending the charging control instruction to the power supply device, where the physical layer data frame includes a start bit, data bits, and an end bit. Based on the change of the data bits of the physical layer data frame from the low bit to the high bit, the charging control instruction is sent to the power supply device.
[0122] In another embodiment, the indication unit 103 sends the charging control instruction to the power supply device in the following manner: determining a physical layer data packet for sending the charging control instruction to the power supply device, where the physical layer data packet includes data information and control information. The data information includes a message header, a data length, data, and a data verification function, and the control information includes a message header, a control command, and a data verification function. Based on sending the data information and the control information from the high byte to the low byte of the physical layer data packet, the charging control instruction is sent to the power supply device.
[0123] In another embodiment, the determining unit 102 determines that the charging protocols supported by the charging device and the power supply device are preset charging protocols in the following manner: If within a first time period, the level signal change sequences of the D- data line of the charging device and the D+ data line of the power supply device both satisfy a specified pulse sequence, and within a second time period, the level signal output by the D- data line or the level signal output by the D+ data line is a target level, then it is determined that the charging protocols supported by the charging device and the power supply device are preset charging protocols.
[0124] In another embodiment, the determining unit 102 is further configured to: determine a third time period, where the third time period is the time when the target level is not detected at the D- data line of the charging device or the time when the target level is not detected at the D+ data line of the power supply device within the second time period. If the third time period is greater than or equal to a specified time window, then determine the detection times when the level signal of the D- data line does not output the target level within the second time period, or determine the detection times when the level signal of the D+ data line does not output the target level within the second time period, and determine the charging protocols supported by the charging device and the power supply device based on the detection times. If the third time period is less than the specified time window, then continue to detect the level signal output by the D- data line within the second time period, or the level signal output by the D+ data line within the second time period.
[0125] In another embodiment, the determining unit 102 determines the charging protocols supported by the charging device and the power supply device based on the detection times in the following manner: If the detection times are less than a detection times threshold, then re-determine the level signal change sequence of the D- data line or the level signal change sequence of the D+ data line. If the detection times are greater than or equal to the detection times threshold, and the level signal of the D- data line or the level signal of the D+ data line does not output the target level within the second time period, then it is determined that both the charging device and the power supply device support the default charging protocol.
[0126] In another embodiment, the charging control device 100 further includes: a reset unit, configured to initialize the level signal states of the D+ data line and the D- data line of the charging device through hardware reset.
[0127] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.
[0128] Figure 15 It is a block diagram of another charging control device shown according to an exemplary embodiment. For example, the charging control device 200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0129] Refer toFigure 15 , the charging control device 200 may include one or more of the following components: a processing component 202, a memory 204, a power component 206, a multimedia component 208, an audio component 210, an input / output (I / O) interface 212, a sensor component 214, and a communication component 216.
[0130] The processing component 202 generally controls the overall operation of the charging control device 200, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to complete all or part of the steps of the above methods. In addition, the processing component 202 may include one or more modules to facilitate the interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate the interaction between the multimedia component 208 and the processing component 202.
[0131] The memory 204 is configured to store various types of data to support the operation of the charging control device 200. Examples of such data include instructions for any application or method operating on the charging control device 200, contact data, phone book data, messages, pictures, videos, etc. The memory 204 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.
[0132] The power component 206 provides power to various components of the charging control device 200. The power component 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the charging control device 200.
[0133] The multimedia component 208 includes a screen that provides an output interface between the charging control device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the charging control device 200 is in an operation mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
[0134] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC) that is configured to receive external audio signals when the charging control device 200 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 204 or transmitted via the communication component 216. In some embodiments, the audio component 210 further includes a speaker for outputting audio signals.
[0135] The I / O interface 212 provides an interface between the processing component 202 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include but are not limited to: a home button, a volume button, a power button, and a lock button.
[0136] The sensor component 214 includes one or more sensors for providing status assessments of various aspects of the charging control device 200. For example, the sensor component 214 can detect the on / off state of the charging control device 200, the relative positioning of components, such as the display and the keypad of the charging control device 200. The sensor component 214 can also detect a change in the position of the charging control device 200 or a component of the charging control device 200, the presence or absence of user contact with the charging control device 200, the orientation or acceleration / deceleration of the charging control device 200, and the temperature change of the charging control device 200. The sensor component 214 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 214 can also include a light sensor, such as a CMOS or a CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 214 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0137] The communication component 216 is configured to facilitate communication between the charging control device 200 and other devices in a wired or wireless manner. The charging control device 200 can access a communication standard-based wireless network, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0138] In an exemplary embodiment, the charging control device 200 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing any of the above charging control methods.
[0139] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 204 including instructions, is also provided. The above instructions can be executed by the processor 220 of the charging control device 200 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0140] Figure 16 is a block diagram of yet another charging control device shown according to an exemplary embodiment. For example, the charging control device 300 can be provided as a server. Referring to Figure 16 , the charging control device 300 includes a processing component 322, which further includes one or more processors, and memory resources represented by the memory 332 for storing instructions executable by the processing component 322, such as application programs. The application programs stored in the memory 332 can include one or more modules each corresponding to a set of instructions. In addition, the processing component 322 is configured to execute instructions to perform any of the above charging control methods.
[0141] The charging control device 300 may further include a power supply component 326 configured to perform power management of the charging control device 300, a wired or wireless network interface 350 configured to connect the charging control device 300 to a network, and an input / output (I / O) interface 358. The charging control device 300 may operate based on an operating system stored in the memory 332, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
[0142] It can be further understood that in the present disclosure, "a plurality of" means two or more, and other quantifiers are similar thereto. "And / or" describes the association relationship of associated objects and indicates that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. The singular forms of "a", "the" and "said" are also intended to include the plural forms unless the context clearly indicates otherwise.
[0143] It can be further understood that the terms "first", "second", etc. are used to describe various information, but this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other and do not represent a specific order or degree of importance. In fact, the expressions such as "first" and "second" can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information.
[0144] It can be further understood that unless otherwise specified, "connection" includes direct connection between the two without other components therebetween, and also includes indirect connection between the two with other elements therebetween.
[0145] It can be further understood that although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood that they are required to be performed in the specific order shown or in a serial order, or that all the operations shown are required to obtain the desired result. In a specific environment, multitasking and parallel processing may be advantageous.
[0146] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0147] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A charging control method, characterized in that The charging control method includes: In response to establishing a communication connection between a charging device and a power supply device, perform a charging protocol detection; if within a first time period, the level signal change sequences of the D- data line of the charging device and the D+ data line of the power supply device both meet a specified pulse sequence, then within a second time period, detect the level signal output by the D- data line or the level signal output by the D+ data line; Determine a third time period, where the third time period is the time when the target level is not detected on the D- data line of the charging device or the time when the target level is not detected on the D+ data line of the power supply device within the second time period; If the third time period is less than a specified time window, continue to detect the level signal output by the D- data line within the second time period or the level signal output by the D+ data line within the second time period; If the third time period is greater than or equal to the specified time window, determine the number of detections that the level signal of the D- data line does not output the target level within the second time period, or determine the number of detections that the level signal of the D+ data line does not output the target level within the second time period, and determine the charging protocol supported by the charging device and the power supply device based on the number of detections; Determine a charging control instruction for controlling charging; Send the charging control instruction to the power supply device to instruct the power supply device to charge the charging device.
2. The charging control method according to claim 1, wherein The sending the charging control instruction to the power supply device includes: Determine a physical layer data frame for sending the charging control instruction to the power supply device, where the physical layer data frame includes a start bit, data bits, and an end bit; Based on the change of the data bits of the physical layer data frame from the low bit to the high bit, send the charging control instruction to the power supply device.
3. The charging control method according to claim 1, wherein The sending the charging control instruction to the power supply device includes: Determine a physical layer data packet for sending the charging control instruction to the power supply device, where the physical layer data packet includes data information and control information; The data information includes a message header, a data length, data, and a data check function, and the control information includes a message header, a control command, and a data check function; Based on the physical layer data packet, send the data information and the control information from the high byte to the low byte, and send the charging control instruction to the power supply device.
4. The charging control method according to any one of claims 1-3, characterized in that, The method further includes: If within the first time period, the level signal change sequences of the D- data line of the charging device and the D+ data line of the power supply device both meet the specified pulse sequence, and within the second time period, the level signal output by the D- data line or the level signal output by the D+ data line is the target level, then determine that the charging protocol supported by the charging device and the power supply device is a preset charging protocol.
5. The charging control method according to claim 1, wherein The determining the charging protocol supported by the charging device and the power supply device based on the number of detections includes: If the number of detections is less than a detection number threshold, re-determine the level signal change sequence of the D- data line or the level signal change sequence of the D+ data line; If the number of detections is greater than or equal to the detection number threshold, and the level signal of the D- data line or the level signal of the D+ data line does not output the target level within the second time, it is determined that both the charging device and the power supply device support the default charging protocol.
6. The charging control method according to claim 4, wherein The charging control method further includes: Initializing the level signal states of the D+ data line and the D- data line of the charging device through hardware reset.
7. A charging control device, characterized in that, The charging control device includes: A detection unit, configured to perform a charging protocol detection in response to establishing a communication connection between the charging device and the power supply device; A determination unit, configured to, if within the first time, the level signal change sequences of the D- data line of the charging device and the D+ data line of the power supply device both satisfy the specified pulse sequence, then within the second time, detect the level signal output by the D- data line or the level signal output by the D+ data line; determine the third time, where the third time is the time when the target level is not detected at the D- data line of the charging device or the time when the target level is not detected at the D+ data line of the power supply device within the second time; if the third time is greater than or equal to the specified time window, then determine the number of detections that the level signal of the D- data line does not output the target level within the second time, or determine the number of detections that the level signal of the D+ data line does not output the target level within the second time, and determine the charging protocol supported by the charging device and the power supply device based on the number of detections; if the third time is less than the specified time window, then continue to detect the level signal output by the D- data line within the second time, or the level signal output by the D+ data line within the second time; determine the charging control instruction for controlling the charging; An indication unit, configured to send the charging control instruction to the power supply device to instruct the power supply device to charge the charging device.
8. The charging control device according to claim 7, characterized in that The indication unit sends the charging control instruction to the power supply device in the following manner: Determine the physical layer data frame used to send the charging control instruction to the power supply device, where the physical layer data frame includes a start bit, data bits, and an end bit; Send the charging control instruction to the power supply device based on the change of the data bits of the physical layer data frame from the low bit to the high bit.
9. The charging control device according to claim 7, characterized in that The indication unit sends the charging control instruction to the power supply device in the following manner: Determine the physical layer data packet used to send the charging control instruction to the power supply device, where the physical layer data packet includes data information and control information; The data information includes a message header, a data length, data, and a data check function, and the control information includes a message header, a control command, and a data check function; Send the data information and the control information to the power supply device based on the physical layer data packet from the high byte to the low byte to send the charging control instruction to the power supply device.
10. The charging control device according to any one of claims 7-9, characterized in that, The determination unit determines that the charging protocol supported by the charging device and the power supply device is the preset charging protocol in the following manner: If, within the first time period, the level signal change sequences of the D- data line of the charging device and the D+ data line of the power supply device both satisfy the specified pulse sequence, and within the second time period, the level signal output by the D- data line or the level signal output by the D+ data line is the target level, then it is determined that the charging protocol supported by the charging device and the power supply device is the preset charging protocol.
11. The charging control device according to claim 7, wherein The determining unit determines the charging protocol supported by the charging device and the power supply device based on the number of detections in the following manner: If the number of detections is less than the detection number threshold, then re-determine the level signal change sequence of the D- data line or the level signal change sequence of the D+ data line; If the number of detections is greater than or equal to the detection number threshold, and the level signal of the D- data line or the level signal of the D+ data line does not output the target level within the second time period, then it is determined that both the charging device and the power supply device support the default charging protocol.
12. The charging control device according to claim 10, wherein The charging control device further includes: A reset unit, configured to initialize the level signal states of the D+ data line and the D- data line of the charging device through hardware reset.
13. A charging control device, characterized in that, The charging control device includes: A memory, configured to store instructions; and A processor; configured to call the instructions stored in the memory to execute the charging control method according to any one of claims 1 to 6.
14. A computer-readable storage medium, wherein, The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the charging control method according to any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Control device and method of charging of mobile terminal
CN106453964A
Charging method, mobile terminal, and charging device
CN107005062A
Charging method, fast charging device and computer readable storage medium
CN107742912A
Charging control method and device, electronic equipment and storage medium
CN112448450A