Charging control method, electronic device and computer readable storage medium
By prioritizing the detection of private protocols and sharing connectivity detection results, the problem of electronic devices taking longer to detect multiple fast charging protocols is solved, achieving more efficient charging control and user experience.
Patent Information
- Application Number
- CN202311871272.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-12-29
AI Technical Summary
In the prior art, when electronic devices detect multiple fast charging protocols, they need to poll each protocol in turn, resulting in a long time-consuming process of the entire protocol detection and affecting the user experience.
By implementing a charging control method in electronic devices, priority is given to detecting private protocols (such as supercharge protocol and fast charging protocol), and reducing the number of detections by sharing connectivity detection results, improving detection efficiency.
This method significantly reduces the duration of fast charging protocol detection, improves charging efficiency and user experience, and ensures that electronic devices are charged at the maximum charging power that the charger is adapted to.
Smart Images

Figure CN118473038B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of smart terminal technology, and specifically to a charging control method, an electronic device, and a computer-readable storage medium. Background Art
[0002] As the demand for fast charging increases, there are many types of chargers that support fast charging on the market, but different types of chargers may support different fast charging protocols. Electronic devices can usually support multiple fast charging protocols. Based on the differences in various fast charging protocols, electronic devices need to perform various fast charging protocol detections in different time periods during the protocol detection process. However, electronic devices poll various fast charging protocols in turn, and each fast charging protocol detection requires a certain amount of detection time, which makes the entire protocol detection process quite time-consuming, thus affecting the user experience. Summary of the invention
[0003] The embodiments of the present application provide a charging control method, an electronic device, and a computer-readable storage medium, which aim to solve the problem that the detection process of multiple fast charging protocols is time-consuming.
[0004] The first aspect of the embodiment of the present application provides a charging control method, which is applied to an electronic device, and the electronic device supports multiple fast charging protocols, including a private protocol and a UFCS protocol. The charging control method includes: based on the electronic device being connected to the charger, and the charging interface type of the charger being a dedicated charging interface, performing connectivity detection and setting a connectivity detection flag. Among them, the connectivity detection is used to test whether the charger supports the private protocol, the private protocol includes a super charging protocol and a fast charging protocol, the charging mode specified by the super charging protocol is a super fast charging mode, and the charging mode specified by the fast charging protocol is a discrete voltage regulation mode. The connectivity detection flag includes a detection success flag or a detection failure flag. Based on the connectivity detection flag being a detection success flag, a super charging protocol detection is performed. The super charging protocol detection is used to determine whether the charger supports the super charging protocol. Based on the connectivity detection flag being a detection success flag, and the super charging protocol detection fails, a fast charging protocol detection is performed. The fast charging protocol detection is used to determine whether the charger supports the fast charging protocol. Based on the completion of the fast charging protocol detection, a UFCS protocol detection is performed. The UFCS protocol detection is used to determine whether the charger supports the UFCS protocol, and the charging mode specified by the UFCS protocol is the super fast charging mode. Based on successful UFCS protocol detection, the charging mode of the electronic device is set to super fast charging mode.
[0005] In this embodiment, various fast charging protocol detections are performed in the order of priority of private protocols. Since the super charging protocol and the fast charging protocol can share the connectivity detection results, the connectivity detection results can be obtained by querying the connectivity detection identifier during the fast charging protocol detection, without the need to perform the connectivity detection again, thereby reducing the number of connectivity detections, thereby reducing the protocol detection time, and thus improving the charging efficiency and user experience. In addition, since the charging method specified by the fast charging protocol is different from the charging method specified by the super charging protocol / UFCS protocol, and the maximum charging power supported by the fast charging protocol is less than the maximum charging power supported by the UFCS protocol, after the fast charging protocol detection, regardless of whether the fast charging protocol detection succeeds or fails, the UFCS protocol detection must be performed, which is conducive to ensuring that the electronic device is charged at the maximum charging power adapted to the charger.
[0006] In one embodiment, the charging control method further includes: based on the fast charging protocol detection being successful and the UFCS protocol detection being failed, setting the charging mode of the electronic device to a discrete voltage regulation mode.
[0007] In another embodiment, the charging control method further includes: based on the failure of the fast charging protocol detection and the failure of the UFCS protocol detection, setting the charging mode of the electronic device to the normal charging mode.
[0008] In another embodiment, the charging control method further includes: based on successful detection of the super charging protocol, setting the charging mode of the electronic device to a super fast charging mode.
[0009] In another embodiment, the charging control method further includes: setting a super fast charge effective value based on a successful super charging protocol detection or a successful UFCS protocol detection. The super fast charge effective value is used to indicate whether the charger supports the super fast charge mode. Based on the super fast charge effective value being a non-null value, setting the charging mode of the electronic device to the super fast charge mode.
[0010] In another embodiment, the charging control method further includes: setting a fast charging protocol support flag based on the fast charging protocol detection success, wherein the fast charging protocol support flag is used to indicate that the charger supports the discrete voltage regulation mode.
[0011] In another embodiment, the charging control method further includes: based on the super fast charge effective value being a null value and the fast charge protocol support flag being non-null, setting the charging mode of the electronic device to a discrete voltage regulation mode.
[0012] In another embodiment, the charging control method further includes: based on the super fast charging effective value being a null value and the fast charging protocol support flag being null, setting the charging mode of the electronic device to a normal charging mode.
[0013] In another embodiment, the charging control method further includes: based on the connectivity detection flag being a detection failure flag, performing UFCS protocol detection.
[0014] In another embodiment, the multiple fast charging protocols also include the PPS protocol, and the charging control method further includes: based on the electronic device being connected to the charger and determining that the charging interface type of the charger is a dedicated charging interface, performing PPS protocol detection. The PPS protocol detection is used to determine whether the charger supports the PPS protocol.
[0015] In another embodiment, the charging control method further includes: setting a super fast charging effective value based on successful PPS protocol detection.
[0016] In another embodiment, the charging control method further includes: based on the failure of the PPS protocol detection and the completion of the fast charging protocol detection, performing the UFCS protocol detection.
[0017] A second aspect of an embodiment of the present application provides an electronic device, which supports multiple fast charging protocols. The electronic device includes a charging interface, a memory, and a processor. The charging interface is used to connect to the charger, the memory is used to store instructions, and the processor is used to run the instructions stored in the memory, so that the electronic device executes the charging control method of the embodiment of the present application.
[0018] A third aspect of an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a computer, the computer executes the charging control method of the embodiment of the present application.
[0019] The technical effects brought about by the second and third aspects of the embodiments of the present application can be found in the relevant description of the charging control method of the first aspect above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flow chart of multiple fast charging protocol detection strategies provided as an example.
[0021] Figure 2 This is a flow chart of a charging control method provided by an embodiment of the present application.
[0022] Figure 3 This is a flow chart of a charging control method provided in another embodiment of the present application.
[0023] Figure 4 It is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0024] It should be noted that the method disclosed in the embodiments of the present application or the method shown in the flowchart includes one or more steps for implementing the method. Without departing from the scope of the claims, the execution order of multiple steps can be interchangeable with each other, and some of the steps can also be deleted.
[0025] The electronic devices involved in the embodiments of the present application may include, but are not limited to, smart phones, tablet computers, personal computers (PCs), e-book readers, workstations, servers, personal digital assistants (PDAs), portable multimedia players (PMPs), mobile medical devices, cameras, and wearable devices such as smart watches, smart bracelets, and smart glasses.
[0026] With the increasing demand for fast charging, there are many types of chargers that support fast charging on the market, but different types of chargers may support different fast charging protocols. Electronic devices can usually support multiple fast charging protocols, such as the Universal Fast Charging Specification (UFCS) protocol, the Programmable Power Supply (PPS) protocol, and private protocols. Private protocols are fast charging protocols defined by each electronic device manufacturer, such as the Fast Charge Protocol (FCP), the Super Charge Protocol (SCP), etc. After the electronic device is connected to the charger, it will perform multiple fast charging protocol detections to determine the fast charging protocol supported by the charger, and then select the charging mode that is compatible with the charger.
[0027] Based on the differences between various fast charging protocols, electronic devices need to perform various fast charging protocol detections in different time periods during the protocol detection process. For example, when electronic devices detect UFCS protocols and private protocols, they use the data positive (Data Positive, DP) signal line and data negative (Data Negative, DN) signal line of the Universal Serial Bus (USB) data line to communicate with the charger. However, private protocol detection requires disconnecting the DP and DN signal lines, and UFCS protocol detection requires short-circuiting the DP and DN signal lines. Therefore, the UFCS protocol and private protocol cannot be detected in parallel. And because different fast charging protocols support different fast charging powers, for example, the maximum charging power supported by the UFCS protocol is usually 33W, the maximum charging power supported by FCP is usually 18W, and the maximum charging power supported by SCP can be higher than 100W. Therefore, various fast charging protocol detections are usually detected in order from large to small according to the maximum charging power supported by the fast charging protocol.
[0028] For example, see Figure 1 In step S101, based on the electronic device being connected to the charger and the DP and DN signal lines being in a short-circuited state, the electronic device performs a Battery Charging specification revision 1.2 (BC1.2) test. The BC1.2 test is used to determine the type of charging interface of the charger. The charging interface type may include, but is not limited to, a dedicated charging port (DCP), a standard downstream port (SDP), and a USB interface. When the charger detects that an electronic device is connected, it short-circuits the DP and DN signal lines.
[0029] In step S102, based on the charging interface type of the charger being DCP, the electronic device performs a High Voltage Dedicated Charging Port (HVDCP) detection, which is used to control the charger to switch the DP and DN signal lines from a short-circuited state to a disconnected state.
[0030] In step S103, based on the DP and DN signal lines being in a disconnected state, the electronic device performs SCP detection. SCP detection is used to determine whether the charger supports SCP. If the SCP detection succeeds, it is determined that the charger supports SCP. If the SCP detection fails, it is determined that the charger does not support SCP.
[0031] In step S104, based on the failure of the SCP detection and the DP and DN signal lines being in a short-circuited state, the electronic device performs a UFCS protocol detection. The UFCS protocol detection is used to determine whether the charger supports the UFCS protocol. If the UFCS protocol detection is successful, it is determined that the charger supports the UFCS protocol. If the UFCS protocol detection fails, it is determined that the charger does not support the UFCS protocol. When the SCP detection fails, the electronic device can feedback the SCP detection failure information to the charger. Based on the SCP detection failure information, the charger short-circuits the DP and DN signal lines.
[0032] In step S105 , based on the failure of the UFCS protocol detection, the electronic device performs HVDCP detection.
[0033] In step S106, based on the DP and DN signal lines being in a disconnected state, the electronic device performs FCP detection. FCP detection is used to determine whether the charger supports FCP. If the FCP detection succeeds, it is determined that the charger supports FCP. If the FCP detection fails, it is determined that the charger does not support FCP.
[0034] In step S107, after performing the BC1.2 detection, the electronic device performs a PPS protocol detection based on the charging interface type of the charger being DCP. The PPS protocol detection is used to determine whether the charger supports the PPS protocol. If the PPS protocol detection is successful, it is determined that the charger supports the PPS protocol. If the PPS protocol detection fails, it is determined that the charger does not support the PPS protocol. Since the PPS protocol detection uses the Configuration Channel (CC) line of the USB data line, it does not conflict with the UFCS protocol / SCP / FCP detection in timing, so the PPS protocol can be detected in parallel with the UFCS protocol / SCP / FCP.
[0035] In step S108, based on the success of the FCP detection and the failure of the PPS protocol detection, the electronic device sets the charging mode to the discrete voltage regulation mode.
[0036] In the above embodiment, when the electronic device executes the above-mentioned various fast charging protocol detections, it can switch to the protocol signal and interface voltage corresponding to the current fast charging protocol through the internal processor, and record the response of the charger to the protocol signal and interface voltage, and determine whether the current fast charging protocol is detected successfully or failed based on the recorded response.
[0037] For each fast charging protocol detection, a retry threshold can be set. When a fast charging protocol detection fails, the electronic device re-executes the fast charging protocol detection until the number of re-executions reaches the retry threshold, and then the electronic device determines that the charger does not support the fast charging protocol. For example, the retry threshold for each fast charging protocol detection is set to 4. When testing a charger that supports FCP, the electronic device performs Figure 1 The multiple fast charging protocol detection strategies shown, the entire protocol detection process takes about 8s.
[0038] It is understandable that the electronic device polls various fast charging protocols in sequence, and each fast charging protocol detection requires a certain detection time, resulting in the entire protocol detection process being quite time-consuming, thus affecting the user experience.
[0039] Based on this, the embodiments of the present application provide a charging control method, an electronic device, and a computer-readable storage medium, which aim to solve the problem that the detection process of multiple fast charging protocols is time-consuming.
[0040] Figure 2 This is a flow chart of a charging control method provided by an embodiment of the present application.
[0041] In this embodiment, the charging control method is applied to an electronic device, and the electronic device supports multiple fast charging protocols, including a private protocol, a UFCS protocol, and a PPS protocol, and the private protocol includes SCP and FCP. The electronic device can be connected to a charger via a charging cable, and the charging cable includes a DP, DN signal line, and a CC line.
[0042] See also Figure 2 , the charging control method comprises the following steps:
[0043] S201, based on the electronic device being connected to the charger and the DP and DN signal lines being in a short-circuited state, a BC1.2 detection is performed.
[0044] Among them, BC1.2 detection is used to determine the charging interface type of the charger.
[0045] S202: Based on the charging interface type of the charger being DCP, perform HVDCP detection.
[0046] Among them, HVDCP detection is used to control the charger to switch the DP and DN signal lines from a short-circuited state to a disconnected state.
[0047] S203, based on the DP and DN signal lines being in a disconnected state, performing a connectivity detection and setting a connectivity detection flag.
[0048] In this embodiment, the connectivity test is used to test whether the charger supports the private protocol. The connectivity test flag is used to indicate the connectivity test result, and the connectivity test result includes a successful test or a failed test. Accordingly, the connectivity test flag includes a successful test flag or a failed test flag. If the connectivity test is successful, it is determined that the charger may support SCP or FCP, and the connectivity test flag is set to a successful test flag. If the connectivity test fails, it is determined that the charger does not support SCP and FCP, and the connectivity test flag is set to a failed test flag.
[0049] Exemplarily, connectivity detection includes an internet packet detector (Packet internet groper, Ping) detection. The Ping detection process may include: the electronic device generates a Ping data packet of a preset baud rate through an internal processor, and transmits the Ping data packet to the charger through the DN signal line. After receiving the Ping data packet, the charger generates an Acknowledgement (ACK) data packet and transmits the ACK data packet to the electronic device through the DP signal line. If the electronic device receives the ACK data packet, it confirms that the Ping detection is successful and sets the Ping detection flag to the detection success flag, such as ping_success_flag=true. If the electronic device does not receive the ACK data packet, it confirms that the Ping detection fails and sets the Ping detection flag to the detection failure flag, such as ping_success_flag=false.
[0050] S204: Determine whether the connectivity detection is successful.
[0051] If the connectivity check succeeds, steps S205 to S206 are executed; if the connectivity check fails, step S212 is executed.
[0052] S205: Based on the connectivity detection flag being a detection success flag, perform SCP detection.
[0053] Among them, SCP detection is used to determine whether the charger supports SCP.
[0054] S206: Determine whether the SCP detection is successful.
[0055] If the SCP detection succeeds, step S207 is executed; if the SCP detection fails, step S208 is executed.
[0056] S207, based on successful SCP detection, setting the super fast charge effective value.
[0057] In this embodiment, the super fast charge effective value is used to indicate whether the charger supports the super fast charge mode. If the SCP detection is successful, it is determined that the charger supports SCP, and the super fast charge effective value is set to a preset value. Among them, the preset value can be set as needed. For example, the preset value can be set to valid num++, that is, the original value plus 1. If the SCP detection fails, it is determined that the charger does not support SCP, and the super fast charge effective value is 0 or null.
[0058] After executing step S207, step S217 may be executed.
[0059] S208: Based on the connectivity detection flag being a detection success flag and the SCP detection failing, perform FCP detection.
[0060] Among them, FCP detection is used to determine whether the charger supports FCP.
[0061] In this embodiment, since both SCP and FCP detections need to disconnect the DP and DN signal lines, SCP and FCP detections can share the results of HVDCP detection and connectivity detection, thereby reducing the number of times HVDCP detection and connectivity detection are performed, thereby reducing the protocol detection time.
[0062] S209, determining whether the FCP detection is successful.
[0063] If the FCP detection succeeds, step S210 is executed; if the FCP detection fails, step S212 is executed.
[0064] S210: Based on the successful FCP detection, an FCP support flag is set.
[0065] In this embodiment, the FCP support flag is used to indicate that the charger supports the discrete voltage regulation mode. If the FCP detection is successful, it is determined that the charger supports FCP, and the FCP support flag is set to non-empty, for example, the FCP support flag is set to support_fcp_flag = true. If the FCP detection fails, it is determined that the charger does not support FCP, and the FCP support flag is empty.
[0066] S211: Based on the charging interface type of the charger being DCP, perform PPS protocol detection.
[0067] In this embodiment, after executing step S201, step S211 may be executed.
[0068] Among them, the PPS protocol detection is used to determine whether the charger supports the PPS protocol.
[0069] S212, determining whether the PPS protocol detection is successful.
[0070] If the PPS protocol detection is successful, execute step S213; if the PPS protocol detection fails, execute step S214.
[0071] S213, based on successful detection of the PPS protocol, set the super fast charge effective value.
[0072] In this embodiment, if the PPS protocol detection is successful, it is determined that the charger supports the PPS protocol, and the super fast charge effective value is set to a preset value. If the PPS protocol detection fails, it is determined that the charger does not support the PPS protocol, and the super fast charge effective value is 0 or null.
[0073] After executing step S213, step S217 may be executed.
[0074] S214: Based on the failure of the PPS protocol detection and the short-circuited state of the DP and DN signal lines, the UFCS protocol detection is performed.
[0075] In this embodiment, since UFCS protocol detection requires short-circuiting the DP and DN signal lines, the electronic device can feedback PPS protocol detection failure information to the charger when the PPS protocol detection fails. The charger short-circuits the DP and DN signal lines based on the PPS protocol detection failure information.
[0076] Among them, the UFCS protocol detection is used to determine whether the charger supports the UFCS protocol. Since the DP and DN signal lines are switched from the disconnected state to the shorted state, the UFCS protocol detection includes the UFCS connectivity detection. The process of the UFCS connectivity detection is roughly the same as the process of the connectivity detection in the above step S203, and will not be repeated here.
[0077] S215, determining whether the UFCS protocol detection is successful.
[0078] If the UFCS protocol detection succeeds, step S216 is executed; if the UFCS protocol detection fails, step S220 is executed.
[0079] S216: The UFCS protocol detection is successful and the super fast charge effective value is set.
[0080] In this embodiment, if the UFCS protocol detection is successful, it is determined that the charger supports the UFCS protocol, and the super fast charge effective value is set to a preset value. If the UFCS protocol detection fails, it is determined that the charger does not support the UFCS protocol, and the super fast charge effective value is 0 or null.
[0081] After executing step S216, step S217 may be executed.
[0082] S217, determine whether the super fast charge effective value is a non-null value.
[0083] If the super fast charge effective value is a non-null value, execute step S218; if the super fast charge effective value is a null value, execute step S219.
[0084] S218, setting the charging mode to super fast charging mode.
[0085] In this embodiment, when the electronic device determines that the charger supports any one of the fast charging protocols of SCP, PPS or UFCS, the super fast charge effective value is a non-null value, and the charging mode can be set to the super fast charge mode. In the super fast charge mode, the electronic device can use the super fast charge state machine to perform continuous voltage regulation control for charging.
[0086] S219, determining whether the FCP support flag is empty.
[0087] If the FCP support flag is empty, execute step S220; if the FCP support flag is not empty, execute step S221.
[0088] S220, setting the charging mode to the normal charging mode.
[0089] In this embodiment, when the electronic device determines that the charger does not support SCP, FCP, PPS and UFCS protocols, the super fast charging effective value is null and the FCP support flag is null, and the charging mode can be set to normal charging mode, such as 5V DC charging.
[0090] S221, setting the charging mode to discrete voltage regulation mode.
[0091] In this embodiment, when the electronic device determines that the charger does not support SCP, PPS and UFCS protocols, but supports FCP, the super fast charging effective value is a null value, and the FCP support flag is non-null, and the charging mode can be set to a discrete voltage regulation mode, such as 9V / 5V discrete voltage regulation control.
[0092] It can be understood that various fast charging protocol detections are in the order of priority of private protocols. The detection order of SCP, PPS protocol and UFCS protocol is the order from large to small of the maximum charging power supported by the fast charging protocol. Since the charging method specified by FCP is different from the charging method specified by SCP / UFCS protocol, and the maximum charging power supported by FCP is less than the maximum charging power supported by UFCS protocol, after FCP detection, regardless of whether the electronic device determines that the charger supports FCP, UFCS protocol detection must be performed, which is conducive to ensuring that the electronic device is charged at the maximum charging power adapted by the charger.
[0093] In other embodiments, SCP and FCP may be replaced with other private protocols with similar charging methods, such as VOOC protocol, SuperVOOC protocol, FlashCharge protocol, Warp protocol, and Dash protocol.
[0094] It can be understood that for the above-mentioned various fast charging protocol detections, a retry threshold can be set. For example, the retry threshold for each fast charging protocol detection is set to 4. When testing a charger that supports FCP, the electronic device executes the charging control method of this embodiment, and the entire protocol detection process takes about 3 seconds. Since SCP and FCP detection can share the results of HVDCP detection and connectivity detection, the number of times HVDCP detection and connectivity detection are performed can be reduced. Therefore, compared to Figure 1 The multiple fast charging protocol detection strategies shown, executing the charging control method of this embodiment can significantly reduce the protocol detection time, thereby improving the charging efficiency.
[0095] Figure 3 This is a flow chart of a charging control method provided in another embodiment of the present application.
[0096] Compared to Figure 2 In the charging control method shown, in this embodiment, the multiple fast charging protocols include a private protocol and a UFCS protocol. The private protocol includes a super charging protocol and a fast charging protocol. The charging mode specified by the super charging protocol is a super fast charging mode, and the charging mode specified by the fast charging protocol is a discrete voltage regulation mode. The maximum charging power specified by the super charging protocol / UFCS protocol is greater than the maximum charging power specified by the fast charging protocol.
[0097] See also Figure 3 , the charging control method comprises the following steps:
[0098] S301, based on the electronic device being connected to the charger and the charging interface type of the charger being DCP, performing connectivity detection and setting a connectivity detection flag.
[0099] The connectivity test is used to test whether the charger supports the private protocol. The connectivity test flag includes a successful test flag or a failed test flag.
[0100] S302: Determine whether the connectivity detection is successful.
[0101] If the connectivity check succeeds, step S303 is executed; if the connectivity check fails, step S306 is executed.
[0102] S303, executing super charging protocol detection.
[0103] Among them, the super charging protocol detection is used to determine whether the charger supports the super charging protocol.
[0104] S304, determining whether the super charging protocol detection is successful.
[0105] If the super charging protocol detection is successful, execute step S309; if the super charging protocol detection fails, execute step S305.
[0106] S305: Based on the connectivity detection flag being a detection success flag, perform a fast charging protocol detection.
[0107] Among them, the fast charging protocol detection is used to determine whether the charger supports the fast charging protocol.
[0108] S306, executing UFCS protocol detection.
[0109] Among them, UFCS protocol detection is used to determine whether the charger supports the UFCS protocol. The charging mode specified by the UFCS protocol is the super fast charging mode.
[0110] In this embodiment, since the private protocol detection needs to disconnect the DP and DN signal lines, the UFCS protocol detection needs to short-circuit the DP and DN signal lines. Therefore, the UFCS protocol detection cannot share the connectivity detection result of the private protocol. The UFCS protocol detection includes the UFCS connectivity detection.
[0111] S307, determining whether the UFCS protocol detection is successful.
[0112] If the UFCS protocol detection succeeds, execute step S309; if the UFCS protocol detection fails, execute step S308.
[0113] S308, determining whether the fast charging protocol detection is successful.
[0114] If the fast charging protocol detection is successful, step S310 is executed; if the fast charging protocol detection fails, step S311 is executed.
[0115] S309, setting the charging mode of the electronic device to the super fast charging mode.
[0116] S310, setting the charging mode of the electronic device to a discrete voltage regulation mode.
[0117] S311, setting the charging mode of the electronic device to a normal charging mode.
[0118] In this embodiment, various fast charging protocol detections are performed in the order of priority of private protocols. Since the super charging protocol and the fast charging protocol can share the connectivity detection results, the connectivity detection results can be obtained by querying the connectivity detection identifier during the fast charging protocol detection, without the need to perform the connectivity detection again, thereby reducing the number of connectivity detections, thereby reducing the protocol detection time, and thus improving the charging efficiency and user experience. In addition, since the charging method specified by the fast charging protocol is different from the charging method specified by the super charging protocol / UFCS protocol, and the maximum charging power supported by the fast charging protocol is less than the maximum charging power supported by the UFCS protocol, after the fast charging protocol detection, regardless of whether the fast charging protocol detection succeeds or fails, the UFCS protocol detection must be performed, which is conducive to ensuring that the electronic device is charged at the maximum charging power adapted to the charger.
[0119] The electronic device according to the embodiment of the present application is described below.
[0120] Figure 3 It is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application.
[0121] See also Figure 3 The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a USB interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (Subscriber Identification Module, SIM) card interface 195, etc.
[0122] The processor 110 may include one or more processing units. Different processing units may be independent devices or integrated into one or more processors.
[0123] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory, avoiding repeated access, reducing the waiting time of the processor 110, and thus improving system efficiency.
[0124] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include a USB interface, an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, and a SIM interface.
[0125] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge an electronic device, and can also be used to transfer data between an electronic device and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0126] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0127] The charging management module 140 is used to receive charging input from the charger. In this embodiment, the charging management module 140 can receive the charging input from the charger through the USB interface 130. While the charging management module 140 charges the battery 142, it can also power other electronic devices through the power management module 141.
[0128] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193 and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0129] The wireless communication function of the electronic device can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0130] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some embodiments, the antenna can be used in combination with a tuning switch.
[0131] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied in electronic devices. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (Low Noise Amplifier, LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In other embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0132] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0133] The wireless communication module 160 can provide wireless communication solutions for electronic devices, including wireless local area network (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC) technology, infrared (IR) technology, etc. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0134] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include Global System For Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM and / or IR technology, etc. GNSS may include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), Beidou Navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS) and / or Satellite Based Augmentation System (SBAS).
[0135] The electronic device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0136] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0137] The electronic device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0138] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0139] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0140] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.
[0141] Video codecs are used to compress or decompress digital videos. Electronic devices can support one or more video codecs. In this way, electronic devices can play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0142] NPU is a neural network (NN) computing processor. It can quickly process input information and continuously self-learn by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain. NPU can realize applications such as intelligent cognition of electronic devices, such as image recognition, face recognition, voice recognition, and text understanding.
[0143] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external memory card.
[0144] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash memory (Universal Flash Storage, UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.
[0145] The electronic device can implement audio functions, such as music playing and recording, through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0146] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0147] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device can listen to music or listen to a hands-free call through the speaker 170A.
[0148] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0149] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by putting his mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device can be provided with at least one microphone 170C. In other embodiments, the electronic device can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, and directional recording functions, etc.
[0150] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm Open Mobile Terminal Platform (OMTP) standard interface or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
[0151] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device may receive key input and generate key signal input related to user settings and function control of the electronic device.
[0152] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example, time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0153] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.
[0154] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device and cannot be separated from the electronic device.
[0155] It is understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0156] The embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a computer, the computer executes the charging control method of the embodiment of the present application.
[0157] Computer-readable storage media include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer-readable storage media include, but are not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), flash memory or other memory, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), digital versatile disc (Digital Versatile Disc, DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.
[0158] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present application.
Claims
1. A charging control method, applied to an electronic device, wherein the electronic device supports multiple fast charging protocols, wherein the multiple fast charging protocols include a private protocol and a UFCS protocol, wherein: The method comprises: Based on the electronic device being connected to a charger and determining that the charging interface type of the charger is a dedicated charging interface, performing a connectivity detection and setting a connectivity detection flag; The connectivity detection is used to test whether the charger supports the private protocol, the private protocol includes a super charging protocol and a fast charging protocol, the charging mode specified by the super charging protocol is a super fast charging mode, and the charging mode specified by the fast charging protocol is a discrete voltage regulation mode; the connectivity detection identifier includes a detection success identifier or a detection failure identifier; the execution of the connectivity detection and the setting of the connectivity detection identifier include: sending a Ping data packet to the charger; when an ACK data packet from the charger is received, determining that the connectivity detection is successful, and setting the connectivity detection identifier to the detection success identifier; when the ACK data packet from the charger is not received, determining that the connectivity detection fails, and setting the connectivity detection identifier to the detection failure identifier; Based on the connectivity detection flag being the detection success flag, performing a super charging protocol detection; the super charging protocol detection is used to determine whether the charger supports the super charging protocol; Based on the connectivity detection flag being the detection success flag and the super charging protocol detection failing, performing a fast charging protocol detection; the fast charging protocol detection is used to determine whether the charger supports the fast charging protocol; Based on the completion of the fast charging protocol detection, performing UFCS protocol detection; the UFCS protocol detection is used to determine whether the charger supports the UFCS protocol, and the charging mode specified by the UFCS protocol is the super fast charging mode; Based on the successful detection of the UFCS protocol, the charging mode of the electronic device is set to the super fast charging mode.
2. The charging control method according to claim 1, characterized in that: The method further comprises: Based on the success of the fast charging protocol detection and the failure of the UFCS protocol detection, the charging mode of the electronic device is set to the discrete voltage regulation mode.
3. The charging control method according to claim 1, characterized in that: The method further comprises: Based on the failure of the fast charging protocol detection and the failure of the UFCS protocol detection, the charging mode of the electronic device is set to a normal charging mode.
4. The charging control method according to claim 1, characterized in that: The method further comprises: Based on the successful detection of the super charging protocol, the charging mode of the electronic device is set to the super fast charging mode.
5. The charging control method according to any one of claims 1 to 4, characterized in that: The method further comprises: Based on the success of the super charging protocol detection or the success of the UFCS protocol detection, a super fast charging effective value is set; wherein the super fast charging effective value is used to indicate whether the charger supports the super fast charging mode; Based on the super fast charge effective value being a non-null value, the charging mode of the electronic device is set to the super fast charge mode.
6. The charging control method according to claim 5, characterized in that: The method further comprises: Based on the fast charging protocol detection being successful, setting a fast charging protocol support flag; The fast charging protocol support identifier is used to indicate that the charger supports the discrete voltage regulation mode.
7. The charging control method according to claim 6, characterized in that: The method further comprises: Based on the super fast charge effective value being a null value and the fast charge protocol support flag being non-null, the charging mode of the electronic device is set to the discrete voltage regulation mode.
8. The charging control method according to claim 6, characterized in that: The method further comprises: Based on the super fast charge effective value being a null value and the fast charge protocol support flag being null, the charging mode of the electronic device is set to a normal charging mode.
9. The charging control method according to any one of claims 1 to 4, characterized in that: The method further comprises: Based on the connectivity detection flag being the detection failure flag, the UFCS protocol detection is performed.
10. The charging control method according to any one of claims 1 to 4, characterized in that: The multiple fast charging protocols also include a PPS protocol, and the method further includes: Based on the electronic device being connected to the charger and determining that the charging interface type of the charger is the dedicated charging interface, a PPS protocol detection is performed; the PPS protocol detection is used to determine whether the charger supports the PPS protocol.
11. The charging control method according to claim 10, characterized in that: The method further comprises: Based on the successful detection of the PPS protocol, a super fast charge effective value is set; the super fast charge effective value is used to indicate whether the charger supports the super fast charge mode.
12. The charging control method according to claim 10, characterized in that: The method further comprises: Based on the failure of the PPS protocol detection and the completion of the fast charging protocol detection, the UFCS protocol detection is performed.
13. An electronic device, the electronic device supporting multiple fast charging protocols, characterized in that: The electronic device comprises a charging interface, a memory and a processor, wherein the charging interface is used to connect to a charger, the memory is used to store instructions, and the processor is used to run the instructions stored in the memory, so that the electronic device executes the charging control method according to any one of claims 1 to 12.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer is caused to execute the charging control method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Electronic device and charging method thereof
CN107508330A
Multi-protocol fast charging integrated control system and control method
CN116154921A