Charging control method and device, terminal equipment, chip and storage medium
By obtaining the current output current of the adapter and the target charging current of the terminal device, and determining and sending the target charging request, the charging interruption problem caused by overcurrent protection during fast charging is solved, and the charging stability is improved.
Patent Information
- Application Number
- CN202310996339.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-08
- Publication Date
- 2025-02-18
AI Technical Summary
During the fast charging process, the terminal device is prone to trigger overcurrent protection, resulting in interruption of charging, which in turn makes the charging process unstable.
By obtaining the current output current of the adapter and the target charging current of the terminal device, the charging parameters of the adapter are determined, including the target charging voltage that the terminal device applies to the adapter, and sending a target charging request to the adapter to adjust its output voltage.
This solution can timely obtain the current output current of the adapter, dynamically adjust its output voltage, prevent the occurrence of overcurrent protection, thereby improving the stability of charging of terminal devices.
Smart Images

Figure CN119482780A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of charging technology, and in particular to a charging control method, device, terminal equipment, chip and storage medium. Background Art
[0002] With the development of science and technology, various terminal devices appear in people's daily lives. When the terminal device is low on power, it needs to be charged.
[0003] In the charging technology of terminal devices, fast charging has become an essential function for most terminal devices, and many fast charging protocols have emerged in the field of fast charging. For example, in the fast charging protocol that integrates the Universal Fast Charging Specification (UFCS), the fast charging path between the terminal device and the adapter that supports the UFCS protocol often controls charging by first adjusting the voltage and then adjusting the current. It directly applies to the adapter for the maximum voltage that can meet the battery charging current, and then gradually adjusts the charging current. The whole process easily triggers the over-current protection (OCP) and causes intermittent charging, resulting in an unstable charging process for the terminal device. Summary of the invention
[0004] In order to improve the charging stability of terminal equipment, the embodiments of the present application provide a charging control method, device, terminal equipment, chip and storage medium. The technical solution is as follows:
[0005] In one aspect, the present application provides a charging control method, applied to a terminal device, the method comprising:
[0006] In the case where the terminal device is charged through an adapter, obtaining a current output current of the adapter and a target charging current of the terminal device, where the target charging current is the charging current currently required by the terminal device;
[0007] Determining charging parameters of the adapter according to the current output current of the adapter and the target charging current of the terminal device, wherein the charging parameters include the target charging voltage requested by the terminal device to the adapter;
[0008] A target charging request is sent to the adapter, where the target charging request includes the target charging voltage, so that the adapter adjusts a current output voltage to the target charging voltage.
[0009] In one aspect, the present application provides a charging control device, applied to a terminal device, the device comprising:
[0010] A first acquisition module, configured to acquire, when charging the terminal device through an adapter, a current output current of the adapter and a target charging current of the terminal device, wherein the target charging current is a charging current currently required by the terminal device;
[0011] A first determining module, configured to determine a charging parameter of the adapter according to a current output current of the adapter and a target charging current of the terminal device, wherein the charging parameter includes a target charging voltage requested by the terminal device to the adapter;
[0012] The first sending module is used to send a target charging request to the adapter, where the target charging request includes the target charging voltage, so that the adapter adjusts the current output voltage to the target charging voltage.
[0013] In another aspect, the present application provides a terminal device, which includes a processor and a memory, wherein the memory stores a computer program, and the computer program is executed by the processor to implement the charging control method as described in one aspect.
[0014] In another aspect, the present application provides a chip, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program is executed by the processor to implement the charging control method as described in one aspect.
[0015] In another aspect, the present application provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to implement the charging control method as described in one aspect.
[0016] On the other hand, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the charging control method as described in one aspect above.
[0017] On the other hand, an embodiment of the present application provides an application publishing platform, which is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes the charging control method as described in one aspect above.
[0018] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0019] When charging a terminal device through an adapter, the current output current of the adapter and the target charging current of the terminal device are obtained, and the target charging current is the charging current currently required by the terminal device; the charging parameters of the adapter are determined according to the current output current of the adapter and the target charging current of the terminal device, and the charging parameters include the target charging voltage requested by the terminal device to the adapter; a target charging request is sent to the adapter, and the target charging request includes the target charging voltage, so that the adapter adjusts the current output voltage to the target charging voltage. This solution will obtain the current output current of the adapter, and determine the charging parameters of the adapter in combination with the charging current currently required by the terminal device, and send a target charging request containing the charging parameters to the adapter, so that the current output current of the adapter can be obtained in time and the output voltage of the adapter can be dynamically adjusted to prevent the OCP phenomenon and improve the stability of charging the terminal device. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a schematic diagram of a circuit structure for charging in a terminal device provided by an exemplary embodiment of the present application;
[0022] Figure 2 is a schematic diagram of an example structure of a terminal device provided in an embodiment of the present application;
[0023] Figure 3 is a method flow chart of a charging control method provided by an exemplary embodiment of the present application;
[0024] Figure 4 It is a structural schematic diagram of a fast charging circuit involved in an exemplary embodiment of the present application;
[0025] Figure 5 is a method flow chart of a charging control method provided by an exemplary embodiment of the present application;
[0026] Figure 6 is a method flow chart of a charging control method provided by an exemplary embodiment of the present application;
[0027] Figure 7 is a structural block diagram of a charging control device provided by an exemplary embodiment of the present application;
[0028] Figure 8It is a structural schematic diagram of another example of a charging control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0030] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0031] The solution provided by the present application can be used in real-life scenarios where people charge terminal devices when using terminal devices in daily life. To facilitate understanding, the application scenarios involved in the embodiments of the present application are first briefly introduced below.
[0032] With the continuous development of science and technology, people use terminal devices in more and more scenarios in their daily lives. Terminal devices use batteries to power themselves. When the battery of the terminal device is low, the battery of the terminal device needs to be charged. And with the rapid development of fast charging technology for terminal devices, especially in terms of charging speed, charging safety, and intelligent charging management, the fast charging experience has been widely recognized by the majority of users and has become a standard feature of smart terminals such as mobile phones. However, the fast charging industry has long had the problem of incompatibility of protocols: different brands of terminals and adapters cannot be effectively identified, and can only achieve low-power charging. On the one hand, the user's fast charging experience is greatly restricted and limited, and the incompatibility problem has become a major pain point for users; on the other hand, due to the lack of unified charging standards, the risks and costs of upstream and downstream manufacturers in the industry chain to develop universal fast charging power chips and accessories are relatively high. The inconsistency of technical standards will also hinder the long-term development of terminal green energy and circular economy. Therefore, a converged fast charging standard for mobile terminals is formulated to solve the incompatibility problem of interoperable fast charging. It also serves as the basis for the long-term evolution of fast charging technology, promotes the interoperability of manufacturers' fast charging technology in existing terminals in the industry, and guides and regulates the product development and production of equipment manufacturers (upstream and downstream industrial chains) to create fast, safe and compatible charging for end users.
[0033] Please refer to Figure 1, which shows a schematic diagram of a circuit structure for charging in a terminal device provided by an exemplary embodiment of the present application. Figure 1 As shown, a terminal device 101 and a charger 102 are included.
[0034] Optionally, the terminal device is a rechargeable terminal device, for example, the terminal device may include but is not limited to wearable devices (such as bracelets, smart watches, smart glasses, etc.), mobile phones, tablet computers, laptops, smart glasses, smart watches, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) players, desktop computers, laptops, etc.
[0035] Optionally, the circuit connection of the charger 102 is exemplary, and in actual applications, the terminal device 101 may also support wireless charging, and the charger 102 may also be a charger that supports wireless charging.
[0036] Please refer to Figure 2 , is a schematic diagram of an example structure of a terminal device provided in an embodiment of the present application. Figure 2 The terminal device shown includes components such as a processor 210, a memory 220, a transceiver 230, a display unit 240, an input unit 250, a sensor 260, an audio circuit 270, and a power module 280.
[0037] The processor 210 is the control center of the terminal, and uses various interfaces and lines to connect various parts of the entire terminal. By running or executing software programs and / or modules stored in the memory 220, and calling data stored in the memory 220, the processor 210 performs various functions of the terminal and processes data, thereby monitoring the terminal as a whole. Optionally, the processor 420 may include one or more processing units; optionally, the processor 210 may integrate an application processor, which mainly processes operating devices, user interfaces, and application programs, etc. Of course, other processors may also be included, which are not listed here one by one.
[0038] The memory 220 can be used to store software programs and modules. The processor 210 executes various functional applications and data processing of the terminal by running the software programs and modules stored in the memory 220. The memory 220 may mainly include a program storage area and a data storage area, wherein the program storage area may store operating devices, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal (such as audio data, a phone book, etc.), etc. In addition, the memory 220 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, or other volatile solid-state storage devices.
[0039] The transceiver 230 can provide wireless communication solutions applied on the terminal, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The transceiver 230 can be one or more devices integrating at least one communication processing module, for example, the antenna and the baseband processor are integrated into the transceiver 230, or the antenna and the modem processor are integrated into the transceiver 230, etc., which are not limited here.
[0040] The display unit 240 may be used to display information input by the user or information provided to the user and various menus of the terminal. The display unit 240 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc., which is not limited here.
[0041] The input unit 250 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the terminal. Specifically, the input unit 250 can collect the user's operations on or near it, and drive the corresponding connection device according to a pre-set program. In addition, the input unit 250 may include a touch panel, which can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel, the input unit 250 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of function keys (such as volume control keys, switch keys, etc.), trackballs, joysticks, etc.
[0042] The terminal may also include at least one sensor 260, such as a gyroscope sensor, a motion sensor, and other sensors. The motion sensor may include an acceleration sensor for detecting the magnitude of acceleration in all directions, and the magnitude and direction of gravity when stationary, which may be used for applications that identify the posture of the terminal device, such as horizontal and vertical screen switching, related games, magnetometer posture calibration, etc. As for other sensors that may be configured in the terminal device, such as a pressure gauge, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., they will not be described in detail here.
[0043] The audio circuit 270 may include a speaker and a microphone, and may provide an audio interface between the user and the terminal. The audio circuit 270 may transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 270 and converted into audio data, and then the audio data is output to the processor 210 for processing, and then sent to another terminal device through the video circuit, or the audio data is output to the memory 220 for further processing.
[0044] The terminal also includes a power module 280 for supplying power to various components. Optionally, the power module 280 can be logically connected to the processor 210 through a power management device, so that the power management device can manage charging, discharging, power consumption and other functions.
[0045] Although not shown, the terminal may further include a camera. Optionally, the camera may be located at the front or rear of the terminal, which is not limited in the present embodiment.
[0046] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal. In other embodiments of the present application, the terminal 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 illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0047] Optional, above Figure 2 The terminal equipment shown can be Figure 1 The method is to connect to the charger and charge. In the solution that supports fast charging, both the adapter and the terminal device support the fast charging protocol. Taking the UFCS fast charging protocol as an example, the hardware fast charging path of the UFCS fast charging protocol includes a power management integrated circuit (PowerManagement IC, PMIC) path for conventional charging and a direct charging path for fast charging metal-oxide-semiconductor (metal oxide semiconductor, MOS).
[0048] At present, the control scheme for controlling adapter charging is usually to adjust the voltage first and then adjust the current. The adapter is directly requested to first apply for a voltage that can meet the maximum charging current of the battery. For example, the adapter is first requested to adjust the voltage to 11V (here, adjustment means that the adapter has the ability to output 11V, but the actual voltage is determined by the adapter and battery circuit loop), and then the charging current is adjusted. Among them, the 11V of the adapter can meet the voltage requirement of the current change during the battery charging process.
[0049] Since there is a voltage difference between the voltage V_source requested by the terminal device to the adapter and the actual output voltage V_out of the charging loop, for the CC current stabilization circuit of the adapter with standard hardware, this adapter can withstand the excessive voltage difference between V_source and V_out without triggering OCP. However, the CC current stabilization circuit design of some adapters that support the UFCS protocol does not meet the specifications or it does not have a CC current stabilization circuit. In this regulation scheme, OCP will occur, causing intermittent charging and unstable charging.
[0050] Although there are currently optimization solutions for some adapters with irregular designs, for example, the battery voltage +V1 is used as the initial application voltage sent to the adapter, and the initial application current sent to the adapter is equal to I1. According to the target charging current I2 desired by the terminal device, the initial application current I1 is increased by 500ma each time to approach the target charging current I2, and the initial application voltage is also increased by 500mv each time, that is, the voltage and current pair applied to the adapter each time thereafter is: the last initial application current is increased by 500ma each time, and the last initial application voltage is increased by 500ma each time to the adapter. After the adapter completes the adjustment, the terminal device obtains the actual output voltage of the adapter and uses it as the application voltage sent to the adapter next time, and so on. In this optimization solution, the charging current of the adapter is adjusted to the target charging current too many times, which takes a long time. Each time the charging current is adjusted, the application voltage needs to be calibrated. For example, it takes more than ten seconds to adjust the charging current of the adapter from 1A to 5A, and there is a problem of slow adjustment speed and poor efficiency. In addition, none of the above solutions detects the actual output current of the adapter, and the accuracy of the adjustment will also be poor.
[0051] In order to solve the problems existing in the above-mentioned related technologies and improve the stability of charging of terminal devices, the present application provides a charging control method that can be applied to terminal devices. During the charging process, the current output current of the adapter is obtained in time, and the charging parameters applied to the adapter are determined in combination with the current output current of the adapter and the target charging current of the terminal device to ensure the stability of the charging process.
[0052] Please refer to Figure 3 , which shows a method flow chart of a charging control method provided by an exemplary embodiment of the present application, and the charging control method can be applied to a terminal device. Figure 3 As shown, the charging control method may include the following steps:
[0053] Step 301, when charging the terminal device through the adapter, obtain the current output current of the adapter and the target charging current of the terminal device, where the target charging current is the charging current currently required by the terminal device.
[0054] Optionally, after the terminal device establishes an electrical connection with the adapter, the adapter can charge the terminal device. Under normal charging conditions, the terminal device of this solution can obtain the current output current of the adapter and the charging current currently required by the terminal device.
[0055] Optional, take the UFCS fast charging protocol supported between the terminal device and the adapter as an example, please refer to Figure 4 , which shows a schematic diagram of the structure of a fast charging circuit involved in an exemplary embodiment of the present application. Figure 4As shown, it includes an adapter 401, a PMIC path 402, a fast charge MOS path 403, a UFCS unit 404, a battery 405, a CP circuit 406, and a CPU unit 407. That is, after the terminal device is connected to the adapter, the charging circuit for charging the battery 405 of the terminal device is as shown in FIG. Figure 4 shown.
[0056] Among them, when charging between the terminal device and the adapter 401, if the general charging path is used, the voltage and current are supplied to the CPU unit 407 through the PMIC path 402, providing a power source for the CPU unit 407, and charging the battery 405 through the PMIC path 402; if the adapter 401 communicates with the UFCS unit 404 through the D+D- fast charging protocol to a certain stage, the UFCS unit 404 will control the fast charging MOS path 403 to be turned on, and the voltage and current of the adapter 401 will charge the battery 405 after passing through the fast charging MOS path 403, and at the same time output the voltage and current to the clock pulse (Clock Pulse, CP) circuit 406 (the function of the CP circuit 406 is to reduce the voltage. During fast charging and direct charging, the voltage output by the adapter 401 is too high to directly power the CPU unit 407 of the terminal device, so the CP circuit 406 is required to reduce the voltage and power the CPU unit 407). When not charging, the battery 405 (which can be a dual-cell battery) outputs a voltage to power the CPU unit 407 through the CP circuit 406. When fast charging, Figure 4 The fast charging path, i.e., the path from adapter 401 --> fast charging MOS path 403 --> battery 405, is disconnected during fast charging, wherein the normal charging path (i.e., the path from adapter 401 --> PMIC path 402 --> battery 405) is disconnected.
[0057] Optionally, in the above scheme, when the terminal device is charged through the fast charging path through the adapter, the terminal device can interact with the adapter to obtain the current output current of the adapter. For example, for an adapter that supports the UFCS protocol, the terminal device can inquire about the current current output of the adapter by means of sending a packet, such as through a get sourceinfo communication packet. When the adapter receives the get source info communication packet, it will collect the current output current and voltage of the adapter through the analog-to-digital converter (ADC) circuit to assemble it into a source info packet and reply to the terminal device, so that the terminal device can obtain the current output current of the adapter.
[0058] Optionally, the charging current currently required by the terminal device can be determined by the terminal device based on the current battery charging curve and / or charging scenario. For example, if the current battery charging curve indicates that the required charging current is A, then the target charging current obtained is A, or, in the current charging scenario, the charging current required by the terminal device is B, then the target charging current obtained is B.
[0059] Step 302: Determine the charging parameters of the adapter according to the current output current of the adapter and the target charging current of the terminal device. The charging parameters include the target charging voltage requested by the terminal device to the adapter.
[0060] Optionally, the terminal device determines the charging parameters that need to be applied to the adapter based on the acquired current output current of the adapter and the target charging current of the terminal device, and the charging parameters include the target charging voltage. For example, the terminal device determines whether to increase or decrease the charging voltage output by the adapter based on the relationship between the current output current and the target charging current of the terminal device, and determines the value of the charging voltage that needs to be increased or decreased based on the difference between the two, thereby determining the target charging voltage that needs to be applied to the adapter. In other words, the terminal device can dynamically determine the charging parameters to be applied to the adapter based on the gap between the current output current of the adapter and the target charging current of the terminal device.
[0061] Step 303: Send a target charging request to the adapter, where the target charging request includes charging parameters so that the adapter adjusts the current output voltage to the target charging voltage.
[0062] Optionally, the terminal device adds the charging parameters obtained above to the target charging request and sends the target charging request to the adapter. After receiving the target charging request, the adapter can parse the target charging voltage contained therein and adjust its output voltage to the target charging voltage. Optionally, the target charging request can be similar to the above-mentioned getsource info communication packet and sent to the adapter in the form of a communication packet.
[0063] In summary, when charging a terminal device through an adapter, the current output current of the adapter and the target charging current of the terminal device are obtained, and the target charging current is the charging current currently required by the terminal device; the charging parameters of the adapter are determined according to the current output current of the adapter and the target charging current of the terminal device, and the charging parameters include the target charging voltage requested by the terminal device to the adapter; a target charging request is sent to the adapter, and the target charging request includes the target charging voltage, so that the adapter adjusts the current output voltage to the target charging voltage. This solution will obtain the current output current of the adapter, and determine the charging parameters of the adapter in combination with the charging current currently required by the terminal device, and send a target charging request containing the charging parameters to the adapter, so that the current output current of the adapter can be obtained in time and the output voltage of the adapter can be dynamically adjusted to prevent the OCP phenomenon and improve the stability of charging the terminal device.
[0064] In one possible implementation, before determining the charging parameters of the adapter as described above, the terminal device also subsequently applies to the adapter for a charging current based on its own maximum rated current and the maximum output current of the adapter, and after the initial application, adjusts the output voltage of the adapter once according to a pre-adjusted scheme, and then obtains the target step relationship of this adjustment process as the step relationship for subsequent adjustment processes. The entire adjustment process is simple and fast, so that the current output by the adapter can reach the charging current desired by the terminal device more quickly, thereby improving the adjustment efficiency during the charging process.
[0065] Please refer to Figure 5 , which shows a method flow chart of a charging control method provided by an exemplary embodiment of the present application, and the charging control method can be applied to a terminal device. Figure 5 As shown, the charging control method may include the following steps:
[0066] Step 501: After connecting to an adapter, obtain the maximum output current supported by the adapter.
[0067] Optionally, after connecting to the adapter, the terminal device can interact with the adapter and obtain the output capability of the adapter through a communication packet. For example, still taking the adapter supporting the UFCS protocol as an example, the terminal device can send a get output capability communication packet to the adapter to obtain the output capability of the adapter, including the maximum output voltage Vmax and maximum output current Imax that the adapter can support for charging.
[0068] In one possible implementation, after the terminal device is electrically connected to the adapter, it can also obtain the device identification of the adapter; when the device identification does not belong to the preset identification, the step of obtaining the maximum output current supported by the adapter is performed, that is, step 501 is performed. For example, when the terminal device is started, it will load the charging-related driver, and after the driver loading is completed, it can wait for the adapter to be connected. When the adapter is connected, the terminal device will obtain the device identification of the adapter according to the fast charging protocol supported by the adapter, and then determine whether the device identification is the preset identification.
[0069] For example, if the fast charging protocol supported by the adapter is the UFCS protocol, the terminal device can send a getdevice info communication packet to the adapter. After receiving the get device info communication packet, the adapter will return its own device info communication packet containing the vendor_id to the terminal device. The terminal device unpacks the device info communication packet to obtain the vendor_id information (i.e., the device identifier of the adapter). For example, the manufacturer of the terminal device sets the device identifier "XXX" for the adapter produced by the terminal device, and the preset identifier can be "XXX". If the device identifier of the adapter obtained is the preset identifier, and the manual is the original adapter of the terminal device, it can be directly executed according to the preset voltage and current adjustment method. If the device identifier of the adapter obtained is not the preset identifier, it means that the connected adapter is not the original adapter of the terminal device, but is equivalent to a third-party adapter, and the above steps of obtaining the maximum output current supported by the adapter are executed.
[0070] Step 502: Determine a first application current according to the rated charging current and the maximum output current of the terminal device.
[0071] After obtaining the maximum output current supported by the adapter, the terminal device can also obtain the maximum rated current supported by itself, that is, the rated charging current, and determine the first application current based on the rated charging current and the maximum output current. The first application current is the first charging current applied by the terminal device to the adapter during the charging process. In this solution, it will always be used as the charging current applied to the adapter subsequently.
[0072] In one possible implementation, the terminal device determines the smaller value between the obtained rated charging current and the maximum output current as the first application current. That is, the terminal device can compare its own rated charging current with the maximum output current and determine the smaller value between the rated charging current and the maximum output current as the first application current.
[0073] Step 503: Obtain a first application voltage according to the battery voltage of the terminal device.
[0074] Optionally, the terminal device will also obtain the first application voltage based on its own battery voltage. For example, when the terminal device first sends the required first application voltage to the adapter, it adds a preset voltage value based on its own battery voltage as the first application voltage. For example, the first application voltage = battery voltage + 300mv, and this 300mv can be preset by the developer.
[0075] Step 504 : Send a first charging request to the adapter, where the first charging request includes a first requested current and a first requested voltage, so that the adapter charges the terminal device according to the first requested current and the first requested voltage.
[0076] Optionally, after determining the first application voltage and the first application current, the terminal device sends a first charging request including the first application current and the first application voltage to the adapter. After receiving the first charging request, the adapter starts to adjust its output current and output voltage so that its output current and output voltage are the same as the first application current and the first application voltage in the first charging request, thereby charging the terminal device. The first charging request can also be sent in the form of a communication packet. After receiving the communication packet, the adapter will adjust its output current and output voltage to the voltage value and current value included in the first charging request.
[0077] Step 505: Obtain the current output current of the adapter.
[0078] Optionally, after the above step 504, the terminal device may also receive a confirmation communication packet returned by the adapter, which is used to indicate that the adapter has adjusted its output current and output voltage to the voltage value and current value included in the first charging request. At this time, the fast charging MOS path can be opened, and there will be a fast charging current after the fast charging MOS path is opened. Figure 4 Taking the adapter and terminal device shown as an example, after the terminal device sends the first charging request, it can wait for the adapter to return a power_ready packet. After receiving the power_ready packet, the terminal device opens the fast charging MOS channel and performs fast charging.
[0079] Optionally, during the fast charging process, the terminal device may also send a first acquisition instruction to the adapter, and the first acquisition instruction is used to obtain the current output current of the adapter; the receiving adapter collects and sends the current output current to the terminal device in response to the first acquisition instruction. The first acquisition instruction can also be sent in the form of a communication packet. For example, the first acquisition instruction is transmitted via a get source info communication packet. When the adapter receives the get source info communication packet, it collects the current and voltage currently output by the adapter through the ADC acquisition circuit, assembles them into a source info packet, and replies to the terminal device, so that the terminal device can obtain the current output current of the adapter.
[0080] Step 506: Acquire a target charging current of the terminal device according to the battery charging curve and / or charging scenario of the terminal device.
[0081] Optionally, as the battery voltage of the terminal device changes during the charging process, the target charging current required by the terminal device will also change, which can be reflected in the battery charging curve as the changing relationship between the battery voltage and the charging current. Therefore, by obtaining the battery charging curve, the target charging current required by the terminal device under the current battery voltage can be obtained. And / or, the terminal device often requires different charging currents in different charging scenarios. In this solution, the terminal device can first determine the charging scenario in which it is located, and determine the target charging current currently required based on the charging scenario. For example, in a game scenario, the charging current of the terminal device is usually limited to prevent the charging current from being too large. Therefore, the terminal device determines the charging scenario in which it is located based on the application running on itself, and obtains the target charging current required in the charging scenario based on the charging scenario. Among them, the above-mentioned battery charging curve and the target charging current corresponding to the charging scenario can be pre-set in the terminal device by the developer.
[0082] Step 507: Determine a second application voltage according to the magnitude relationship between the target charging current and the current output current.
[0083] Optionally, the terminal device compares the target charging current obtained above with the current output current of the adapter, and determines the second application voltage according to the magnitude relationship between the target charging current and the current output current. In one possible implementation, when the target charging current is greater than the current output current, the first preset voltage threshold is increased on the basis of the first application voltage to determine the second application voltage; when the target charging current is not greater than the current output current, the first preset voltage threshold is reduced on the basis of the second application voltage to determine the second application voltage.
[0084] That is to say, when the target charging current is greater than the current output current, it indicates that the current needs to be increased. This solution increases the output current of the adapter by increasing the voltage, and increases the first preset voltage threshold on the basis of the first application voltage to determine the second application voltage; wherein the first preset voltage threshold may be pre-set in the terminal device (such as 40mv, 60mv, etc.). On the contrary, when the target charging current is not greater than the current output current, it indicates that the current needs to be reduced. This solution reduces the output current of the adapter by reducing the voltage, and reduces the first preset voltage threshold on the basis of the second application voltage to determine the second application voltage.
[0085] Step 508: Send a second charging request to the adapter, where the second charging request includes a first requested current and a second requested voltage, so that the adapter charges the terminal device according to the first requested current and the second requested voltage.
[0086] Optionally, after determining the second applied voltage, the terminal device continues to send a second charging request to the adapter. The second charging request can be implemented in a similar manner to the first charging request, and both are sent to the adapter in the form of a communication packet. After receiving the second charging request, the adapter begins to adjust its output current and output voltage so that its output current and output voltage are the same as the first applied current and the second applied voltage in the second charging request, thereby charging the terminal device.
[0087] Step 509: Obtain the current output current of the adapter and the target charging current of the terminal device.
[0088] Optionally, after the above step 508, the terminal device may also receive a confirmation communication packet returned by the adapter, which is used to indicate that the adapter has adjusted its output current and output voltage to the voltage value and current value included in the second charging request. The confirmation communication packet returned here is similar to the confirmation communication packet returned after the above terminal device sends the first charging request, and will not be repeated here.
[0089] After receiving the confirmation communication packet, the current output current of the adapter is acquired by continuing to send a communication packet for acquiring the current output current of the adapter to the adapter. That is, after sending the second charging request to the adapter and receiving the confirmation communication packet returned by the adapter, the step of acquiring the current output current of the adapter and the target charging current of the terminal device can be performed.
[0090] Optionally, the implementation method of obtaining the target charging current is similar to that in the above step 506, and obtaining the current output current of the adapter can also be achieved by sending the above get source info communication packet, which will not be repeated here. That is, after the above step 508, after the adapter completes the adjustment according to the second charging request, the terminal device re-acquires the current output current of the adapter and the target charging current of the terminal device.
[0091] Step 510, determining the charging parameters of the adapter according to the current output current of the adapter and the target charging current of the terminal device, wherein the charging parameters include the target charging voltage requested by the terminal device to the adapter.
[0092] Optionally, the terminal device determines the charging parameters that need to be requested from the adapter based on the acquired current output current of the adapter and the target charging current of the terminal device.
[0093] In a possible implementation, before determining the charging parameters of the adapter according to the current output current of the adapter and the target charging current of the terminal device, the terminal device may also obtain a target indicator, and / or detect whether the target charging current of the terminal device has changed from the target charging current determined last time. The target indicator is used to indicate whether the last time the terminal device adjusted the output voltage of the adapter was the first adjustment.
[0094] When the target indicator indicates that the terminal device most recently adjusted the output voltage of the adapter for the first time, and / or the target charging current of the terminal device changes relative to the target charging current determined last time, the terminal device determines the charging parameters of the adapter based on the current output current of the adapter and the target charging current of the terminal device, which can be determined in the following manner: obtaining a target step relationship, the target step relationship being used to indicate a change relationship in the output current of the adapter each time the output voltage of the adapter is adjusted by a first preset voltage threshold; determining the charging parameters of the adapter based on the current output current of the adapter, the target charging current of the terminal device, and the target step relationship.
[0095] Optionally, the target indicator can be set in advance. For example, the target indicator is represented by first_request. When the above step 504 or step 508 is executed, the target indicator first_request is set to true, indicating that the current and voltage request sent to the adapter here is the first request. Before executing step 510, the target indicator can be obtained. If the target indicator first_request = true, it means that the terminal device last adjusted the output voltage of the adapter for the first time. The charging parameters of the adapter are determined based on the target step relationship in accordance with the target step relationship.
[0096] And / or, the terminal device may also compare the target charging current of the terminal device obtained this time with the target charging current of the terminal device obtained last time, detect whether the target charging current of the terminal device has changed, and if it has changed, determine the charging parameters of the adapter in a manner based on the target step relationship in accordance with the target step relationship obtained. Optionally, the change here may refer to the current values of the target charging currents obtained twice being different. That is, if the target charging current obtained in step 509 is different from the current value of the target charging current obtained in the above step 506, it is determined that the target charging current of the terminal device has changed from the target charging current determined last time, and determine the charging parameters of the adapter in a manner based on the target step relationship in accordance with the target step relationship obtained.
[0097] In a possible implementation, the above-mentioned acquisition of the target step relationship may include the following steps: acquiring a first adjustment voltage, which is the voltage adjustment value of the adapter's most recent output voltage adjustment; acquiring a first change in the adapter's output current, which is the change in the adapter's output current after the adapter's output voltage is adjusted according to the first adjustment voltage; acquiring the target step relationship based on the first adjustment voltage and the first change. For example, in the process of adjusting the voltage last time, the terminal device can obtain the voltage adjustment value of the adjustment process (increase by 40mv or decrease by 40mv), and the voltage adjustment value is the first adjustment voltage. After sending the adjustment communication packet to the adapter, after the adapter adjusts its own output voltage, the adapter's output current will also change. The terminal device obtains the output current of the adapter before and after the adjustment, and obtains the change in the adapter's output current after the adapter's output voltage is adjusted according to the first adjustment voltage; the first change is matched with the first adjustment voltage, and the target step relationship is obtained, and the change relationship of the change in the adapter's output current when the adapter's output voltage is adjusted to the first adjustment voltage is obtained.
[0098] Optionally, in this solution, the last adjustment process is the adjustment process of step 505 to step 508. In this process, when the first adjustment voltage is increased or decreased by the first application voltage to obtain the second application voltage, the first adjustment voltage is the first preset voltage threshold. Therefore, the target step relationship obtained is the change relationship of the output current of the adapter when the output voltage of the adapter is adjusted by the first preset voltage threshold. Taking the adjustment process of step 505 to step 508 as an example, V 申请1 Indicates the first application voltage, I 目标 Indicates the target charging current, I 输出1 represents the current output current of the adapter obtained in step 505. If I 目标 >I输出1 , indicating the need to increase the current, V 申请1 Add 40mv as the second application voltage, that is, V 申请2 =V 申请1 +40mv, after sending the second charging request to the adapter, the adapter adjusts its output voltage (from V 申请1 Adjust to V 申请2 ), in this step, the current output current I of the adapter is retrieved 输出2 and the target charging current of the terminal device. If the target charging current of the terminal device obtained in this step is equal to the I 目标 The same indicates that the target charging current of the terminal device has not changed relative to the target charging current determined last time. The terminal device will determine how much the output current of the adapter has changed (from I 输出1 Adjust to I 输出2 ), that is, obtaining a first regulated voltage and a first variation of the adapter output current, and then obtaining a target step relationship.
[0099] In the above process, obtaining the first regulated voltage includes the following steps: obtaining the first output current before the adapter last regulated the output voltage; obtaining the first regulated voltage according to the first current difference between the first output current and the target charging current of the terminal device; and obtaining the first regulated voltage according to the first current difference. Optionally, in this case, when the terminal device obtains the target step relationship according to the first regulated voltage and the first change, it is necessary to obtain the target step relationship in combination with the first current difference, that is, obtaining the target step relationship according to the first regulated voltage, the first current difference and the first change.
[0100] That is, the terminal device can also be based on I 目标 and I 输出1 Calculate the first current difference and use Detal_I to represent the first current difference. Then, Detal_I=I 目标 -I 输出1 In the adjustment process from step 505 to step 508, the voltage applied by the terminal device to the adapter is increased by 40mv on the original basis, that is, the second applied voltage is applied, and the first applied current is maintained. After the adapter adjustment is completed, step 509 is entered to re-acquire the current output current I of the adapter by sending a communication packet. 输出2 In step 510, the following formula is used: 40*Detal_I / (I 输出2 -I 输出1 ), determine the target step relationship.
[0101] Optionally, after obtaining the target step relationship, the terminal device needs to calculate the voltage that needs to be increased or decreased to adjust to the target charging current, for example, the target charging voltage V included in the charging parameters 目标 = Second application voltage V 申请2 -40mv+40*Detal_I / (I 输出2 -I 输出1 ), thereby determining the target charging voltage that needs to be requested from the adapter this time. On the contrary, if I 目标 输出1 , indicating that the current needs to be reduced. The target charging voltage can also be obtained in a similar way, which will not be repeated here.
[0102] Optionally, the charging parameters also include a continuous charging current requested by the terminal device to the adapter. The continuous charging current is the first requested current. The continuous charging current is kept unchanged during subsequent requests by the terminal device, that is, the first requested current obtained as mentioned above is used as the current requested to the adapter.
[0103] Optionally, when the target indicator indicates that the terminal device's most recent adjustment of the adapter's output voltage is not the first adjustment, and / or the terminal device's target charging current has not changed relative to the target charging current determined last time, the terminal device determines the adapter's charging parameters based on the adapter's current output current and the terminal device's target charging current, and the process is as follows: obtaining a second current difference, the first current difference being the current difference between the adapter's current output current and the terminal device's target charging current; when the second current difference is greater than a preset current threshold, determining the adapter's charging parameters based on the first application voltage sent to the adapter last time; when the second current difference is greater than the preset current threshold, determining that the adapter's charging parameters are the same as the last charging parameters. The preset current threshold can be pre-set in the terminal device.
[0104] For example, when the target indicator first_request obtained above is false, indicating that the last time the terminal device adjusted the output voltage of the adapter was not the first adjustment, the terminal device will use the target charging current of the terminal device obtained in step 509 to subtract the current output current of the adapter obtained to obtain the second current difference. When the second current difference is greater than the preset current threshold (100ma), the charging parameters of the adapter are determined according to the first application voltage sent to the adapter last time. For example, the terminal device can determine the charging parameters of the adapter according to the first application voltage sent to the adapter last time as follows: the terminal device adds the second voltage preset threshold (10mv) on the basis of the first application voltage, thereby determining the target charging voltage. When the second current difference is not greater than the preset current threshold, it is determined that the charging parameters of the adapter are the same as the previous charging parameters, that is, the previously applied charging voltage and charging current are kept unchanged.
[0105] And / or, after the terminal device detects whether the target charging current of the terminal device has changed relative to the target charging current determined last time, if it is determined that the target charging current of the terminal device has not changed relative to the target charging current determined last time, the charging parameters of the adapter are obtained in the same manner as when the target indicator first_request is false, which is not repeated here.
[0106] Step 511 : Send a target charging request to the adapter, where the target charging request includes charging parameters so that the adapter adjusts the current output voltage to the target charging voltage.
[0107] Optionally, after the terminal device determines that the charging parameters of the adapter need to be adjusted this time, it sends a target charging request containing the charging parameters to the adapter. The target charging request can be similar to the above-mentioned get source info communication packet, and is sent to the adapter in the form of a communication packet. After receiving the target charging request, the adapter parses the target charging request and adjusts the current output voltage to the target charging voltage.
[0108] It should be noted that after the above-mentioned terminal device sends the target charging request, the adjustment of the output voltage and output current of the adapter here is the second adjustment. Therefore, the above-mentioned target indicator first_request can be set from true to false, and delayed by 500ms to enter the next adjustment cycle, that is, the terminal device executes the thread of controlling voltage and current adjustment every 500ms during the charging process.
[0109] In summary, when charging a terminal device through an adapter, the current output current of the adapter and the target charging current of the terminal device are obtained, and the target charging current is the charging current currently required by the terminal device; the charging parameters of the adapter are determined according to the current output current of the adapter and the target charging current of the terminal device, and the charging parameters include the target charging voltage requested by the terminal device to the adapter; a target charging request is sent to the adapter, and the target charging request includes the target charging voltage, so that the adapter adjusts the current output voltage to the target charging voltage. This solution will obtain the current output current of the adapter, and determine the charging parameters of the adapter in combination with the charging current currently required by the terminal device, and send a target charging request containing the charging parameters to the adapter, so that the current output current of the adapter can be obtained in time and the output voltage of the adapter can be dynamically adjusted to prevent the OCP phenomenon and improve the stability of charging the terminal device.
[0110] In addition, during the entire adjustment process of the present application, after the first application current is determined based on the maximum rated current supported by the terminal device and the maximum output current of the adapter, the application current in the charging parameters of subsequent applications remains the first application current, thereby dynamically adjusting the output voltage of the adapter to ensure the output power, making the charging more stable during the adjustment process.
[0111] In addition, this solution can adjust the output voltage and output current of the adapter to the target charging voltage and target charging current desired by the terminal device through at most two steps. Compared with the step-by-step approximation adjustment method in the related technology, the voltage adjustment time required by this solution is greatly shortened, thereby improving the efficiency of adjusting the adapter during the charging process.
[0112] Below, take the mobile phone as the terminal device, and the adapter and mobile phone support the UFCS protocol as an example. Figure 3 and Figure 5 The illustrated embodiments are presented by way of example.
[0113] Please refer to Figure 6 , which shows a method flow chart of a charging control method provided by an exemplary embodiment of the present application, and the charging control method can be applied to a mobile phone. Figure 6 As shown, the charging control method may include the following steps:
[0114] Step 601, the mobile phone starts and loads the charging driver.
[0115] Step 602: The mobile phone detects the connected adapter to determine whether it is a third-party adapter.
[0116] For example, when the mobile phone kernel starts, the charging driver will be loaded. After the driver is loaded, it will wait for the adapter to join. If it is a non-UFCS adapter when inserted, then the charging process of other adapters will be followed. If it is a UFCS adapter, the mobile phone will send a get device info communication packet to the adapter. After receiving the request, the adapter will send the device info communication packet containing the vendor_id to the mobile phone. After the mobile phone unpacks the packet, it obtains the vendor_id information. If the vendor_id is the information of the original adapter, then the original voltage and current adjustment software process will be followed (the voltage is adjusted in one step). If it is not the information of the original adapter, that is, it is a third-party UFCS adapter, then go to step 603.
[0117] Step 603: The mobile phone obtains the Imax of the adapter.
[0118] Among them, Imax is the maximum output current supported by the adapter. In this step, the maximum output voltage Vmax supported by the adapter can also be obtained.
[0119] Step 604: The mobile phone receives a current from its maximum rated current I 额定 and Imax select the first application current.
[0120] Optionally, the mobile phone may select a smaller current from the two as the first current to be subsequently requested from the adapter.
[0121] Step 605: the mobile phone obtains the battery voltage, determines the first requested voltage, assembles the first requested current and the first requested voltage into a first request packet and sends it to the adapter, and sets first_request=true.
[0122] For example, the battery voltage obtained by the mobile phone is batt_volt. Let the first application voltage = battery voltage batt_volt + 300mv, then assemble the first application voltage and the first application current into a request communication packet and send it to the adapter. When the adapter receives the communication packet, it will adjust its output to the requested current and voltage values. Since it is the first application, first_request needs to be set to true so that it can be used in subsequent steps.
[0123] Step 606: the mobile phone waits for the adapter to return a confirmation packet.
[0124] Step 607, the mobile phone opens the fast charging channel.
[0125] For example, the mobile phone waits for the adapter to send a power_ready packet with the voltage adjusted in place. At this time, the fast charging MOS channel can be opened, and there will be fast charging current as soon as the fast charging MOS channel is opened.
[0126] Step 608: The mobile phone obtains the current output current and the current output voltage of the adapter.
[0127] Step 609: The mobile phone obtains the target charging current of the terminal device according to the battery curve and / or charging scenario.
[0128] Step 610: The mobile phone obtains first_request or detects whether the target charging current changes.
[0129] Optionally, the implementation of step 608 to step 610 can refer to the content of step 605 to step 607, which will not be repeated here. If first_request=true or the target charging current changes, execute step 611, if first_request=false or the target charging current does not change, execute step 624.
[0130] Step 611: The mobile phone determines whether the target charging current is greater than the current output current of the adapter.
[0131] If it is greater, execute steps 612 to 617; if it is less, execute steps 618 to 623.
[0132] Step 612, calculate the current difference Detal_I=target charging current-current output current.
[0133] Step 613: The second voltage requested by the mobile phone to the adapter is equal to the first voltage requested + 40mv. The first current requested and the second voltage requested are assembled into a second request packet and sent to the adapter.
[0134] Step 614, the mobile phone waits for the adapter to return a confirmation packet.
[0135] Step 615: The mobile phone obtains the current output current of the adapter.
[0136] Step 616, obtaining the target step relationship and calculating the third application voltage.
[0137] Step 617: Assemble the first requested current and the third requested voltage into a third request packet and send it to the adapter, set first_request = false, and delay 500ms to enter the next cycle.
[0138] Step 618, calculate the current difference Detal_I=current output current-target charging current.
[0139] Step 619: the second voltage requested by the mobile phone to the adapter = the first voltage requested - 40mv, and the first current requested and the second voltage requested are assembled into a second request packet and sent to the adapter.
[0140] Step 620: The mobile phone waits for the adapter to return a confirmation packet.
[0141] Step 621: The mobile phone obtains the current output current of the adapter.
[0142] Step 622, obtaining the target step relationship and calculating the third application voltage.
[0143] Step 623: Assemble the first requested current and the third requested voltage into a third request packet and send it to the adapter, set first_request = false, and delay 500ms to enter the next cycle.
[0144] Steps 612 to 617 are equivalent to a process of increasing the current of the adapter when the target charging current is greater than the current output current of the adapter, and steps 618 to 623 are equivalent to a process of reducing the current of the adapter when the target charging current is less than the current output current of the adapter.
[0145] Step 624, detecting whether the current difference between the target charging current and the current output current of the adapter is greater than 100 mA.
[0146] If not, execute step 625. If greater, execute steps 626 to 627.
[0147] Step 625, maintain the current status quo.
[0148] Step 626, set the fourth requested voltage = the first requested voltage + 10mv, assemble the first requested current and the fourth requested voltage into a fourth request packet and send it to the adapter.
[0149] Step 627, the mobile phone waits for the adapter to return a confirmation packet.
[0150] That is to say, in the above scheme, when the mobile phone adjusts the output voltage of the adapter, it dynamically adjusts the voltage applied to the adapter according to the difference between the current output current of the adapter and the target charging current that the mobile phone wants to charge. During a charging process, the impedance from the adapter to the battery end is basically unchanged. Assuming that the output of the adapter is Vout1 and the battery voltage of the mobile phone end is Vbatt1, then (Vout1-Vbatt1) = current output current * R (R is the impedance of the entire path from the adapter end to the mobile phone end). Assuming that the voltage applied to the adapter increases by one detal_v, the actual charging current will also increase by one detal_i, that is, at this time (Vout1+detal_v-Vbatt1) = (current output current + detal_i) * R. Through these two formulas, we can get detal_v = detal_i * R, so we can know how much voltage needs to be increased to increase 1 unit current. Assuming that the mobile phone end wants to increase add_i current at this time, the voltage applied to the adapter needs to increase add_v = detal_v * add_i / detal_i. In this way, the current step size can be adjusted faster and the adjustment time can be shortened.
[0151] In summary, this solution is aimed at third-party UFCS adapters. It can check the output current of the adapter in real time and dynamically adjust the output voltage of the adapter to ensure the output power. Secondly, the solution can quickly adjust the voltage to reach the target current through the tentative single-step voltage adjustment method, which greatly shortens the voltage adjustment time. In summary, this solution can greatly shorten the voltage adjustment time required to adjust to the target current while ensuring real-time power.
[0152] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0153] Please refer to Figure 7 , which shows a structural block diagram of a charging control device provided by an exemplary embodiment of the present application. The charging control device 700 can be used in a terminal device. Figure 3 , Figure 5 or Figure 6 All or part of the steps in the method provided by the illustrated embodiment are performed by the terminal device. The charging control device 700 includes:
[0154] A first acquisition module 701 is used to acquire a current output current of the adapter and a target charging current of the terminal device when the terminal device is charged through the adapter, where the target charging current is the charging current currently required by the terminal device;
[0155] A first determining module 702, configured to determine a charging parameter of the adapter according to a current output current of the adapter and a target charging current of the terminal device, wherein the charging parameter includes a target charging voltage requested by the terminal device to the adapter;
[0156] The first sending module 703 is configured to send a target charging request to the adapter, where the target charging request includes the target charging voltage, so that the adapter adjusts the current output voltage to the target charging voltage.
[0157] In summary, when charging a terminal device through an adapter, the current output current of the adapter and the target charging current of the terminal device are obtained, and the target charging current is the charging current currently required by the terminal device; the charging parameters of the adapter are determined according to the current output current of the adapter and the target charging current of the terminal device, and the charging parameters include the target charging voltage requested by the terminal device to the adapter; a target charging request is sent to the adapter, and the target charging request includes the target charging voltage, so that the adapter adjusts the current output voltage to the target charging voltage. This solution will obtain the current output current of the adapter, and determine the charging parameters of the adapter in combination with the charging current currently required by the terminal device, and send a target charging request containing the charging parameters to the adapter, so that the current output current of the adapter can be obtained in time and the output voltage of the adapter can be dynamically adjusted to prevent the OCP phenomenon and improve the stability of charging the terminal device.
[0158] Optionally, the device further comprises:
[0159] a second acquisition module, configured to acquire a target indicator before determining the charging parameters of the adapter according to the current output current of the adapter and the target charging current of the terminal device, and / or to detect whether the target charging current of the terminal device changes relative to the target charging current determined last time, wherein the target indicator is used to indicate whether the last adjustment of the output voltage of the adapter by the terminal device is the first adjustment;
[0160] When the target indicator indicates that the terminal device has most recently adjusted the output voltage of the adapter for the first time, and / or the target charging current of the terminal device changes relative to the last determined target charging current, the first determining module is configured to:
[0161] Acquire a target step relationship, where the target step relationship is used to indicate a change relationship of a change amount of an output current of the adapter when the output voltage of the adapter is adjusted by a first preset voltage threshold;
[0162] The charging parameters of the adapter are determined according to the current output current of the adapter, the target charging current of the terminal device and the target step relationship.
[0163] Optionally, obtaining the target step relationship includes:
[0164] Acquire a first regulated voltage, where the first regulated voltage is a voltage regulated value of the adapter at the last time the adapter regulated the output voltage;
[0165] Acquire a first change amount of the adapter output current, where the first change amount is a change amount of the adapter output current after the output voltage of the adapter is adjusted according to the first adjustment voltage;
[0166] The target step relationship is acquired according to the first adjustment voltage and the first change amount.
[0167] Optionally, obtaining the first regulated voltage includes:
[0168] Obtaining a first output current before the adapter last adjusted the output voltage;
[0169] According to a first current difference between the first output current and a target charging current of the terminal device;
[0170] acquiring the first regulating voltage according to the first current difference;
[0171] The step of acquiring the target step relationship according to the first adjustment voltage and the first change includes:
[0172] The target step relationship is acquired according to the first adjustment voltage, the first current difference and the first variation.
[0173] Optionally, the device further comprises:
[0174] When the target indicator indicates that the terminal device's most recent adjustment of the output voltage of the adapter is not the first adjustment, and / or the target charging current of the terminal device has not changed relative to the last determined target charging current, the first determining module is further configured to:
[0175] Acquire a second current difference value, where the first current difference value is a current difference value between a current output current of the adapter and a target charging current of the terminal device;
[0176] When the second current difference is greater than a preset current threshold, determining a charging parameter of the adapter according to the first application voltage sent to the adapter last time;
[0177] When the second current difference is greater than a preset current threshold, it is determined that the charging parameter of the adapter is the same as the last charging parameter.
[0178] Optionally, the device further comprises:
[0179] A third acquisition module, configured to acquire a maximum output current supported by the adapter after connecting to the adapter before acquiring the current output current of the adapter and the target charging current of the terminal device;
[0180] A second determining module, configured to determine a first application current according to a rated charging current of the terminal device and the maximum output current;
[0181] A fourth acquisition module, used for acquiring a first application voltage according to a battery voltage of the terminal device;
[0182] The second sending module is used to send a first charging request to the adapter, where the first charging request includes the first requested current and the first requested voltage, so that the adapter charges the terminal device according to the first requested current and the first requested voltage.
[0183] Optionally, the device further comprises:
[0184] a fifth acquisition module, configured to acquire a current output current of the adapter after sending the first charging request to the adapter;
[0185] A sixth acquisition module, configured to acquire a target charging current of the terminal device according to a charging scenario of the terminal device;
[0186] A third determination module, configured to determine a second application voltage according to a magnitude relationship between the target charging current and the current output current;
[0187] The third sending module is used to send a second charging request to the adapter, where the second charging request includes the first applied current and the second applied voltage, so that the adapter charges the terminal device according to the first applied current and the second applied voltage.
[0188] Optionally, the second determining module is further used to:
[0189] Determine the smaller value between the rated charging current of the terminal device and the maximum output current as the first application current;
[0190] The charging parameters also include a continuous charging current requested by the terminal device from the adapter, wherein the continuous charging current is the first requested current, and the continuous charging current is kept unchanged during subsequent requests by the terminal device.
[0191] Optionally, the first acquisition module is further used to:
[0192] Sending a first acquisition instruction to the adapter, where the first acquisition instruction is used to acquire a current output current of the adapter;
[0193] The present output current acquired by the adapter in response to the first acquisition instruction and sent to the terminal device is received.
[0194] Optionally, the third determining module is used to:
[0195] When the target charging current is greater than the current output current, a first preset voltage threshold is added to the first application voltage to determine the second application voltage;
[0196] When the target charging current is not greater than the current output current, the first preset voltage threshold is reduced on the basis of the second application voltage to determine the second application voltage.
[0197] Optionally, after sending the second charging request to the adapter, the step of acquiring the current output current of the adapter and the target charging current of the terminal device is performed.
[0198] Optionally, the device further comprises:
[0199] a seventh acquisition module, configured to acquire a device identifier of the adapter after being electrically connected to the adapter, before acquiring a current output current of the adapter and a target charging current of the terminal device when the terminal device is charged through the adapter;
[0200] The first execution module is used to execute the step of obtaining the maximum output current supported by the adapter when the device identifier does not belong to the preset identifier.
[0201] Please refer to Figure 8 , which is a structural diagram of another example of a charging control device provided in an embodiment of the present application. Among them, the charging control device 800 can be a terminal device, which can implement the functions of the method provided in an embodiment of the present application. Among them, the charging control device 800 can be a chip system. In the embodiment of the present application, the chip system can be composed of a chip, or it can include a chip and other discrete devices.
[0202] In terms of hardware implementation, the communication module may be a transceiver, which is integrated into the port opening device 800 to form the communication interface 803 .
[0203] The port opening device 800 includes at least one processor 801, which is used to implement or support the port opening device 800 to implement the functions of the terminal device in the method provided in the embodiment of the present application. Exemplarily, the processor 801 can obtain the current output current of the adapter and the target charging current of the terminal device when charging the terminal device through the adapter, and the target charging current is the charging current currently required by the terminal device; determine the charging parameters of the adapter according to the current output current of the adapter and the target charging current of the terminal device, and the charging parameters include the target charging voltage requested by the terminal device to the adapter; send a target charging request to the adapter, and the target charging request includes charging parameters so that the adapter adjusts the current output voltage to the target charging voltage. Please refer to the detailed description in the method example for details, which will not be repeated here.
[0204] The port opening device 800 may also include at least one memory 802 for storing program instructions and / or data. The memory 802 is coupled to the processor 801. The coupling in the embodiment of the present application is an indirect coupling or communication connection between devices, units or modules, which may be electrical, mechanical or other forms, and is used for information exchange between devices, units or modules. The processor 801 may operate in coordination with the memory 802. The processor 801 may execute program instructions stored in the memory 802. At least one of the at least one memory may be included in the processor.
[0205] The port opening device 800 may also include a communication interface 803 for communicating with other devices via a transmission medium, so that the device in the port opening device 800 can communicate with other devices. Exemplarily, the other device may be a network side device. The processor 801 may use the communication interface 803 to send and receive data. The communication interface 803 may specifically be a transceiver.
[0206] The specific connection medium between the communication interface 803, the processor 801 and the memory 802 is not limited in the embodiment of the present application. Figure 8 In the embodiment, the memory 802, the processor 801 and the communication interface 803 are connected via a bus 804. Figure 8 The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0207] In the embodiment of the present application, the processor 801 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware processor to be executed, or the hardware and software modules in the processor can be combined and executed.
[0208] In an embodiment of the present application, the memory 802 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), such as a random access memory (RAM). The memory is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory in the embodiment of the present application may also be a circuit or any other device that can implement a storage function, for storing program instructions and / or data.
[0209] Optionally, an embodiment of the present application further provides a terminal device, the terminal device includes a processor and a memory, the memory stores a computer program, and the computer program is executed by the processor to implement all or part of the steps performed by the terminal device in the charging control method described in the above embodiments.
[0210] Optionally, an embodiment of the present application further provides a chip, the chip comprising a processor and a memory, the memory storing a computer program, the computer program being executed by the processor to implement all or part of the steps performed by the terminal device in the charging control method described in the above embodiments.
[0211] Optionally, an embodiment of the present application further provides a computer-readable medium storing a computer program, which is executed by a processor to implement all or part of the steps performed by the terminal device in the charging control method described in the above embodiments.
[0212] Optionally, an embodiment of the present application also provides a computer program product, which stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the charging control method described in the above embodiments, and all or part of the steps executed by the terminal device.
[0213] It should be noted that: when the device provided in the above embodiment performs the control of the terminal device, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0214] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0215] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0216] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A charging control method, characterized in that: Applied to a terminal device, the method comprises: In the case where the terminal device is charged through an adapter, obtaining a current output current of the adapter and a target charging current of the terminal device, where the target charging current is the charging current currently required by the terminal device; Determining charging parameters of the adapter according to the current output current of the adapter and the target charging current of the terminal device, wherein the charging parameters include the target charging voltage requested by the terminal device to the adapter; A target charging request is sent to the adapter, where the target charging request includes the charging parameter, so that the adapter adjusts a current output voltage to the target charging voltage.
2. The method according to claim 1, characterized in that Before determining the charging parameter of the adapter according to the current output current of the adapter and the target charging current of the terminal device, the method further includes: Acquiring a target indicator, and / or detecting whether a target charging current of the terminal device has changed relative to a target charging current determined last time, the target indicator being used to indicate whether the terminal device has last adjusted the output voltage of the adapter for the first time; When the target indicator indicates that the terminal device most recently adjusted the output voltage of the adapter for the first time, and / or the target charging current of the terminal device changes relative to the target charging current determined last time, determining the charging parameter of the adapter according to the current output current of the adapter and the target charging current of the terminal device includes: Acquire a target step relationship, where the target step relationship is used to indicate a change relationship of a change amount of an output current of the adapter when the output voltage of the adapter is adjusted by a first preset voltage threshold; The charging parameters of the adapter are determined according to the current output current of the adapter, the target charging current of the terminal device and the target step relationship.
3. The method according to claim 2, characterized in that The step of obtaining the target step relationship includes: Acquire a first regulated voltage, where the first regulated voltage is a voltage regulated value of the adapter at the last time the adapter regulated the output voltage; Acquire a first change amount of the adapter output current, where the first change amount is a change amount of the adapter output current after the output voltage of the adapter is adjusted according to the first adjustment voltage; The target step relationship is acquired according to the first adjustment voltage and the first change amount.
4. The method according to claim 3, characterized in that The obtaining of the first regulated voltage comprises: Obtaining a first output current before the adapter last adjusted the output voltage; According to a first current difference between the first output current and a target charging current of the terminal device; acquiring the first regulating voltage according to the first current difference; The step of acquiring the target step relationship according to the first adjustment voltage and the first change includes: The target step relationship is acquired according to the first adjustment voltage, the first current difference and the first variation.
5. The method according to claim 2, characterized in that: The method further comprises: When the target indicator indicates that the terminal device's most recent adjustment of the output voltage of the adapter is not the first adjustment, and / or the target charging current of the terminal device has not changed relative to the target charging current determined last time, determining the charging parameter of the adapter according to the current output current of the adapter and the target charging current of the terminal device includes: Acquire a second current difference value, where the first current difference value is a current difference value between a current output current of the adapter and a target charging current of the terminal device; When the second current difference is greater than a preset current threshold, determining a charging parameter of the adapter according to the first application voltage sent to the adapter last time; When the second current difference is greater than a preset current threshold, it is determined that the charging parameter of the adapter is the same as the last charging parameter.
6. The method according to claim 1, characterized in that Before obtaining the current output current of the adapter and the target charging current of the terminal device, the method further includes: After connecting with the adapter, obtaining a maximum output current supported by the adapter; Determining a first application current according to the rated charging current of the terminal device and the maximum output current; Acquire a first application voltage according to the battery voltage of the terminal device; A first charging request is sent to the adapter, where the first charging request includes the first requested current and the first requested voltage, so that the adapter charges the terminal device according to the first requested current and the first requested voltage.
7. The method according to claim 6, characterized in that After sending the first charging request to the adapter, the method further includes: Obtaining the current output current of the adapter; According to the charging scenario of the terminal device, obtaining a target charging current of the terminal device; Determining a second applied voltage according to a magnitude relationship between the target charging current and the current output current; A second charging request is sent to the adapter, where the second charging request includes the first requested current and the second requested voltage, so that the adapter charges the terminal device according to the first requested current and the second requested voltage.
8. The method according to claim 6, characterized in that The determining the first application current according to the rated charging current of the terminal device and the maximum output current includes: Determine the smaller value between the rated charging current of the terminal device and the maximum output current as the first application current; The charging parameters also include a continuous charging current requested by the terminal device from the adapter, wherein the continuous charging current is the first requested current, and the continuous charging current is kept unchanged during subsequent requests by the terminal device.
9. The method according to claim 1 or 7, characterized in that: The obtaining of the current output current of the adapter includes: Sending a first acquisition instruction to the adapter, where the first acquisition instruction is used to acquire a current output current of the adapter; The present output current acquired by the adapter in response to the first acquisition instruction and sent to the terminal device is received.
10. The method according to claim 7, characterized in that The determining the second application voltage according to the magnitude relationship between the target charging current and the current output current includes: When the target charging current is greater than the current output current, a first preset voltage threshold is added to the first application voltage to determine the second application voltage; When the target charging current is not greater than the current output current, the first preset voltage threshold is reduced on the basis of the second application voltage to determine the second application voltage.
11. The method according to claim 7, characterized in that After sending the second charging request to the adapter, the step of acquiring the current output current of the adapter and the target charging current of the terminal device is performed.
12. The method according to claim 6, characterized in that In the case where the terminal device is charged by an adapter, before obtaining the current output current of the adapter and the target charging current of the terminal device, the method further includes: After being electrically connected to the adapter, obtaining a device identification of the adapter; When the device identifier does not belong to the preset identifier, the step of obtaining the maximum output current supported by the adapter is performed.
13. A charging control device, characterized in that: Applied to a terminal device, the device comprises: A first acquisition module, configured to acquire, when charging the terminal device through an adapter, a current output current of the adapter and a target charging current of the terminal device, wherein the target charging current is a charging current currently required by the terminal device; A first determining module, configured to determine a charging parameter of the adapter according to a current output current of the adapter and a target charging current of the terminal device, wherein the charging parameter includes a target charging voltage requested by the terminal device to the adapter; The first sending module is used to send a target charging request to the adapter, where the target charging request includes the target charging voltage, so that the adapter adjusts the current output voltage to the target charging voltage.
14. A terminal device, characterized in that: The terminal device includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is executed by the processor to implement the charging control method as described in any one of claims 1 to 12.
15. A chip, characterized in that: The chip includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is executed by the processor to implement the charging control method according to any one of claims 1 to 12.
16. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is executed by a processor to implement the charging control method according to any one of claims 1 to 12.