Charging method, device and electronic equipment
Patent Information
- Application Number
- CN202310120230.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-02-15
AI Technical Summary
[0004]本申请实施例的目的是提供一种充电方法、装置及电子设备,能够解决相关技术中的电子设备的快充协议存在的兼容性差的问题
[0018]在本申请实施例中,通过在第一快充协议的握手时序过程中,具体是在充电接口的第一信号线处于高电平后的第一时长内,由充电器发送第二快充协议的握手数据,以便电子设备在接收到对应的第一数据包后,按照第二快充协议进行充电,进而在第一快充协议的握手时序过程中实现兼容第二快充协议的握手通信,即实现了一套时序流程兼容两种快充协议,以实现第一快充协议和第二快充协议的兼容,有效的提高了电子设备的对不同快充协议的兼容性。
Smart Images

Figure CN115986887B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technology, specifically relating to a charging method, device, and electronic device. Background Technology
[0002] With the development of fast charging technology, there are more and more mainstream fast charging protocols, and many manufacturers have also released proprietary fast charging protocols. Faced with chargers that support different fast charging protocols, and because mobile phones and other electronic devices are not compatible with multiple fast charging protocols, it is difficult to achieve unified fast charging between chargers and electronic devices.
[0003] It is evident that electronic devices in related technologies suffer from poor compatibility with fast charging protocols. Summary of the Invention
[0004] The purpose of this application is to provide a charging method, device, and electronic device that can solve the problem of poor compatibility of fast charging protocols in related technologies.
[0005] To solve the above-mentioned technical problems, this application is implemented as follows:
[0006] In a first aspect, embodiments of this application provide a charging method applied to an electronic device, the method comprising:
[0007] In the process of detecting whether the charger supports the first fast charging protocol based on the target level timing, when the first signal line of the charging interface of the electronic device is at a high level, the first signal line is configured as the receive signal line of the asynchronous transceiver UART serial port mode, and the second signal line of the charging interface is configured as the transmit signal line of the UART serial port mode.
[0008] If a first data packet supporting the second fast charging protocol is received from the charger within a first time period, charging is performed in accordance with the second fast charging protocol.
[0009] If the first data packet is not received within the first time period, charging shall proceed in accordance with the first fast charging protocol.
[0010] Secondly, embodiments of this application provide a charging device for use in electronic devices, the device comprising:
[0011] The configuration module is used to configure the first signal line of the charging interface of the electronic device as a receive signal line in the asynchronous transceiver UART serial port mode and the second signal line of the charging interface as a transmit signal line in the UART serial port mode when the first signal line of the charging interface of the electronic device is at a high level during the process of detecting whether the charger supports the first fast charging protocol based on the target level timing.
[0012] The first charging module is configured to charge the device according to the second fast charging protocol if it receives a first data packet supporting the second fast charging protocol sent by the charger within a first time period.
[0013] The second charging module is used to charge the device according to the first fast charging protocol if the first data packet is not received within the first time period.
[0014] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0015] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0016] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0017] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.
[0018] In this embodiment, during the handshake timing process of the first fast charging protocol, specifically within the first duration after the first signal line of the charging interface is at a high level, the charger sends handshake data of the second fast charging protocol. This allows the electronic device to charge according to the second fast charging protocol after receiving the corresponding first data packet. Thus, the handshake communication compatible with the second fast charging protocol is achieved during the handshake timing process of the first fast charging protocol. In other words, a single timing process is implemented to be compatible with two fast charging protocols, thereby achieving compatibility between the first and second fast charging protocols and effectively improving the compatibility of the electronic device with different fast charging protocols. Attached Figure Description
[0019] Figure 1 This is a block diagram of the charging architecture provided in an embodiment of this application;
[0020] Figure 2 This is one of the flowcharts of the charging method provided in the embodiments of this application;
[0021] Figure 3 This is a handshake timing diagram of the charging method provided in the embodiments of this application;
[0022] Figure 4 This is the second flowchart of the charging method provided in the embodiments of this application;
[0023] Figure 5 This is the third flowchart of the charging method provided in the embodiments of this application;
[0024] Figure 6 This is a structural diagram of the charging device provided in the embodiments of this application;
[0025] Figure 7 This is one of the structural diagrams of the electronic device provided in the embodiments of this application;
[0026] Figure 8 This is the second structural diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0029] To facilitate understanding of the charging process of electronic devices, we will first explain the charging architecture of electronic devices.
[0030] During the charging process of an electronic device, information exchange between the electronic device and the charger can be achieved through the signal lines in the charging interface of the electronic device and the signal lines in the charging connector of the charger.
[0031] In this application, "electronic device" can be understood as a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. "Charger" in this application can be understood as a charging device capable of charging the aforementioned terminal electronic devices.
[0032] See Figure 1 , Figure 1 This is a block diagram of the charging architecture provided in an embodiment of this application. Figure 1 As shown, the charging architecture includes an electronic device 100 and a charger 200. The charging interface of the electronic device 100 can be a Universal Serial Bus (USB) interface, and the signal lines of this USB interface can be defined as USB positive data signal lines (i.e., D+ signal lines) and USB negative data signal lines (i.e., D- signal lines). Correspondingly, the charging connector of the charger 200 can be a USB connector, and the signal lines of the USB connector can be defined as USB positive data signal lines (i.e., D+ signal lines) and USB negative data signal lines (i.e., D- signal lines). This allows for communication between the electronic device 100 and the charger 200 through the D+ / D- signal lines of the charging interface and the charging connector, thus enabling the charging process of the electronic device 100.
[0033] For example, for the Universal Fast Charging Specification (UFCS), the fast charging process can be implemented using the standard Universal Asynchronous Receiver / Transmitter (UART) serial data format based on the D+ / D- signal lines of the charging interface. The handshake process can be a combination of level pulse timing and serial data ping to achieve the corresponding fast charging process for UFCS. Similarly, for proprietary fast charging protocols from various manufacturers, the fast charging process can also be implemented using the standard UART serial data format based on the level timing of the D+ / D- signal lines and the proprietary handshake instructions corresponding to that protocol.
[0034] The charging method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0035] See Figure 2 , Figure 2 This is one of the flowcharts of a charging method provided in the embodiments of this application. The charging method provided in the embodiments of this application can be applied to electronic devices, such as... Figure 2 As shown, the charging method includes the following steps:
[0036] Step 201: During the process of detecting whether the charger supports the first fast charging protocol based on the target level timing, when the first signal line of the charging interface of the electronic device is at a high level, the first signal line is configured as a receive signal line of the asynchronous transceiver UART serial port mode, and the second signal line of the charging interface is configured as a transmit signal line of the UART serial port mode.
[0037] In this step, the target level timing can be the level timing corresponding to the first fast charging protocol. That is, the target level timing can be used to detect whether the charger supports the first fast charging protocol. Moreover, by configuring the first signal line as a receive signal line in UART serial port mode and configuring the second signal line of the charging interface as a transmit signal line in UART serial port mode, the data interaction efficiency between the electronic device and the charger can be improved.
[0038] The first fast charging protocol can be UFCS, or it can be a proprietary fast charging protocol of some manufacturers, such as Adaptive Fast Charging (AFC), Fast Charger Protocol (FCP), etc.
[0039] When the first fast charging protocol is UFCS, the charger's support for UFCS can be detected by the UFCS level timing sequence; that is, the target level timing sequence can be the UFCS level timing sequence.
[0040] For example, when the charging interface is a USB interface, the first signal line can be defined as the D+ signal line, and the second signal line can be defined as the D- signal line. Specifically, during the process of detecting whether the charger supports UFCS via the UFCS level timing sequence, and if the pulse timing corresponding to the D- signal line outputting a high level and maintaining it for time T1, the D- signal line outputting a low level and maintaining it for time T2, the D- signal line outputting a high level and maintaining it for time T3, and the D- signal line outputting a low level and maintaining it for time T4 is detected, then the system waits for the D+ signal line to enter a high level.
[0041] Under normal circumstances, the D+ signal line is pulled high by the charger. If the charger fails to pull the D+ signal line high, the electronic device can actively pull it high. Once the D+ signal line is high, it can be configured as a receive signal line in UART serial port mode, and the D- signal line as a transmit signal line in UART serial port mode, thereby improving the data exchange efficiency between the electronic device and the charger.
[0042] It is understood that the high and low levels in this application are mainly used to characterize the level state of signal lines. For example, a high level can refer to a high signal or high voltage; a low level can refer to zero voltage or a low bit.
[0043] Optionally, before step 201, it is possible to detect whether a charger connector is inserted into the charging port of the electronic device. If a charger connector is detected inserted into the charging port, the type of charger can be identified to determine whether the charger is a fast charger. If the charger is identified as a fast charger, step 201 is executed.
[0044] The charger type can be identified using the Universal Charging Type Identification Protocol (Battery Charging v1.2, BC1.2).
[0045] Step 202: If a first data packet supporting the second fast charging protocol is received from the charger within the first time period, charging is performed according to the second fast charging protocol.
[0046] In this step, the first data packet can be understood as a handshake data packet initiated by the charger that supports the second fast charging protocol; if the first data packet sent by the charger is received within the first time period, fast charging is performed according to the second fast charging protocol to achieve fast charging of electronic devices.
[0047] Step 203: If the first data packet is not received within the first time period, charge according to the first fast charging protocol.
[0048] In this step, if the first data packet is not received within the first time period, charging is performed according to the first fast charging protocol to achieve fast charging of the electronic device.
[0049] In this way, during the handshake timing process of the first fast charging protocol, specifically within the first duration after the first signal line of the charging interface is at a high level, the charger sends the handshake data of the second fast charging protocol. This allows the electronic device to charge according to the second fast charging protocol after receiving the corresponding first data packet. Thus, the handshake communication of the first fast charging protocol is compatible with the second fast charging protocol during the handshake timing process. In other words, a single timing process is compatible with two fast charging protocols, achieving compatibility between the first and second fast charging protocols and effectively improving the compatibility of electronic devices with different fast charging protocols.
[0050] See Figure 3 , Figure 3 This is a handshake timing diagram of the charging method provided in the embodiments of this application. For example... Figure 3 As shown, the handshake timing diagram includes a first timing block 31, a second timing block 32, a third timing block 33, and a fourth timing block 34. Specifically, the first timing block 31 can be used to characterize the charger type identification timing; the second timing block 32 can be used to characterize the level detection timing for whether the charger supports the first fast charging protocol; the third timing block 33 can be used to characterize the handshake timing corresponding to the second fast charging protocol; and the fourth timing block 34 can be used to characterize the handshake timing corresponding to the first fast charging protocol.
[0051] By integrating the handshake timing of the second fast charging protocol with that of the first fast charging protocol, a single timing process is made compatible with both fast charging protocols, effectively improving the compatibility of electronic devices with different fast charging protocols.
[0052] Optionally, the step of charging according to the first fast charging protocol when the first data packet is not received within the first time period includes:
[0053] If the first data packet is not received within the first time period, a second data packet supporting the first fast charging protocol is sent to the charger.
[0054] Upon receiving a response message from the charger in response to the second data packet, charging is performed according to the first fast charging protocol.
[0055] In this embodiment, the second data packet can be understood as a handshake data packet initiated by the electronic device to the charger that supports the first fast charging protocol, so that upon receiving the response information sent by the charger for the second data packet, charging is performed according to the first fast charging protocol to achieve fast charging of the electronic device.
[0056] When the charger receives a second data packet supporting the first fast charging protocol from the electronic device, the charger can send a response message to the electronic device via the first signal line. This response message indicates that the charger has received the second data packet supporting the first fast charging protocol from the electronic device. When the electronic device receives the response message from the charger, it can determine that the charger has received the second data packet and charge the device according to the first fast charging protocol.
[0057] In some implementations, the first data packet can be transmitted based on the first signal line, the second data packet can be transmitted based on the second signal line, and the first signal line and the second signal line are different physical signal lines on the charging interface.
[0058] For example, the system can wait for the charger to initiate a handshake data packet for the second fast charging protocol on the first signal line (D+ signal line) within a first time period, and can send a handshake data packet for the first fast charging protocol to the charger on the second signal line (D- signal line). By setting it up in this way, the handshake data packet for the second fast charging protocol is transmitted through the first signal line, and the handshake data packet for the first fast charging protocol is transmitted through the second signal line. This defines the two handshake data packets on two different physical buses, effectively avoiding handshake data packet conflicts and improving the fast charging process of electronic devices.
[0059] It is understandable that by configuring the first signal line as the receive signal line in UART serial port mode and the second signal line as the transmit signal line in UART serial port mode, the handshake data packets of the first fast charging protocol and the second fast charging protocol can be transmitted and received based on the asynchronous transmit and receive mode of the UART serial port, thus avoiding conflicts between handshake data packets.
[0060] See Figure 4 , Figure 4 This is the second flowchart of the charging method provided in the embodiments of this application. For example... Figure 4 As shown, this charging method is applied to electronic devices. In this embodiment, the first fast charging protocol can be UFCS, and the second fast charging protocol can be a proprietary fast charging protocol, in order to provide a specific description of the charging method. Specifically, the charging method provided in this embodiment includes the following steps:
[0061] Step 401: Check if the charger is plugged in.
[0062] If a charger is detected to be inserted, step 402 is executed; if no charger is detected to be inserted, the process ends or step 401 is executed.
[0063] Step 402: Detect the charger type based on BC1.2.
[0064] If the charger is detected to be a fast charger, step 403 is executed; if the charger is detected to be a regular charger, the electronic device is charged in the normal charging mode.
[0065] Step 403: Check whether the pulse timing conforms to the following: D-signal line outputs high level and maintains it for time T1, D-signal line outputs low level and maintains it for time T2, D-signal line outputs high level and maintains it for time T3, and D-signal line outputs low level and maintains it for time T4.
[0066] Step 404: Wait for the D+ signal line to enter a high level.
[0067] If the D+ signal line is directly pulled high through the charger, proceed to step 405; if the D+ signal line cannot be directly pulled high through the charger, it is actively pulled high by the electronic device. For example, in the case of a mobile phone, the mobile phone can actively pull the signal high.
[0068] Step 405: Configure the D+ signal line as the receive signal line in UART serial port mode, and configure the D- signal line as the transmit signal line in UART serial port mode.
[0069] At this time, both the D+ and D- signal lines are at a high level.
[0070] Step 406: Detect whether the D+ signal line receives the handshake data packet of the XX private fast charging protocol sent by the charger within the first time period.
[0071] If a handshake data packet of the XX proprietary fast charging protocol is received, the electronic device will be charged according to the XX proprietary fast charging protocol; if no handshake data packet of the XX proprietary fast charging protocol is received, step 407 will be executed.
[0072] Step 407: Send a UFCS ping data packet to the charger on the D-signal line.
[0073] Step 408: Check if a response to the ping data packet sent by the charger to the UFCS is received on the D+ signal line.
[0074] If received, proceed to step 409; if not received, charge the electronic device in the normal charging mode.
[0075] Step 409: Charge the electronic device according to UFCS.
[0076] Optionally, the method further includes:
[0077] When the electronic device is plugged into the charger, based on the historical charging records of the electronic device, at least two historical fast charging protocols corresponding to the historical charging records are polled in a loop.
[0078] During the polling process, once the target fast charging protocol among the at least two historical fast charging protocols successfully hands over, charging is performed according to the target fast charging protocol.
[0079] In the polling process, the polling order of the at least two historical fast charging protocols is related to the historical charging records.
[0080] In this embodiment, based on the historical charging records of the electronic device, at least two historical fast charging protocols supported by the electronic device can be determined. This allows the charger to be polled and handshaked with the at least two historical fast charging protocols. Once the target fast charging protocol among the at least two historical fast charging protocols successfully hands over, charging is performed according to the target fast charging protocol, thereby improving the efficiency of the handshake between the electronic device and the charger.
[0081] Specifically, the polling order of at least two historical fast charging protocols is related to historical charging records; and the handshake time corresponding to at least two historical fast charging protocols is less than the target threshold. Thus, during the polling process of at least two historical fast charging protocols, since the handshake time of each historical fast charging protocol is less than the target threshold, each fast charging protocol has multiple opportunities to attempt handshakes, effectively preventing a single fast charging protocol from continuously preempting the time.
[0082] In some implementations, the target threshold can be understood as the minimum handshake duration. For example, in a conventional handshake process, the handshake attempt time for each protocol can reach tens of seconds or even several minutes, and only if the handshake times out will a second fast charging protocol be attempted. In this application, by setting the handshake attempt duration for each fast charging protocol to be less than the target threshold, which is much less than tens of seconds, such as 1 second, each fast charging protocol has multiple opportunities to attempt handshakes, effectively preventing a certain fast charging protocol from constantly preempting the time.
[0083] For example, when there are at least two historical fast charging protocols including a first fast charging protocol, a second fast charging protocol, and a third fast charging protocol, and the polling order of the first fast charging protocol, the second fast charging protocol, and the third fast charging protocol based on the historical charging records is the first fast charging protocol, the third fast charging protocol, and the second fast charging protocol, then the first fast charging protocol, the second fast charging protocol, and the third fast charging protocol can be numbered and sorted to obtain the corresponding numbering and sorting relationship. This numbering and sorting relationship can be specifically represented as 1. first fast charging protocol, 2. third fast charging protocol, 3. second fast charging protocol, that is, the number corresponding to the first fast charging protocol is 1, the number corresponding to the third fast charging protocol is 2, and the number corresponding to the second fast charging protocol is 3.
[0084] If an electronic device is detected to be electrically connected to the charger, a protocol handshake based on the first fast charging protocol can be attempted within a second time period. If the protocol handshake based on the first fast charging protocol is successful within the second time period, charging will proceed directly according to the first fast charging protocol. If the protocol handshake based on the first fast charging protocol fails within the second time period, a protocol handshake based on the third fast charging protocol can be attempted within a new time period (i.e., the second time period). If the protocol handshake based on the third fast charging protocol is successful within the second time period, charging will proceed directly according to the third fast charging protocol. If the protocol handshake based on the third fast charging protocol fails within the second time period, a protocol handshake based on the second fast charging protocol can be attempted within a new time period (i.e., the second time period). If the protocol handshake based on the second fast charging protocol is successful within the second time period, charging will proceed directly according to the second fast charging protocol. If the protocol handshake based on the second fast charging protocol fails within the second time period, a protocol handshake based on the first fast charging protocol can be attempted again within a new time period (i.e., the second time period).
[0085] By configuring it this way, each fast charging protocol is given only a second set of time to attempt a handshake. For example, setting the target threshold to 1 second means that each fast charging protocol is given only 1 second to attempt a handshake, after which other fast charging protocols are switched. In this way, all fast charging protocols can continuously cycle and switch, and each fast charging protocol has multiple opportunities to attempt a handshake, preventing any one fast charging protocol from constantly preempting the time, effectively improving the efficiency of successful handshakes between electronic devices and chargers.
[0086] Further optionally, after charging according to the target fast charging protocol, the method further includes:
[0087] The historical charging records are updated based on the target fast charging protocol.
[0088] In this embodiment, after the target fast charging protocol and the charger successfully handshake, the historical charging records can be updated based on the target fast charging protocol to improve handshake efficiency.
[0089] For example, the numbering order can be updated based on the numbering information of the target fast charging protocol in the numbering order, so that when the charger is used for charging again, the target fast charging protocol ranked first in the updated numbering order can be used to perform a protocol handshake with the charger, thereby accelerating the handshake process between the electronic device and the charger and improving the handshake success rate.
[0090] For example, if the target fast charging protocol is the third fast charging protocol, then the updated numbering order will be 1. Third fast charging protocol, 2. Second fast charging protocol, 3. First fast charging protocol. That is, when a new handshake poll is conducted based on the updated numbering order, the third fast charging protocol, which is ranked first, will be used to conduct the protocol handshake with the charger first. For the numbering order before the update, the first fast charging protocol, which is ranked first, will be used to conduct the protocol handshake with the charger first.
[0091] In this way, for the same charger, once a user has used it, the second time they plug it in, it can quickly establish a handshake and enter the corresponding fast charging protocol, thereby improving the handshake efficiency.
[0092] See Figure 5 , Figure 5 This is the third flowchart of the charging method provided in the embodiments of this application. Figure 5 As shown, this charging method can be applied to electronic devices that support multiple fast charging protocols. The supported fast charging protocols are numbered and sorted to obtain a corresponding numbering and sorting relationship. In this embodiment, the numbering and sorting relationship can be: 1. UFCS, 2. Proprietary fast charging protocol, 3. Other protocols.
[0093] The charging method specifically includes the following steps:
[0094] Step 501: Determine the numbering order relationship. The numbering order relationship is: 1. UFCS, 2. Private fast charging protocol, 3. Other protocols, and protocol_identifier = 1.
[0095] In this context, "protocol_identifier = 1" indicates that UFCS, which is numbered 1 in the numbering sequence, is the first fast charging protocol to initiate a protocol handshake with the charger among all fast charging protocols in the numbering sequence.
[0096] Step 502: Check if the charger is plugged in.
[0097] If a charger is detected to be inserted, step 503 is executed; if no charger is detected to be inserted, the process ends or step 502 is executed.
[0098] Step 503: Based on the numbering order, the fast charging protocols among the multiple fast charging protocols are sequentially handshaked with the charger for a second duration.
[0099] With protocol_identifier = 1, the UFCS protocol handshake begins. Then, the D-signal outputs a protocol pulse to confirm whether the charger responds. If it responds, the D-signal sends a PING data packet to the charger via serial port TX. Upon receiving the charger's response PING data packet, the UFCS handshake is considered successful, and UFCS fast charging is initiated. If there is no response, protocol_identifier = 1 is updated to protocol_identifier = 2. Additionally, if no response PING data packet is received from the charger, protocol_identifier = 1 is also updated to protocol_identifier = 2.
[0100] After Protocol_Identifier = 1 is updated to Protocol_Identifier = 2, the private fast charging protocol handshake begins, and then the D+ / D- signals are simultaneously pulled up to the protocol level; the D+ signal is used as serial port Rx to start receiving data; it checks whether the handshake data packet sent by the charger is received; if received, it is determined that the private fast charging protocol handshake is successful, and fast charging is performed using the private fast charging protocol; if not received, Protocol_Identifier = 2 is updated to Protocol_Identifier = 3.
[0101] After Protocol_Identifier = 2 is updated to Protocol_Identifier = 3, other protocol handshakes begin; then, the success of other protocol handshakes is checked; if other protocol handshakes are successful, fast charging is performed using other protocols; if unsuccessful, Protocol_Identifier = 3 is updated to Protocol_Identifier = 1; and the next cycle is started, that is, the UFCS protocol handshake is restarted.
[0102] Step 504: Check if the charger is unplugged.
[0103] If a charger is detected to be unplugged, the numbering order is updated based on the fast charging records; if no charger is detected to be unplugged, the detection continues or the process ends.
[0104] In this system, the next charging cycle can directly start polling from the saved protocol identifier to accelerate the protocol entry speed. This way, each charging cycle records and saves the previous successful handshake protocol, and the next charging cycle starts the handshake directly from the recorded value, thus accelerating the fast charging process.
[0105] In some implementations, based on the user's charging behavior, the charger used for a period of time is basically a fixed type. In this case, various protocols are continuously polled and tried in a short time slice, and the protocol numbers of successful handshakes are learned and saved on the mobile phone and other electronic devices. When the user plugs in the charger again, the saved protocol numbers can be used directly to perform fast charging handshake, thereby speeding up the fast charging process and improving the user experience.
[0106] The charging method of this application embodiment, during the process of detecting whether the charger supports a first fast charging protocol based on the target level timing, configures the first signal line of the charging interface of the electronic device as a receive signal line in the asynchronous transceiver transmitter (UART) serial port mode and configures the second signal line of the charging interface as a transmit signal line in the UART serial port mode when the first signal line of the charging interface is at a high level; if a first data packet supporting a second fast charging protocol is received from the charger within a first time period, charging is performed according to the second fast charging protocol; if the first data packet is not received within the first time period, charging is performed according to the first fast charging protocol. This effectively improves the compatibility of the electronic device with different fast charging protocols.
[0107] The charging method provided in this application can be executed by a charging device. This application uses the example of a charging device executing the charging method to illustrate the charging device provided in this application.
[0108] See Figure 6 , Figure 6 This is a structural diagram of a charging device provided in an embodiment of this application, as shown below. Figure 6 As shown, the charging device 600 includes:
[0109] The configuration module 601 is used to configure the first signal line of the charging interface of the electronic device as a receive signal line of the asynchronous transceiver UART serial port mode and the second signal line of the charging interface as a transmit signal line of the UART serial port mode when the first signal line of the charging interface of the electronic device is at a high level during the process of detecting whether the charger supports the first fast charging protocol based on the target level timing.
[0110] The first charging module 602 is used to charge according to the second fast charging protocol when it receives a first data packet supporting the second fast charging protocol sent by the charger within a first time period.
[0111] The second charging module 603 is used to charge the device according to the first fast charging protocol if the first data packet is not received within the first time period.
[0112] Optionally, the second charging module 603 is specifically configured to send a second data packet supporting the first fast charging protocol to the charger if the first data packet is not received within the first time period; and to charge according to the first fast charging protocol if a response information for the second data packet is received from the charger.
[0113] Optionally, the first data packet is transmitted based on the first signal line, and the second data packet is transmitted based on the second signal line.
[0114] Optionally, the device 600 further includes:
[0115] The polling module is used to poll at least two historical fast charging protocols corresponding to the historical charging records of the electronic device when the charger is plugged in.
[0116] The third charging module is used to charge according to the target fast charging protocol after the target fast charging protocol among the at least two historical fast charging protocols successfully hands together during the polling process.
[0117] In the polling process, the polling order of the at least two historical fast charging protocols is related to the historical charging records.
[0118] Optionally, the device 600 further includes:
[0119] The update module is used to update the historical charging records based on the target fast charging protocol.
[0120] Optionally, during the polling process, the handshake time corresponding to at least two historical fast charging protocols is less than the target threshold.
[0121] Optionally, the first fast charging protocol is the Unified Fast Charging Standard (UFCS).
[0122] The charging device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific type of device.
[0123] The charging device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0124] The charging device provided in this application embodiment can achieve Figures 2 to 5 The various processes implemented in the method embodiments achieve the same technical effect, and will not be described again here to avoid repetition.
[0125] Optionally, such as Figure 7 As shown, this application embodiment also provides an electronic device 700, including a processor 701 and a memory 702. The memory 702 stores a program or instructions that can run on the processor 701. When the program or instructions are executed by the processor 701, they implement the various steps of the above-described charging method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0126] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0127] See Figure 8 , Figure 8 This is a structural diagram of an electronic device provided in an embodiment of this application, as shown below. Figure 8 As shown, the electronic device 800 includes, but is not limited to, components such as: radio frequency unit 801, network module 802, audio output unit 803, input unit 804, sensor 805, display unit 806, user input unit 807, interface unit 808, memory 809, and processor 810.
[0128] Those skilled in the art will understand that the electronic device 800 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 810 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 8 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0129] The processor 810 is configured, during the process of detecting whether the charger supports the first fast charging protocol based on the target level timing, to configure the first signal line of the charging interface of the electronic device as a receive signal line in the asynchronous transceiver transmitter (UART) serial port mode and the second signal line of the charging interface as a transmit signal line in the UART serial port mode when the first signal line of the charging interface of the electronic device is at a high level; and to charge according to the second fast charging protocol when a first data packet supporting the second fast charging protocol is received from the charger within a first duration; and to charge according to the first fast charging protocol when the first data packet is not received within the first duration.
[0130] Optionally, the interface unit 808 is configured to send a second data packet supporting the first fast charging protocol to the charger if the first data packet is not received within the first time period; the processor 810 is configured to charge according to the first fast charging protocol upon receiving a response information from the charger for the second data packet.
[0131] Optionally, the first data packet is transmitted based on the first signal line, and the second data packet is transmitted based on the second signal line.
[0132] Optionally, the processor 810 is configured to, when the electronic device is plugged into a charger, poll at least two historical fast charging protocols corresponding to the historical charging records of the electronic device in a loop-based manner; and to, during the polling process, when a target fast charging protocol among the at least two historical fast charging protocols successfully hands over, charge according to the target fast charging protocol; wherein the polling order of the at least two historical fast charging protocols during the polling process is related to the historical charging records.
[0133] Optionally, the processor 810 updates the historical charging records based on the target fast charging protocol.
[0134] Optionally, the handshake time corresponding to the at least two historical fast charging protocols is less than the target threshold.
[0135] Optionally, the first fast charging protocol is the Unified Fast Charging Standard (UFCS).
[0136] It should be understood that, in this embodiment, the input unit 804 may include a graphics processing unit (GPU) 8041 and a microphone 8042. The GPU 8041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 806 may include a display panel 8061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 807 includes at least one of a touch panel 8071 and other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0137] The memory 809 can be used to store software programs and various data. The memory 809 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 809 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 809 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0138] Processor 810 may include one or more processing units; optionally, processor 810 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 810.
[0139] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described charging method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0140] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0141] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above charging method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0142] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0143] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the charging method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0144] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0145] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0146] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A charging method, characterized in that, Applied to electronic devices, the method includes: In the process of detecting whether the charger supports the first fast charging protocol based on the target level timing, when the first signal line of the charging interface of the electronic device is at a high level, the first signal line is configured as the receive signal line of the asynchronous transceiver UART serial port mode, and the second signal line of the charging interface is configured as the transmit signal line of the UART serial port mode. If a first data packet supporting the second fast charging protocol is received from the charger within a first time period, charging is performed in accordance with the second fast charging protocol. If the first data packet is not received within the first time period, charging shall proceed in accordance with the first fast charging protocol; The method further includes: When the electronic device is plugged into the charger, based on the historical charging records of the electronic device, at least two historical fast charging protocols corresponding to the historical charging records are polled in a loop. During the polling process, once the target fast charging protocol handshake is successful, charging is performed according to the target fast charging protocol that has successfully completed the handshake. The target fast charging protocol is one of the at least two historical fast charging protocols. The polling order of the at least two historical fast charging protocols during the polling process is related to the historical charging records.
2. The method according to claim 1, characterized in that, The step of charging according to the first fast charging protocol when the first data packet is not received within the first time period includes: If the first data packet is not received within the first time period, a second data packet supporting the first fast charging protocol is sent to the charger. Upon receiving a response message from the charger in response to the second data packet, charging is performed according to the first fast charging protocol.
3. The method according to claim 2, characterized in that, The first data packet is transmitted based on the first signal line, and the second data packet is transmitted based on the second signal line.
4. The method according to claim 1, characterized in that, After charging according to the target fast charging protocol, the method further includes: The historical charging records are updated based on the target fast charging protocol.
5. The method according to claim 1, characterized in that, During the polling process, the handshake time corresponding to at least two historical fast charging protocols is less than the target threshold.
6. The method according to any one of claims 1 to 3, characterized in that, The first fast charging protocol is the Unified Fast Charging Standard (UFCS).
7. A charging device, characterized in that, Applied to electronic devices, the device includes: The configuration module is used to configure the first signal line of the charging interface of the electronic device as a receive signal line in the asynchronous transceiver UART serial port mode and the second signal line of the charging interface as a transmit signal line in the UART serial port mode when the first signal line of the charging interface of the electronic device is at a high level during the process of detecting whether the charger supports the first fast charging protocol based on the target level timing. The first charging module is configured to charge the device according to the second fast charging protocol if it receives a first data packet supporting the second fast charging protocol sent by the charger within a first time period. The second charging module is used to charge the device according to the first fast charging protocol if the first data packet is not received within the first time period. The device further includes: The polling module is used to poll at least two historical fast charging protocols corresponding to the historical charging records of the electronic device when the charger is plugged in. The third charging module is used to charge according to the target fast charging protocol after the target fast charging protocol handshake is successful during the polling process. The target fast charging protocol is one of the at least two historical fast charging protocols. In the polling process, the polling order of the at least two historical fast charging protocols is related to the historical charging records.
8. The apparatus according to claim 7, characterized in that, The second charging module is specifically used to send a second data packet supporting the first fast charging protocol to the charger if the first data packet is not received within the first time period. And, upon receiving a response message from the charger for the second data packet, to charge according to the first fast charging protocol.
9. The apparatus according to claim 8, characterized in that, The first data packet is transmitted based on the first signal line, and the second data packet is transmitted based on the second signal line.
10. The apparatus according to claim 7, characterized in that, The device further includes: The update module is used to update the historical charging records based on the target fast charging protocol.
11. The apparatus according to claim 7, characterized in that, During the polling process, the handshake time corresponding to at least two historical fast charging protocols is less than the target threshold.
12. The apparatus according to any one of claims 7 to 9, characterized in that, The first fast charging protocol is the Unified Fast Charging Standard (UFCS).
13. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a program or instructions executable on the processor, which, when executed by the processor, implement the steps of the charging method as described in any one of claims 1 to 6.
14. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the charging method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Charging method and charger
CN107516919A
Charging method and device, and terminal
CN109560591A