Charging control method and device, computer equipment and computer readable storage medium
By dynamically adjusting the charging parameters between electronic devices and power adapters, the problems of current backflow and low safety in traditional methods are solved, and safer and more stable charging control is achieved.
Patent Information
- Application Number
- CN202310729641.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-19
- Publication Date
- 2024-12-20
AI Technical Summary
Traditional charging control methods can easily cause current backflow when adjusting charging parameters, damage the devices of the power adapter, and have low safety.
By obtaining the actual charging parameters between the electronic device and the power adapter, if the preset conditions are not met, a more accurate charging parameters are determined based on the preset parameters and sent to the power adapter to adjust the output parameters to avoid current backflow.
Improves the safety of charging control, prevents the power adapter from being damaged due to charging adjustment, and ensures the stability and safety of the charging process.
Smart Images

Figure CN119171556A_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, computer equipment and computer-readable storage medium. Background Art
[0002] With the rapid development of charging technology, there have been significant improvements in charging speed, charging safety and intelligent charging management. Fast charging technology has also emerged, which has been widely recognized by users and has become a standard feature of smart devices such as mobile phones. In order to solve the problem of charging incompatibility between devices and power adapters of different brands, during the charging process, the electronic device obtains the voltage or current recorded by the software in the power adapter, and adjusts the charging parameters of the power adapter.
[0003] However, the traditional charging control method may easily cause current backflow and damage the adapter components after adjusting the charging parameters, thus having a low safety problem. Summary of the invention
[0004] The embodiments of the present application provide a charging control method, device, electronic device, computer-readable storage medium, and computer program product, which can avoid current backflow and damage to components of a power adapter, thereby improving the safety of charging control.
[0005] In a first aspect, the present application provides a charging control method, which is applied to an electronic device. The method comprises:
[0006] When the electronic device is electrically connected to an external power adapter, obtaining a first charging parameter sent by the power adapter; the first charging parameter is a charging parameter actually output by the power adapter;
[0007] If the first charging parameter does not meet the preset charging condition, determining a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter;
[0008] The third charging parameter is sent to the power adapter to instruct the power adapter to adjust the charging parameter output by the power adapter based on the third charging parameter.
[0009] In a second aspect, the present application also provides a charging control device, which is applied to electronic equipment. The device includes:
[0010] A first charging parameter acquisition module, configured to acquire a first charging parameter sent by an external power adapter when the electronic device is electrically connected to the power adapter; the first charging parameter is a charging parameter actually output by the power adapter;
[0011] a third charging parameter determination module, configured to determine a third charging parameter based on the first charging parameter and a preset second charging parameter if the first charging parameter does not meet a preset charging condition; wherein the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter;
[0012] The sending module is used to send the third charging parameter to the power adapter to instruct the power adapter to adjust the charging parameter output by the power adapter based on the third charging parameter.
[0013] In a third aspect, the present application further provides an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0014] When the electronic device is electrically connected to an external power adapter, obtaining a first charging parameter sent by the power adapter; the first charging parameter is a charging parameter actually output by the power adapter;
[0015] If the first charging parameter does not meet the preset charging condition, determining a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter;
[0016] The third charging parameter is sent to the power adapter to instruct the power adapter to adjust the charging parameter output by the power adapter based on the third charging parameter.
[0017] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0018] When the electronic device is electrically connected to an external power adapter, obtaining a first charging parameter sent by the power adapter; the first charging parameter is a charging parameter actually output by the power adapter;
[0019] If the first charging parameter does not meet the preset charging condition, determining a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter;
[0020] The third charging parameter is sent to the power adapter to instruct the power adapter to adjust the charging parameter output by the power adapter based on the third charging parameter.
[0021] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0022] When the electronic device is electrically connected to an external power adapter, obtaining a first charging parameter sent by the power adapter; the first charging parameter is a charging parameter actually output by the power adapter;
[0023] If the first charging parameter does not meet the preset charging condition, determining a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter;
[0024] The third charging parameter is sent to the power adapter to instruct the power adapter to adjust the charging parameter output by the power adapter based on the third charging parameter.
[0025] The above-mentioned charging control method, device, electronic device, computer-readable storage medium and computer program product, when the electronic device and the external power adapter are electrically connected, the electronic device obtains the first charging parameter sent by the power adapter, and the first charging parameter is the charging parameter actually output by the power adapter, so as to avoid data deviation caused by taking the charging parameter recorded by the software as the actual charging parameter; if the first charging parameter does not meet the preset charging condition, a third charging parameter is determined based on the first charging parameter and the preset second charging parameter, and the second charging parameter is the charging parameter of the target for charging the electronic device through the power adapter, so that a more accurate third charging parameter can be determined, and the third charging parameter is sent to the power adapter, and the power adapter adjusts the charging parameter output by the power adapter based on the more accurate third charging parameter, so as to avoid the current backflow caused by the charging adjustment of the power adapter and damage to the components of the power adapter, thereby improving the safety of charging control.
[0026] The embodiments of the present application provide a charging control method, device, power adapter, computer-readable storage medium, and computer program product, which can avoid current backflow and damage to components of the power adapter, thereby improving the safety of charging control.
[0027] In a sixth aspect, the present application provides a charging control method, which is applied to a power adapter. The method comprises:
[0028] When an external electronic device is electrically connected to the power adapter, a first charging parameter is obtained, and the first charging parameter is sent to the electronic device, so that when the first charging parameter does not meet a preset charging condition, the electronic device determines a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the first charging parameter is a charging parameter actually output by the power adapter, and the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter;
[0029] A third charging parameter sent by the electronic device is received, and the output charging parameter is adjusted based on the third charging parameter.
[0030] In a seventh aspect, the present application further provides a charging control device, which is applied to a power adapter. The device comprises:
[0031] a sending module, configured to obtain a first charging parameter when an external electronic device is electrically connected to the power adapter, and send the first charging parameter to the electronic device, so that the electronic device determines a third charging parameter based on the first charging parameter and a preset second charging parameter when the first charging parameter does not meet a preset charging condition; the first charging parameter is a charging parameter actually output by the power adapter, and the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter;
[0032] a receiving module, configured to receive a third charging parameter sent by the electronic device,
[0033] A charging parameter adjustment module is used to adjust the output charging parameter based on the third charging parameter.
[0034] In an eighth aspect, the present application further provides a power adapter. The power adapter includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0035] When an external electronic device is electrically connected to the power adapter, a first charging parameter is obtained, and the first charging parameter is sent to the electronic device, so that when the first charging parameter does not meet a preset charging condition, the electronic device determines a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the first charging parameter is a charging parameter actually output by the power adapter, and the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter;
[0036] A third charging parameter sent by the electronic device is received, and the output charging parameter is adjusted based on the third charging parameter.
[0037] In a ninth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0038] When an external electronic device is electrically connected to the power adapter, a first charging parameter is obtained, and the first charging parameter is sent to the electronic device, so that when the first charging parameter does not meet a preset charging condition, the electronic device determines a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the first charging parameter is a charging parameter actually output by the power adapter, and the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter;
[0039] A third charging parameter sent by the electronic device is received, and the output charging parameter is adjusted based on the third charging parameter.
[0040] In a tenth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0041] When an external electronic device is electrically connected to the power adapter, a first charging parameter is obtained, and the first charging parameter is sent to the electronic device, so that when the first charging parameter does not meet a preset charging condition, the electronic device determines a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the first charging parameter is a charging parameter actually output by the power adapter, and the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter;
[0042] A third charging parameter sent by the electronic device is received, and the output charging parameter is adjusted based on the third charging parameter.
[0043] In the above-mentioned charging control method, device, power adapter, computer-readable storage medium and computer program product, when an external electronic device and a power adapter are electrically connected, the power adapter obtains a first charging parameter and sends the first charging parameter to the electronic device, so that when the first charging parameter does not meet the preset charging condition, the electronic device determines a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the first charging parameter is the charging parameter actually output by the power adapter, which can avoid data deviation caused by taking the charging parameter recorded by the software as the actual charging parameter, and the second charging parameter is the charging parameter of the target for charging the electronic device through the power adapter, which can determine a more accurate third charging parameter; then, the power adapter receives the third charging parameter sent by the electronic device, and can adjust the output charging parameter based on the more accurate third charging parameter, thereby avoiding current backflow caused by the charging adjustment of the power adapter and damaging the components of the power adapter, thereby improving the safety of charging control. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art 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 paying creative work.
[0045] Figure 1 An application environment diagram of a charging control method in an embodiment;
[0046] Figure 2 is a flow chart of a charging control method in one embodiment;
[0047] Figure 3 is a flow chart of a charging control method in another embodiment;
[0048] Figure 4 is a flow chart of a charging control method in another embodiment;
[0049] Figure 5 is a flow chart of a charging control method in another embodiment;
[0050] Figure 6 is a flow chart of a charging control method in another embodiment;
[0051] Figure 7 is a flow chart of a charging control method in another embodiment;
[0052] Figure 8 is a structural block diagram of a charging control device in one embodiment;
[0053] Fig. 9 is a structural block diagram of a charging control device in another embodiment;
[0054] Fig.10 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] The charging control method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. When the electronic device 102 is electrically connected to the external power adapter 104, the first charging parameter sent by the power adapter 104 is obtained; the first charging parameter is the charging parameter actually output by the power adapter 104; if the first charging parameter does not meet the preset charging condition, the third charging parameter is determined based on the first charging parameter and the preset second charging parameter; wherein the second charging parameter is the charging parameter of the target for charging the electronic device 102 through the power adapter 104; the third charging parameter is sent to the power adapter 104 to instruct the power adapter 104 to adjust the charging parameter output by the power adapter based on the third charging parameter.
[0057] The electronic device 102 may be a terminal or a server; the terminal may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices; IoT devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, smart cars, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server may be implemented as an independent server or a server cluster consisting of multiple servers.
[0058] The power adapter 104 is a power supply conversion device for small portable electronic devices and electronic appliances, and is generally composed of components such as a housing, a transformer, an inductor, a capacitor, a control IC, and a PCB board. The power adapter can be a fixed power adapter or a mobile power adapter. A fixed power adapter can be a power supply and a charging cable fixed to the wall, and a mobile power adapter can be a mobile power bank, etc.
[0059] The electronic device and the power adapter are electrically connected, either through a physical charging cable or a wireless charging connection.
[0060] In one embodiment, Figure 2As shown, a charging control method is provided, which is applied to Figure 1 The electronic device in the example is used to illustrate, and the following steps are included:
[0061] Step S202: when the electronic device is electrically connected to the power adapter, obtain a first charging parameter sent by the power adapter; the first charging parameter is a charging parameter actually output by the power adapter.
[0062] Optionally, the first charging parameter includes a first voltage parameter or a first current parameter. The first voltage parameter is a voltage parameter actually output by the power adapter, and the first current parameter is a current parameter actually output by the power adapter. Optionally, the first charging parameter is obtained by the power adapter sampling the charging circuit, and is sent to the electronic device through the connection between the adapter and the electronic device, so that the electronic device can obtain the first charging parameter.
[0063] Optionally, when the electronic device and the power adapter are electrically connected, the electronic device and the power adapter communicate using the Universal Fast Charging Specification (UFCS) so that the electronic device obtains the current first charging parameter of the power adapter. The Universal Fast Charging Specification (UFCS) is also the terminal fusion fast charging technology.
[0064] Optionally, when the electronic device and the power adapter are electrically connected, if the electronic device identifies the dedicated charging port (DCP) of the power adapter, a pulse string is sent to the power adapter; if the electronic device detects a response signal from the power adapter to the pulse string, a ping control command is sent to the power adapter; if the electronic device detects a response signal from the power adapter to the ping control command, the electronic device and the power adapter use a fused fast charging protocol to obtain the first charging parameter sent by the power adapter.
[0065] Among them, the electronic device sends a pulse string to the power adapter, that is, the electronic device and the power adapter shake hands; if the power adapter responds to the pulse string, it means that the power adapter is a UFCS adapter, and the power adapter supports the fusion fast charging protocol.
[0066] The ping control command is used to determine the baud rate of communication between the electronic device and the power adapter. It is understandable that the dedicated charging port of the power adapter is of Type-C type; the communication physical hardware that integrates the fast charging protocol uses D+D- to achieve transmission and reception, so the electronic device and the power adapter need to negotiate the baud rate of communication. Exemplary baud rates are 115200, 57600, 38400, and two pins for data.
[0067] Optionally, when the electronic device sends a Ping control command to the power adapter multiple times (at least 5 times) at a preset baud rate but does not receive a response signal from the power adapter, the electronic device switches the baud rate of the preset gear to a baud rate of another gear and resends the Ping control command to the power adapter at the baud rate of another gear until a response signal from the power adapter is received.
[0068] The response signal of the power adapter to the pulse train, or the response signal of the power adapter to the ping control command, may be an ACK feedback signal or an NCK feedback signal, etc., but is not limited thereto.
[0069] Optionally, the electronic device sends a pulse string to the power adapter so that the power adapter responds to the pulse string and switches to UFCS mode; the electronic device detects the response signal of the power adapter to the pulse string, and sends a ping control command to the power adapter, so that the power adapter responds to the ping control command in UFCS mode; when the electronic device detects the response signal of the power adapter to the ping control command, it determines that the electronic device and the power adapter use a fused fast charging protocol, and obtains the first charging parameter currently sent by the power adapter.
[0070] It is understandable that the electronic device first sends a pulse string and then sends a ping control command, so that the power adapter can switch to the UFCS mode based on the pulse string and respond to the ping control command in the UFCS mode.
[0071] Optionally, the dedicated charging port of the power adapter is of Type-C type; the electronic device recognizes the dedicated charging port of the power adapter, in which D+D- are connected together, and the electronic device sends a string of pulses to the power adapter through D- and then pulls down the level of D-; if the power adapter is a UFCS adapter, it responds to the pulse string, that is, it pulls up the level of D+; if the power adapter is not a UFCS adapter, it does not respond, that is, it does not pull up the level of D+; if the electronic device detects a response signal that the level of D+ is pulled up, it sends a ping control command to the power adapter.
[0072] Optionally, if the electronic device does not detect the power adapter's response to the pulse train, or the electronic device does not detect the power adapter's response to the ping control command, the electronic device and the power adapter are charged using other charging protocols besides the fused fast charging protocol.
[0073] Optionally, the electronic device obtains the current first charging parameter of the power adapter, including: the electronic device sends a charging parameter request command (protocol interaction code) to the power adapter to instruct the power adapter to obtain the current first charging parameter according to the charging parameter request command, and send the first charging parameter to the electronic device; the electronic device obtains the first charging parameter sent by the power adapter.
[0074] Optionally, the electronic device sends a charging parameter request command to the power adapter to instruct the power adapter to return a confirmation control command to the electronic device, and obtains the current first charging parameter according to the charging parameter request command, and sends the first charging parameter to the electronic device; the electronic device responds to the confirmation control command, starts a timer, and receives the first charging parameter sent by the power adapter within a preset timing duration of the timer.
[0075] If the first charging parameter sent by the power adapter is not received within the preset timing duration of the timer or the reception of the first charging parameter fails, the process returns to the step of sending the charging parameter request command to the power adapter again until the electronic device sends the charging parameter request command more than the preset number of times and fails to receive the first charging parameter sent by the power adapter, stops sending the charging parameter request command, and switches to other charging protocols for charging.
[0076] The preset number of times and the preset timing duration can be set as needed. For example, the preset number of times is 3 times, and the preset timing duration is 300 milliseconds. The electronic device fails to receive the first charging parameter, that is, the electronic device waits for a timeout. The charging parameter request command can be a get source info command packet, and the confirmation control command can be an ack control command.
[0077] Other charging protocols may include SVOOC (SUPERVOOC) fast charging protocol, QC (Quick Charge) fast charging protocol, or PPS (Programmable Power Supply, a fast charging technical specification) fast charging protocol.
[0078] It can be understood that if the electronic device sends a charging parameter request command more than a preset number of times and does not receive the first charging parameter sent by the power adapter, it indicates that there is a communication problem in the communication link between the electronic device and the power adapter, and it is necessary to switch the fused fast charging protocol to other charging protocols for charging.
[0079] Step S204: if the first charging parameter does not meet the preset charging condition, determine a third charging parameter based on the first charging parameter and the preset second charging parameter; wherein the second charging parameter is a charging parameter of the target for charging the electronic device through the power adapter.
[0080] The preset charging condition is a preset condition for determining whether the first charging parameter of the power adapter needs to be adjusted. The preset charging condition may include a preset voltage condition or a preset current condition.
[0081] Optionally, the preset charging condition may include one of the following: a first voltage parameter is greater than or equal to a second voltage parameter of a preset power adapter output to a battery in an electronic device, a first current parameter is less than a second current parameter of a preset power adapter output to a battery in an electronic device, or the first current parameter matches the battery voltage of the electronic device, but is not limited thereto.
[0082] Furthermore, the preset voltage condition may include a first voltage parameter greater than or equal to a second voltage parameter of a preset power adapter output to a battery in an electronic device, and the absolute value of the difference between the first voltage parameter and the second voltage parameter is less than or equal to a first preset threshold value; the preset current condition may include a first current parameter less than a second current parameter of a preset power adapter output to a battery in an electronic device, and the absolute value of the difference is less than or equal to a second preset threshold value.
[0083] Optionally, the preset second charging parameter matches the battery parameter of the electronic device. Optionally, the second charging parameter may include a second voltage parameter or a second current parameter. The second voltage parameter is a voltage parameter of the target of charging the electronic device through the power adapter, and the second current parameter is a current parameter of the target of charging the electronic device through the power adapter.
[0084] It is understandable that the power adapter charges the battery in the electronic device, and the charging parameters of the target of the power adapter charging the electronic device need to meet certain conditions, such as the voltage output by the power adapter to the battery in the electronic device is greater than the battery voltage to avoid current backflow to the power adapter, such as the current output by the power adapter to the battery in the electronic device needs to match the battery voltage or battery power to avoid damage to the battery, so the electronic device presets the second charging parameter output by the power adapter to the battery in the electronic device to match the battery parameter of the electronic device. Among them, the battery parameter of the electronic device may include the battery voltage, battery power or battery capacity of the electronic device, etc., but is not limited to this.
[0085] The third charging parameter is a charging parameter that the electronic device requests the power adapter to output. The third charging parameter may include a third voltage parameter or a third current parameter.
[0086] It is understandable that there is a certain loss when the power output of the power adapter is transmitted to the battery in the electronic device. Therefore, based on the first charging parameter and the preset second charging parameter, the third charging parameter is determined to instruct the power adapter to make adjustments based on the third charging parameter.
[0087] Optionally, the electronic device detects whether a first charging parameter meets a preset charging condition; if the first charging parameter does not meet the preset charging condition, the electronic device obtains a preset second charging parameter, and determines a third charging parameter based on the first charging parameter and the second charging parameter; if the first charging parameter meets the preset charging condition, it detects whether the second charging parameter changes, and if so, returns to execute the step of obtaining the first charging parameter sent by the power adapter.
[0088] Optionally, the electronic device detects whether the first charging parameter meets the preset charging condition, including: the electronic device detects whether the first charging parameter meets the preset charging condition based on the first charging parameter and the second charging parameter. Further, the electronic device determines the magnitude relationship and the absolute value of the difference between the first charging parameter and the second charging parameter; based on the magnitude relationship and the absolute value of the difference, determines whether the first charging parameter meets the preset charging condition.
[0089] Optionally, the electronic device determines a difference between the first charging parameter and the second charging parameter, and determines a third charging parameter corresponding to the difference from a correspondence between a preset difference and a third charging parameter.
[0090] Step S206: Send the third charging parameter to the power adapter to instruct the power adapter to adjust the charging parameter output by the power adapter based on the third charging parameter.
[0091] Optionally, the electronic device sends a third charging parameter to the power adapter, and after a preset time period, re-executes the step of obtaining the first charging parameter sent by the power adapter, and the third charging parameter is used to instruct the power adapter to adjust the charging parameter output by the power adapter based on the third charging parameter within the preset time period.
[0092] The preset duration can be set as required. For example, the preset duration is 20 milliseconds.
[0093] It is understandable that the power adapter may not be able to directly adjust the first charging parameter to the third charging parameter within the preset time. Therefore, the power adapter adjusts the first charging parameter based on the third charging parameter within the preset time. It may directly adjust the first charging parameter to the third charging parameter, or it may adjust the first charging parameter to an intermediate charging parameter; the intermediate charging parameter is less than the third charging parameter and greater than the first charging parameter.
[0094] It should be noted that even if the power adapter adjusts the first charging parameter to the third charging parameter within the preset time, the new current first charging parameter may not necessarily meet the preset charging conditions. It is necessary to re-acquire the first charging parameter sent by the power adapter and determine whether the new first charging parameter meets the preset charging conditions.
[0095] Exemplarily, the first voltage parameter = 10V (volts), the second voltage parameter of the preset power adapter output to the battery in the electronic device = 4V, and the preset voltage condition is that the first voltage parameter is greater than the second voltage parameter, and the difference between the first voltage parameter and the second voltage parameter is less than 300mv (millivolts); then, the first voltage parameter is 6V greater than the second voltage parameter, and does not meet the preset charging condition, and the step value corresponding to 6V is determined to be 5V, then the first charging parameter minus the step value is obtained to obtain a third voltage parameter of 5V, then even if the power adapter adjusts the first voltage parameter from 10V to 5V within the preset time, the new first voltage parameter 5V is still 1V greater than the second voltage parameter, and does not meet the preset voltage condition, so it is necessary to re-acquire the first voltage parameter sent by the power adapter and determine whether the new first voltage parameter meets the preset voltage condition.
[0096] In the above-mentioned charging control method, when the electronic device and the power adapter are electrically connected, and when the electronic device and the external power adapter are electrically connected, the electronic device obtains the first charging parameter sent by the power adapter, and the first charging parameter is the charging parameter actually output by the power adapter, thereby avoiding data deviation caused by taking the charging parameter recorded by the software as the actual charging parameter; if the first charging parameter does not meet the preset charging condition, a third charging parameter is determined based on the first charging parameter and the preset second charging parameter, and the second charging parameter is the charging parameter of the target for charging the electronic device through the power adapter, and a more accurate third charging parameter can be determined, so that the third charging parameter is sent to the power adapter, and the power adapter adjusts the charging parameter output by the power adapter based on the more accurate third charging parameter, thereby avoiding current backflow caused by the charging adjustment of the power adapter and damaging the components of the power adapter, thereby improving the safety of charging control.
[0097] Furthermore, regardless of the accuracy of the power adapter, the electronic device can obtain the first charging parameter by interacting with the power adapter, thereby ensuring that the charging speed will not be reduced due to the accuracy error of the power adapter, thereby improving the charging speed. At the same time, the process of the power adapter charging the electronic device can avoid the problem of non-rated charging power and slow charging speed caused by the first charging parameter not adjusting the required charging parameter, thereby ensuring a faster charging speed.
[0098] In one embodiment, determining a third charging parameter based on a first charging parameter and a preset second charging parameter includes: determining a step value corresponding to the first charging parameter based on the first charging parameter and the preset second charging parameter; determining the third charging parameter based on the step value corresponding to the first charging parameter and the first charging parameter.
[0099] The step value corresponding to the first charging parameter is a value that changes based on the first charging parameter.
[0100] Optionally, the electronic device determines the difference between the first charging parameter and the preset second charging parameter, and uses the difference as the step value of the first charging parameter. Optionally, the electronic device determines the difference between the first charging parameter and the preset second charging parameter, and determines the step value corresponding to the difference from the corresponding relationship between the preset difference and the step value.
[0101] Optionally, if the first charging parameter is greater than the preset second charging parameter, the first charging parameter is subtracted from the step value to obtain a third charging parameter; if the first charging parameter is less than or equal to the preset second charging parameter, the first charging parameter is added to the step value to obtain the third charging parameter.
[0102] In this embodiment, the electronic device determines the step value corresponding to the first charging parameter based on the first charging parameter and the preset second charging parameter. Then, based on the step value corresponding to the first charging parameter and the first charging parameter, the third charging parameter can be determined more accurately.
[0103] In one embodiment, based on the first charging parameter and the preset second charging parameter, determining the step value corresponding to the first charging parameter includes: determining the absolute value of the difference between the first charging parameter and the preset second charging parameter; based on the size of the absolute value of the difference, determining the step value corresponding to the first charging parameter; there is a positive correlation between the step value and the absolute value of the difference.
[0104] The electronic device pre-sets the step value corresponding to the absolute value of the difference, and there is a positive correlation between the step value and the absolute value of the difference. It can be understood that the larger the absolute value of the difference, the larger the step value; the smaller the absolute value of the difference, the smaller the step value.
[0105] The electronic device divides at least two numerical ranges of the absolute value of the difference, and the step value is positively correlated with any numerical value in the numerical range where the absolute value of the difference is located. It can be understood that there is no intersection between the numerical ranges, and the larger the numerical value in the numerical range where the absolute value of the difference is located, the larger the step value, and the smaller the numerical value in the numerical range where the absolute value of the difference is located, the smaller the step value.
[0106] Taking the first charging parameter as the first voltage parameter and the second charging parameter as the second voltage parameter as an example, the step values step corresponding to each numerical range of the difference absolute value Vdiff are as follows: Vdiff>5v, step=5000mv; 2<=Vdiff<5v, step=2000mv; 1<=Vdiff<2v, step=1000mv; 500mv<=Vdiff<1v, step=500mv; 200<=Vdiff<500mv, step=200mv; Vdiff<200mv, step=100mv.
[0107] If the absolute value of the difference between the first voltage parameter and the preset second voltage parameter is greater than 5V, the step value of the first charging parameter is 5000mv; if the absolute value of the difference between the first voltage parameter and the preset second voltage parameter is greater than or equal to 2V and less than 5V, the step value of the first charging parameter is 2000mv; and so on.
[0108] In this embodiment, the electronic device determines the absolute value of the difference between the first charging parameter and the preset second charging parameter, and the absolute value of the difference is positively correlated with the step value. Therefore, based on the size of the absolute value of the difference, the step value corresponding to the first charging parameter can be determined more accurately.
[0109] In one embodiment, Figure 3 As shown, another charging control method is provided, which is applied to an electronic device, and the charging control method includes the following steps:
[0110] Step S302: When the electronic device is electrically connected to an external power adapter, a first voltage parameter sent by the power adapter is obtained; the first voltage parameter is a voltage parameter actually output by the power adapter.
[0111] Step S304: if the first voltage parameter does not satisfy the preset voltage condition, determine the absolute value of the difference between the first voltage parameter and a preset second voltage parameter.
[0112] Step S306, determining a step value corresponding to the first voltage parameter based on the absolute value of the difference; there is a positive correlation between the step value and the absolute value of the difference.
[0113] Step S308, if the first voltage parameter is less than the second voltage parameter, then add the step value corresponding to the first voltage parameter to the first voltage parameter to obtain the third voltage parameter; if the first voltage parameter is greater than or equal to the second voltage parameter, and the absolute value of the difference is greater than the first preset threshold, then subtract the step value of the first voltage parameter from the first voltage parameter to obtain the third voltage parameter.
[0114] It is understandable that before the electronic device turns on the charge pump (CP) to directly charge the Metal-Oxide-Semiconductor Field-Effect Transistor (MOSFET, abbreviated as MOS), that is, before the power adapter charges the battery in the electronic device, the voltage output from the power adapter to the battery needs to be greater than the battery voltage of the electronic device itself, so as to avoid the problem that the battery voltage of the electronic device itself is greater than the voltage output from the power adapter to the battery, causing the current to flow back into the power adapter and damage the components of the power adapter, thereby improving the safety of charging control. Among them, the metal oxide semiconductor field effect transistor is equivalent to the role of a switch. If the metal oxide semiconductor field effect transistor is turned on, the power adapter will directly charge the battery of the electronic device.
[0115] The working principle of the charge pump is to use the charging and discharging of capacitors to achieve voltage conversion. For example, the battery voltage of an electronic device is less than 4.5V, and the first voltage parameter of the power adapter (output voltage vbus) is 8V. Therefore, the voltage needs to be reduced to charge the battery, so a charge pump is needed to reduce the voltage.
[0116] Optionally, the second voltage parameter is greater than a battery voltage parameter of the electronic device, the battery in the electronic device includes at least two battery cells connected in series, and the battery voltage parameter is obtained by adding voltage parameters of each battery cell.
[0117] Optionally, the second voltage parameter is greater than the battery voltage parameter by a specified voltage value. The specified voltage value can be set as needed. In one embodiment, the specified voltage value is 200mv. In other embodiments, the specified voltage value can also be other values, such as 190mv, 201mv, etc., but is not limited thereto.
[0118] Exemplarily, the battery in the electronic device includes two cells connected in series, and the voltage parameter of each cell is 2V, then the battery voltage parameter is 4V, and the second voltage parameter is 200mv greater than the battery voltage parameter, that is, the second voltage parameter is 4.02V.
[0119] It is understandable that if the specified voltage value is too small, such as 100mv, when the path impedance between the power adapter output and the battery of the electronic device is large, it may cause the voltage output from the power adapter to the battery to be less than the battery voltage, resulting in the problem of current backflow to the power adapter. If the specified voltage value is too large, such as 300mv, it may cause the CC loop (current stabilization loop) in the power adapter to be unstable and trigger the OCP (overcurrent protection point), and also damage the components of the power adapter and the battery of the electronic device. Therefore, the second voltage parameter is 200mv greater than the battery voltage parameter of the electronic device, which can avoid damage to the components of the power adapter and the battery of the electronic device, thereby improving safety.
[0120] Optionally, if the first voltage parameter is less than the second voltage parameter, the voltage output by the power adapter to the electronic device may be less than the battery voltage, and the first voltage parameter is too small, so the first voltage parameter is added to the step value corresponding to the first voltage parameter to obtain the third voltage parameter; if the first voltage parameter is greater than or equal to the second voltage parameter, and the absolute value of the difference is greater than the first preset threshold, indicating that the first voltage parameter is too large, the step value corresponding to the first voltage parameter is subtracted from the first voltage parameter to obtain the third voltage parameter.
[0121] The first preset threshold value can be set as required. For example, the first preset threshold value is 300 mv (millivolts), or can be 310 mv, 290 mv, etc.
[0122] Step S310: Send the third voltage parameter to the power adapter to instruct the power adapter to adjust the voltage parameter output by the power adapter based on the third voltage parameter.
[0123] Optionally, the electronic device sends a request communication packet consisting of a third voltage parameter and a third current parameter to the power adapter to instruct the power adapter to adjust the voltage parameter output by the power adapter based on the third voltage parameter, and to adjust the current parameter output by the power adapter based on the third current parameter.
[0124] The third voltage parameter and the third current parameter are used as a pair of data to form a request communication packet, wherein the third current parameter is a lower limit value within the current parameter range.
[0125] In this embodiment, if the first voltage parameter is less than the second voltage parameter, the first voltage parameter is added to the step value corresponding to the first voltage parameter to obtain the third voltage parameter; if the first voltage parameter is greater than or equal to the second voltage parameter and the absolute value of the difference is greater than the first preset threshold, the first voltage parameter is subtracted from the step value corresponding to the first voltage parameter to obtain the third voltage parameter, and the second voltage parameter is greater than the battery voltage parameter of the electronic device, so that the third voltage parameter can be determined more accurately.
[0126] In one embodiment, Figure 4 As shown, another charging control method is provided, which is applied to an electronic device, and the charging control method includes the following steps:
[0127] Step S402: When the electronic device is electrically connected to an external power adapter, a first current parameter sent by the power adapter is obtained.
[0128] Step S404: if the first current parameter does not satisfy the preset current condition, determine the absolute value of the difference between the first current parameter and a preset second current parameter.
[0129] Step S406, determining a step value corresponding to the first current parameter based on the absolute value of the difference; the step value and the absolute value of the difference are positively correlated.
[0130] Step S408, if the first current parameter is greater than or equal to the second current parameter, subtract the step value corresponding to the first current parameter from the first current parameter to obtain the third current parameter; if the first current parameter is less than the second current parameter and the absolute value of the difference is greater than the second preset threshold, add the step value corresponding to the first current parameter to the first charging parameter to obtain the third current parameter.
[0131] It is understandable that during the charging process of the electronic device, as the power increases, the battery voltage parameters will also change, and the battery voltage parameters and the current output by the power adapter to the electronic device battery have a matching relationship, that is, the battery voltage parameters and the first current parameters of the power adapter have a matching relationship. If the first current parameter of the power adapter does not match the battery voltage parameter, that is, the actual current of the power adapter is too large or too small, the battery or the components of the power adapter will be damaged.
[0132] Optionally, if the first current parameter is greater than or equal to the second current parameter, indicating that the output current of the power adapter is too large and will damage the battery of the electronic device, the electronic device will subtract the step value corresponding to the first current parameter from the first current parameter to obtain a third current parameter; if the first current parameter is less than the second current parameter and the absolute value of the difference is greater than the second preset threshold, indicating that the output current of the power adapter is too small and the charging speed is too slow, the first charging parameter will be added to the step value corresponding to the first current parameter to obtain the third current parameter.
[0133] The second preset threshold value can be set as required. For example, the second preset threshold value can be 10 mA (milliamperes).
[0134] Step S410: Send the third current parameter to the power adapter to instruct the power adapter to adjust the current parameter output by the power adapter based on the third current parameter.
[0135] Optionally, before sending the third current parameter to the power adapter, it also includes: determining a voltage parameter corresponding to the third current parameter that meets the preset current pressure difference requirement; sending the voltage parameter that meets the preset current pressure difference requirement to the power adapter to instruct the power adapter to adjust the current first voltage parameter to a voltage parameter that meets the preset current pressure difference requirement.
[0136] It should be noted that before the electronic device adjusts the current parameter of the power adapter to the third current parameter, the actual output voltage of the power adapter needs to meet the current pressure difference requirement. Then, the electronic device determines the voltage parameter that meets the preset current pressure difference requirement corresponding to the third current parameter from the correspondence between the current parameter and the voltage parameter, and sends the voltage parameter that meets the preset current pressure difference requirement to the power adapter to instruct the power adapter to adjust the current first voltage parameter to the voltage parameter that meets the preset current pressure difference requirement. Then, after the power adapter adjusts the first voltage parameter to the voltage parameter that meets the preset current pressure difference requirement, it can receive the third current parameter, thereby accurately adjusting the current and avoiding the problem that the current cannot be adjusted due to the pressure difference not meeting the requirement.
[0137] Optionally, the electronic device sends a third current parameter to the power adapter in response to a voltage adjustment completion signal sent by the power adapter to instruct the power adapter to adjust the current parameter output by the power adapter based on the third charging parameter; the voltage adjustment completion signal is sent after the power adapter adjusts the first voltage parameter to a voltage parameter that meets the preset current voltage difference requirement.
[0138] It can be understood that the electronic device determines the third voltage parameter based on the first voltage parameter and the second voltage parameter to indicate the process (voltage regulation process) of adjusting the power adapter based on the third voltage parameter. Usually, the difference between the first voltage parameter and the third voltage parameter increases, and multiple adjustments are required, and the adjustment precision is relatively large; and before the electronic device adjusts the first current parameter of the power adapter (current regulation process), it is necessary to adjust the first voltage parameter to a voltage parameter that meets the current pressure difference requirements. The first voltage parameter has undergone the voltage regulation process, and the difference between it and the voltage parameter that meets the current pressure difference requirements is small. Usually, it can be adjusted directly at one time, and the adjustment precision is relatively small, that is, the adjustment precision of the first voltage parameter in the voltage regulation process is greater than the adjustment precision of the first voltage parameter in the current regulation process.
[0139] In this embodiment, if the first current parameter is greater than or equal to the second current parameter, the step value corresponding to the first current parameter is subtracted from the first current parameter to obtain a third current parameter, which can avoid damaging the battery of the electronic device and improve safety; if the first current parameter is less than the second current parameter and the absolute value of the difference is greater than the second preset threshold, the first charging parameter is added to the step value corresponding to the first current parameter to obtain the third current parameter, which can increase the charging speed.
[0140] In one embodiment, after obtaining the first charging parameter sent by the power adapter, the electronic device determines whether the first charging parameter presets the charging condition based on the first charging parameter and the preset second charging parameter, including: determining the size relationship and the absolute value of the difference between the first charging parameter and the preset second charging parameter; based on the size relationship and the absolute value of the difference, determining whether the first charging parameter meets the preset charging condition.
[0141] Among them, the preset charging condition can be set as needed, such as the absolute value of the difference between the first charging parameter and the second charging parameter is less than the preset value, the first charging parameter is greater than the second charging parameter, or the first charging parameter is less than the second charging parameter, etc., but is not limited thereto.
[0142] Optionally, the first charging parameter includes a first voltage parameter, the second charging parameter includes a second voltage parameter, and the preset charging condition includes a preset voltage condition; based on the size relationship and the absolute value of the difference, determining whether the first charging parameter meets the preset charging condition, including: if the first voltage parameter is greater than or equal to the second voltage parameter, and the absolute value of the difference is greater than a first preset threshold, or the first voltage parameter is less than the second voltage parameter, then the first voltage parameter does not meet the preset voltage condition; if the first voltage parameter is greater than or equal to the second voltage parameter, and the absolute value of the difference is less than or equal to the first preset threshold, then determining that the first voltage parameter meets the preset voltage condition.
[0143] Optionally, if the first voltage parameter is greater than or equal to the second voltage parameter, and the absolute value of the difference is greater than a first preset threshold value, it indicates that the first voltage parameter is too large and the first voltage parameter does not meet the preset voltage condition; if the first voltage parameter is less than the second voltage parameter, it indicates that the power adapter voltage is insufficient and it is easy to cause current to flow back into the power adapter, and the first voltage parameter does not meet the preset voltage condition; if the first voltage parameter is greater than or equal to the second voltage parameter, and the absolute value of the difference is less than or equal to the first preset threshold value, it not only avoids the first voltage parameter being too large, but also avoids current backflow into the power adapter, and the first voltage parameter meets the preset voltage condition.
[0144] Optionally, the first charging parameter includes a first current parameter, the second charging parameter includes a second current parameter, and the preset charging condition includes a preset current condition; based on the size relationship and the absolute value of the difference, determining whether the first charging parameter meets the preset charging condition, including: if the first current parameter is less than the second current parameter, and the absolute value of the difference is greater than a second preset threshold, or the first current parameter is greater than or equal to the second current parameter, then the first current parameter does not meet the preset current condition; if the first current parameter is less than the second current parameter, and the absolute value of the difference is less than or equal to the second preset threshold, then determining that the first current parameter meets the preset current condition.
[0145] Optionally, if the first current parameter is less than the second current parameter and the absolute value of the difference is greater than a second preset threshold, it means that the first current parameter is too small, resulting in a slow charging speed, and the first current parameter does not meet the preset current condition; if the first current parameter is greater than or equal to the second current parameter, the excessive current will damage the battery of the electronic device, and the first current parameter does not meet the preset current condition; if the first current parameter is less than the second current parameter and the absolute value of the difference is less than or equal to the second preset threshold, it not only avoids the first current parameter being too large to damage the battery, but also avoids the charging speed being too slow, and the first current parameter meets the preset current condition.
[0146] In this embodiment, the electronic device can more accurately determine whether the first charging parameter meets the preset charging condition based on the magnitude relationship and the absolute value of the difference between the first charging parameter and the preset second charging parameter. Further, the electronic device can more accurately determine whether the first voltage parameter and the first current parameter meet the condition based on the specific magnitude relationship and the absolute value of the difference between the first charging parameter and the preset second charging parameter.
[0147] In one embodiment, Figure 5 As shown, another charging control method is also provided, which is applied to an electronic device, and the charging control method includes the following steps:
[0148] Step S502: When the electronic device is electrically connected to an external power adapter, a first voltage parameter sent by the power adapter is obtained.
[0149] Step S504: if the first voltage parameter does not meet the preset voltage condition, a third voltage parameter is determined based on the first voltage parameter and a preset second voltage parameter; the second voltage parameter is greater than the battery voltage parameter of the electronic device.
[0150] Step S506: Send the third voltage parameter to the power adapter to instruct the power adapter to adjust the voltage parameter output by the power adapter based on the third voltage parameter.
[0151] Step S508, executing again the step of obtaining the first voltage parameter sent by the power adapter, until the first voltage parameter meets the preset voltage condition, and adjusting the current parameter output by the power adapter.
[0152] It can be understood that when the electronic device determines that the current first voltage parameter of the power adapter does not meet the preset voltage condition, the third voltage parameter is sent to the power adapter to instruct the power adapter to adjust the first voltage parameter; after the power adapter adjusts the first voltage parameter, it is necessary to obtain the current first voltage parameter of the power adapter again to confirm whether it meets the preset voltage condition, until the current first voltage parameter meets the preset voltage condition, indicating that the voltage adjustment of the power adapter is completed, the electronic device adjusts the current first current parameter of the power adapter.
[0153] Optionally, when the electronic device determines that the first voltage parameter meets the preset voltage condition, it obtains a third current parameter and sends the third current parameter to the power adapter to instruct the power adapter to adjust the current parameter of the power adapter based on the third current parameter.
[0154] Optionally, after the electronic device obtains the first voltage parameter sent by the power adapter, if the first voltage parameter meets the preset voltage condition, the electronic device turns on the charge pump (CP) so that the power adapter charges the battery of the electronic device; during the charging process, the first current parameter sent by the power adapter is adjusted.
[0155] Optionally, after the power adapter completes voltage regulation, use a UFCS adapter with poor accuracy to electrically connect to a UFCS-supported mobile phone, and use an oscilloscope to capture the D+D- waveform (differential input line), vbus waveform, ibus waveform of the power adapter, and the battery voltage waveform corresponding to i2c.
[0156] In this embodiment, if the electronic device determines that the first voltage parameter sent by the power adapter does not meet the preset voltage condition, it will send the third voltage parameter to the power adapter to instruct the power adapter to adjust the current first voltage parameter; and the electronic device needs to continue to determine whether the adjusted current first voltage parameter meets the preset voltage condition, so it needs to execute the step of obtaining the current first voltage parameter of the power adapter again, until the first voltage parameter meets the preset voltage condition, and then adjust the current parameter output by the power adapter, thereby improving the accuracy of the charging parameter adjustment.
[0157] In one embodiment, adjusting the current parameter output by a power adapter includes: obtaining a first current parameter sent by the power adapter; the first current parameter is the current parameter actually output by the power adapter; if the first current parameter does not meet a preset current condition, determining a third current parameter based on the first current parameter and a preset second current parameter; the second current parameter is a current parameter of a target for charging an electronic device through the power adapter; and sending the third current parameter to the power adapter to instruct the power adapter to adjust the current parameter output by the power adapter based on the third current parameter.
[0158] The second current parameter is a target current parameter for charging a battery in the electronic device through a power adapter.
[0159] Optionally, the electronic device obtains the battery voltage and determines a second current parameter that matches the battery voltage according to the curve relationship between the battery voltage and the second current parameter, thereby avoiding the problem of inaccurate third current parameter determined due to the second current parameter being too large or too small. The third current parameter can be determined more accurately, thereby more accurately adjusting the first current parameter of the power adapter.
[0160] Optionally, before the electronic device sends the third current parameter to the power adapter, it also includes: determining a voltage parameter corresponding to the third current parameter that meets the preset current pressure difference requirement; sending the voltage parameter that meets the preset current pressure difference requirement to the power adapter to instruct the power adapter to adjust the current first voltage parameter to a voltage parameter that meets the preset current pressure difference requirement.
[0161] In this embodiment, after the electronic device completes adjusting the first voltage parameter of the power adapter, it obtains the first current parameter sent by the power adapter, which can accurately characterize the current parameter actually output by the power adapter, avoiding data deviation caused by using the current parameter recorded by the software as the first current parameter; if the first current parameter does not meet the preset current condition, the electronic device can more accurately determine the third current parameter for the power adapter based on the first current parameter and the preset second current parameter; the electronic device sends the third current parameter to the power adapter to instruct the power adapter to adjust the current parameter output by the power adapter based on the third current parameter, which can avoid current backflow and damage to the components of the power adapter after the power adapter adjusts the current parameter, thereby improving the safety of charging control.
[0162] In one embodiment, after sending the third current parameter to the power adapter, it also includes: returning to execute the step of obtaining the first current parameter sent by the power adapter, until the first current parameter meets the preset current condition, detecting whether the second current parameter or the second voltage parameter changes; if the second voltage parameter changes, executing the step of obtaining the first voltage parameter sent by the power adapter again; if the second current parameter changes, executing the step of obtaining the first current parameter sent by the power adapter again.
[0163] It is understandable that the battery parameters of the electronic device may change at different charging stages, so the second voltage parameter or the second current parameter output by the power adapter to the battery of the electronic device may also change.
[0164] Optionally, after the electronic device completes adjusting the first voltage parameter and the first current parameter of the power adapter, it detects in real time whether the second current parameter or the second voltage parameter changes.
[0165] Optionally, if the second voltage parameter changes, the current first voltage parameter of the power adapter may not meet the preset voltage condition, then the step of obtaining the first voltage parameter sent by the power adapter is performed again to re-determine whether the current first voltage parameter of the power adapter meets the preset voltage condition, and adjust the voltage parameter output by the power adapter if the preset voltage condition is not met.
[0166] Similarly, if the second current parameter changes, the current first current parameter of the power adapter may not meet the preset current condition, then the step of obtaining the first current parameter sent by the power adapter is performed again to re-determine whether the current first current parameter of the power adapter meets the preset current condition, and adjust the current parameter output by the power adapter if the preset current condition is not met.
[0167] In this embodiment, after the electronic device completes adjusting the first voltage parameter and the first current parameter of the power adapter, it detects whether the second current parameter or the second voltage parameter has changed, and if the second current parameter or the second voltage parameter has changed, it readjusts the first voltage parameter and the first current parameter of the power adapter. Even in different charging stages, the first voltage parameter and the first current parameter of the power adapter can be accurately adjusted to enable more accurate and safer charging.
[0168] In one embodiment, the above method also includes: when the electronic device controls the power adapter to adjust the first voltage parameter, sending the current lower limit value for the power adapter to the power adapter to instruct the power adapter to adjust the current first current parameter to the lower limit value.
[0169] Optionally, when the electronic device controls the power adapter to adjust the first voltage parameter, the electronic device obtains a lower limit value within the current parameter range for the power adapter and sends the lower limit value to the power adapter. The lower limit value within the current parameter range of the power adapter is the minimum output current of the power adapter within the output current parameter range.
[0170] Optionally, when the electronic device controls the power adapter to adjust the first voltage parameter, and the power adapter does not charge the electronic device with a large current, the power adapter outputs a lower current limit value, which can save charging resources of the power adapter.
[0171] In one embodiment, before obtaining the first charging parameter sent by the power adapter, it also includes: obtaining at least one charging mode supported by the power adapter; determining a target charging mode from at least one charging mode; the target charging mode includes a charging parameter range corresponding to the target charging mode supported and output by the power adapter; sending a third charging parameter to the power adapter includes: determining whether the third charging parameter is within the charging parameter range, and if so, sending the third charging parameter to the power adapter.
[0172] Optionally, when the electronic device and an external power adapter are electrically connected, if it is determined that the electronic device and the power adapter are charged using the fused fast charging protocol, the electronic device sends a charging mode request command (get outputcapability) to the power adapter to instruct the power adapter to send at least one supported charging mode to the electronic device.
[0173] Wherein, at least one charging mode includes a charging parameter range, and the charging parameter range may include a voltage parameter range and / or a current parameter range, and the charging parameter output by the power adapter is within the charging parameter range. Exemplarily, the voltage parameter output by the power adapter is within the voltage parameter range, and the current parameter output by the power adapter is within the current parameter range.
[0174] The power adapter may support at least one charging mode, such as 1 charging mode, 2 charging modes or 15 charging modes, and the upper limit value of the charging parameter range of each charging mode gradually increases.
[0175] Optionally, the electronic device is not limited to the method of determining the target charging mode from at least one charging mode. It can be randomly selecting a charging mode from at least one charging mode as the target charging mode, or the charging mode with the largest upper limit value of the charging parameter range can be used as the target charging mode, without limitation thereto.
[0176] Optionally, the electronic device matches the third charging parameter with the charging parameter range of the target charging mode. If the third charging parameter is within the charging parameter range of the target charging mode, the third charging parameter is sent to the power adapter; if the third charging parameter is not within the charging parameter range, the target charging mode is changed, wherein the third charging parameter matches the charging parameter range of the target charging mode after switching.
[0177] Optionally, after the electronic device changes the target charging mode, it sends an instruction corresponding to the new target charging mode to the power adapter to instruct the power adapter to switch to the new target charging mode and support the third charging parameter under the new target charging mode.
[0178] Exemplarily, the third voltage parameter ask_volt of the electronic device is less than or equal to the upper limit value max_volt of the voltage parameter range, and greater than or equal to the lower limit value min_volt of the voltage parameter range: min_volt<=ask_volt<=max_volt; the third current parameter ask_curr of the electronic device is less than or equal to the upper limit value max_curr of the current parameter range, and greater than or equal to the lower limit value min_curr of the current parameter range: min_curr<=ask_curr<=max_curr.
[0179] In this embodiment, after the electronic device determines the target charging mode supported by the power adapter, if the third charging parameter is within the charging parameter range supported by the target charging mode, the power adapter can be accurately instructed to make adjustments based on the third charging parameter within the charging parameter range supported; if the third charging parameter is not within the charging parameter range supported by the target charging mode, the target mode is changed so that the third charging parameter is within the charging parameter range supported by the new target charging mode, thereby avoiding the power adapter being unable to support the third charging parameter and being unable to make adjustments, and the charging parameters can be adjusted more accurately.
[0180] In one embodiment, Figure 6 As shown, a charging control method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the power adapter in the figure:
[0181] Step S602, when the external electronic device and the power adapter are electrically connected, obtain a first charging parameter, and send the first charging parameter to the electronic device, so that when the first charging parameter does not meet the preset charging condition, the electronic device determines a third charging parameter based on the first charging parameter and the preset second charging parameter; wherein the first charging parameter is the charging parameter actually output by the power adapter, and the second charging parameter is the target charging parameter for charging the electronic device through the power adapter.
[0182] Optionally, when an external electronic device and a power adapter are electrically connected, the power adapter responds to a pulse string sent by the electronic device, sends a response signal of the pulse string to the electronic device, and switches to UFCS mode; the electronic device is configured to send a ping control command to the power adapter after receiving the response signal of the pulse string; the power adapter responds to the ping control command sent to the electronic device, and sends a response signal of the ping control command to the electronic device in UFCS mode; the electronic device is configured to determine that the electronic device and the power adapter are charging using the fused fast charging protocol after receiving the response signal of the pulse string.
[0183] Optionally, the electronic device sends a charging parameter request command to the power adapter when integrating the fast charging protocol; the power adapter sends a confirmation control command to the electronic device in response to the charging parameter request command sent by the electronic device, obtains the current first charging parameter, and sends the first charging parameter to the electronic device; the electronic device is used to start the timer after receiving the confirmation control command, and receive the first charging parameter sent by the power adapter within the preset timing duration of the timer.
[0184] Optionally, the power adapter includes a charging circuit; the power adapter samples charging parameters of the charging circuit, and determines the current first charging parameter of the power adapter based on each sampled data, wherein the sampled data may be an output voltage or an output current.
[0185] Optionally, the power adapter samples the output voltage of the charging circuit, averages the sampled data of each output voltage, and obtains the current first voltage parameter of the power adapter; the power adapter samples the output current of the charging circuit, averages the sampled data of each output current, and obtains the current first current parameter of the power adapter. In other optional embodiments, the weighted average method, screening method, and random selection method can also be used to process each sampled data to obtain the first charging parameter, which is not limited here.
[0186] Step S604: receiving a third charging parameter sent by the electronic device, and adjusting the output charging parameter based on the third charging parameter.
[0187] Optionally, the power adapter adjusts the output charging parameter based on the third charging parameter within a preset time period; when the preset time period is reached, the charging parameter request command sent by the electronic device is received again, and the adjusted current first charging parameter is sent to the electronic device.
[0188] In the above charging control method, when the external electronic device and the power adapter are electrically connected, the power adapter obtains the first charging parameter and sends the first charging parameter to the electronic device, so that when the first charging parameter does not meet the preset charging condition, the electronic device determines the third charging parameter based on the first charging parameter and the preset second charging parameter; wherein the first charging parameter is the charging parameter actually output by the power adapter, which can avoid the data deviation caused by taking the charging parameter recorded by the software as the actual charging parameter, and the second charging parameter is the charging parameter of the target of charging the electronic device through the power adapter, which can determine a more accurate third charging parameter; then, the power adapter receives the third charging parameter sent by the electronic device, and can adjust the output charging parameter based on the more accurate third charging parameter, avoiding the power adapter to adjust the charging and causing the current to flow back and damage the device of the power adapter, thereby improving the safety of charging control. In one embodiment, the first charging parameter includes the first current parameter, the second charging parameter includes the second current parameter, and the third charging parameter includes the third current parameter; before receiving the third charging parameter sent by the electronic device, it also includes: receiving the voltage parameter corresponding to the third current parameter sent by the electronic device and meeting the preset current pressure difference requirement; adjusting the current first voltage parameter to the voltage parameter meeting the preset current pressure difference requirement.
[0189] It is understandable that before the power adapter adjusts the first current parameter, it is necessary to adjust the first voltage parameter to a voltage parameter that meets the preset current voltage difference requirement, so as to accurately adjust the current and avoid the problem of being unable to adjust the current due to the voltage difference not meeting the requirement.
[0190] In one embodiment, the first charging parameter includes a first voltage parameter, the second charging parameter includes a second voltage parameter, the second voltage parameter is greater than the battery voltage parameter of the electronic device, and the third charging parameter includes a third voltage parameter; the above method also includes: when the power adapter adjusts the first voltage parameter, obtaining the current lower limit value for the power adapter sent by the electronic device, and adjusting the current first current parameter to the lower limit value.
[0191] It is understandable that when the power adapter adjusts the first voltage parameter, if the power adapter does not charge the electronic device with a large current, the current first current parameter is adjusted to the lower limit value, that is, the minimum current value of the current parameter range, which can save the charging resources of the power adapter. If the current is too large during the voltage adjustment period, and the voltage difference between the power adapter and the battery of the electronic device is not enough, the battery current may be backflowed into the power adapter, damaging the components of the power adapter.
[0192] Exemplarily, the lower limit value within the current parameter range is 1A (ampere).
[0193] In one embodiment, before sending the first charging parameter to the electronic device, it also includes: sending at least one charging mode supported by the power adapter to the electronic device to instruct the electronic device to determine a target charging mode from at least one charging mode; the target charging mode includes a charging parameter range corresponding to the target charging mode supported by the power adapter, and when the third charging parameter is within the charging parameter range, performing the step of receiving the third charging parameter sent by the electronic device.
[0194] It can be understood that if the third charging parameter is within the charging parameter range of the target charging mode, the power adapter receives the third charging parameter sent by the electronic device; if the third charging parameter is not within the charging parameter range, and the third charging parameter is within the charging parameter range of the new target charging mode, the power adapter responds to the instruction corresponding to the new target charging mode sent by the electronic device, switches to the new target charging mode, and receives the third charging parameter sent by the electronic device in the new target charging mode, and adjusts the charging parameter based on the third charging parameter within the charging parameter range of the new target charging mode.
[0195] In this embodiment, the power adapter sends at least one charging mode supported by the power adapter to the electronic device to instruct the electronic device to determine a target charging mode from at least one charging mode, so that adjustment can be made based on a third charging parameter within the charging parameter range supported by the target charging mode, thereby avoiding the problem that the third charging parameter cannot be adjusted because it is not within the charging parameter range of the target charging mode, thereby improving the accuracy of charging control.
[0196] In one embodiment, Figure 7 As shown, the electronic device is inserted into the power adapter, and the electronic device and the power adapter are electrically connected; the electronic device determines whether the power adapter has a UFCS handshake response and a ping response. If the power adapter does not have a UFCS handshake response or a ping response, the electronic device and the power adapter are charged using a non-UFCS fast charging protocol; if the power adapter has a UFCS handshake response and a ping response, the electronic device sends a charging mode request command to the power adapter, obtains at least one charging mode supported by the power adapter, and enters the voltage regulation logic.
[0197] In the voltage regulation logic, the electronic device obtains the second voltage parameter and the second current parameter, sends a charging parameter request command to the power adapter, and detects whether the power adapter replies to the confirmation control command; if it is detected that the power adapter does not reply to the confirmation control command, it is determined whether the number of retransmissions exceeds the preset number; if the number of retransmissions does not exceed the preset number, the charging parameter request command is resent to the power adapter; if the number of retransmissions exceeds the preset number, the processing is stopped; if it is detected that the power adapter replies to the confirmation control command, it is determined whether a data packet is received within the preset time length; if the data packet is not received within the preset time length, it is determined whether the number of retransmissions exceeds the preset number; if the number of retransmissions does not exceed the preset number, the charging parameter request command is resent to the power adapter; if the number of retransmissions exceeds the preset number, the processing is stopped; if the data packet is received within the preset time length, the data packet is parsed to obtain the first voltage parameter and the first current parameter. Among them, the first voltage parameter and the first current parameter are a pair of data, and the first current parameter is the lower limit value, 1 ampere.
[0198] The electronic device obtains the absolute value of the difference between the first voltage parameter and the second voltage parameter, and determines the step value corresponding to the absolute value of the difference; determines whether the first voltage parameter is less than the second voltage parameter, and if so, the first voltage parameter plus the step value is obtained to obtain the third voltage parameter, and the third voltage parameter and the third current parameter are assembled into a request communication packet, and sent to the power adapter to instruct the power adapter to adjust the output voltage parameter based on the third voltage parameter, and re-enter the voltage regulation logic; if the first voltage parameter is greater than or equal to the second voltage parameter, it is determined whether the first voltage parameter is greater than the second voltage parameter by more than 300 millivolts, and if so, the first voltage parameter is subtracted from the step value to obtain the third voltage parameter, and the third voltage parameter and the third current parameter are assembled into a request communication packet, and sent to the power adapter to instruct the power adapter to adjust the output voltage parameter of the power adapter based on the third voltage parameter, and re-enter the voltage regulation logic; if the first voltage parameter is greater than or equal to the second voltage parameter, and the first voltage parameter is within 300 millivolts greater than the second voltage parameter, the voltage regulation is completed, and the current regulation logic is entered. In the current regulation logic, the initial value of the first current parameter is the lower limit value within the current parameter range, such as 1 ampere.
[0199] After the power adapter completes current regulation, the electronic device checks whether the second voltage parameter and the second current parameter have changed; if the second voltage parameter has changed, it enters node 1, that is, enters the voltage regulation logic; if the second voltage parameter has not changed, it determines whether the second current parameter has changed, and if the second current parameter has changed, it re-enters the current regulation logic; if the second current parameter has not changed, it continues to check whether the second voltage parameter and the second current parameter have changed.
[0200] In one embodiment, another charging control method is provided, which is applied to an electronic device, and the charging control method includes the following steps:
[0201] Step A1, when the electronic device is electrically connected to an external power adapter, obtain at least one charging mode supported by the power adapter; determine a target charging mode from at least one charging mode; the target charging mode includes a voltage parameter range and a current parameter range corresponding to the target charging mode that the power adapter supports outputting.
[0202] Step A2, obtaining a first voltage parameter sent by the power adapter; the first voltage parameter is a voltage parameter actually output by the power adapter.
[0203] Step A3, determining the magnitude relationship and the absolute value of the difference between the first voltage parameter and the preset second voltage parameter; wherein the second voltage parameter is a voltage parameter of the target for charging the electronic device through a power adapter, the second voltage parameter is greater than a battery voltage parameter of the electronic device, the battery in the electronic device comprises at least two battery cells connected in series, and the battery voltage parameter is obtained by adding the voltage parameters of each battery cell.
[0204] Step A4, if the first voltage parameter is greater than or equal to the second voltage parameter and the absolute value of the difference is greater than the first preset threshold, or the first voltage parameter is less than the second voltage parameter, it is determined that the first voltage parameter does not meet the preset voltage condition, and steps A5 to A7 are executed; if the first voltage parameter is greater than or equal to the second voltage parameter and the absolute value of the difference is less than or equal to the first preset threshold, it is determined that the first voltage parameter meets the preset voltage condition, and step A8 is executed.
[0205] Step A5: determining a step value corresponding to the first voltage parameter based on the absolute value of the difference; the step value and the absolute value of the difference are positively correlated.
[0206] Step A6, if the first voltage parameter is less than the second voltage parameter, then add the step value corresponding to the first voltage parameter to the first voltage parameter to obtain the third voltage parameter; if the first voltage parameter is greater than or equal to the second voltage parameter, and the absolute value of the difference is greater than the first preset threshold, then subtract the step value corresponding to the first voltage parameter from the first voltage parameter to obtain the third voltage parameter.
[0207] Step A7, if the third voltage parameter is not within the voltage parameter range, the target mode is changed so that the third voltage parameter matches the voltage parameter range of the target charging mode after switching; if the third voltage parameter is within the voltage parameter range, the third voltage parameter is sent to the power adapter to instruct the power adapter to adjust the voltage parameter output by the power adapter based on the third voltage parameter, and return to execute step A2 until the first voltage parameter meets the preset voltage condition, and execute step A8; wherein, when the electronic device controls the power adapter to adjust the first voltage parameter, the lower limit value within the current parameter range of the power adapter is sent to the power adapter to instruct the power adapter to adjust the current first current parameter to the lower limit value.
[0208] Step A8, obtaining a first current parameter sent by the power adapter; the first current parameter is a current parameter actually output by the power adapter.
[0209] Step A9, determining the magnitude relationship and the absolute value of the difference between the first current parameter and a preset second current parameter; wherein the second current parameter is a target current parameter for charging the electronic device through the power adapter.
[0210] Step A10, if the first current parameter is less than the second current parameter and the absolute value of the difference is greater than the second preset threshold, or the first current parameter is greater than or equal to the second current parameter, the first current parameter does not meet the preset current condition, and steps A11 to A14 are executed; if the first current parameter is less than the second current parameter and the absolute value of the difference is less than or equal to the second preset threshold, it is determined that the first current parameter meets the preset current condition, and step A15 is executed.
[0211] Step A11, based on the absolute value of the difference, determine the step value corresponding to the first current parameter; the step value and the absolute value of the difference are positively correlated.
[0212] Step A12, if the first current parameter is greater than or equal to the second current parameter, subtract the step value corresponding to the first current parameter from the first current parameter to obtain the third current parameter; if the first current parameter is less than the second current parameter and the absolute value of the difference is greater than the second preset threshold, add the step value corresponding to the first current parameter to the first current parameter to obtain the third current parameter.
[0213] Step A13, determine the voltage parameter corresponding to the third current parameter that meets the preset current pressure difference requirement; send the voltage parameter that meets the preset current pressure difference requirement to the power adapter to instruct the power adapter to adjust the current first voltage parameter to a voltage parameter that meets the preset current pressure difference requirement.
[0214] Step A14, if the third current parameter is not within the current parameter range, the target mode is changed so that the third current parameter matches the current parameter range of the target charging mode after switching; if the third current parameter is within the current parameter range, the third current parameter is sent to the power adapter to instruct the power adapter to adjust the current parameter output by the power adapter based on the third current parameter, and return to execute step A8 until the first current parameter meets the preset current condition, and execute step A15.
[0215] Step A15, detecting whether the second current parameter or the second voltage parameter changes; if the second voltage parameter changes, returning to executing step A2; if the second current parameter changes, returning to executing step A8.
[0216] In one embodiment, another charging control method is provided, which is applied to a power adapter. The charging control method includes the following steps:
[0217] Step B1, when the electronic device and the power adapter are electrically connected, at least one charging mode supported by the power adapter is sent to the electronic device to instruct the electronic device to determine a target charging mode from at least one charging mode; the target charging mode includes a voltage parameter range and a current parameter range corresponding to the target charging mode supported by the power adapter.
[0218] Step B2, sending the current first voltage parameter to the electronic device, so that when the first voltage parameter does not meet the preset voltage condition, the electronic device determines the third voltage parameter based on the first voltage parameter and the preset second charging parameter; wherein the first voltage parameter is the voltage parameter actually output by the power adapter, the second voltage parameter is the target voltage parameter for charging the electronic device through the power adapter, the second voltage parameter is greater than the battery voltage parameter of the electronic device, the battery in the electronic device includes at least two battery cells connected in series, and the battery voltage parameter is obtained by adding the voltage parameters of each battery cell.
[0219] Among them, the electronic device determines whether the first voltage parameter meets the preset voltage condition in a manner including: determining the magnitude relationship and the absolute value of the difference between the first voltage parameter and a preset second voltage parameter; if the first voltage parameter is greater than or equal to the second voltage parameter, and the absolute value of the difference is greater than a first preset threshold, or the first voltage parameter is less than the second voltage parameter, determining that the first voltage parameter does not meet the preset voltage condition; if the first voltage parameter is greater than or equal to the second voltage parameter, and the absolute value of the difference is less than or equal to the first preset threshold, determining that the first voltage parameter meets the preset voltage condition;
[0220] Among them, the electronic device determines the third voltage parameter based on the first voltage parameter and the preset second voltage parameter, including: determining the step value corresponding to the first voltage parameter based on the absolute value of the difference; the step value and the absolute value of the difference are positively correlated; if the first voltage parameter is less than the second voltage parameter, then adding the step value corresponding to the first voltage parameter to the first voltage parameter to obtain the third voltage parameter; if the first voltage parameter is greater than or equal to the second voltage parameter and the absolute value of the difference is greater than the first preset threshold, then subtracting the step value corresponding to the first voltage parameter from the first voltage parameter to obtain the third voltage parameter.
[0221] Step B3: When the third voltage parameter is within the voltage parameter range, receiving the third voltage parameter sent by the electronic device, and adjusting the output voltage parameter based on the third voltage parameter.
[0222] Step B4, when the electronic device controls the power adapter to adjust the first voltage parameter, the lower limit value sent by the electronic device is obtained, and the current first current parameter is adjusted to the lower limit value.
[0223] Step B5, when the first voltage parameter meets the preset voltage condition, the current first current parameter is sent to the electronic device, so that when the first current parameter does not meet the preset current condition, the electronic device determines the third current parameter based on the first current parameter and the preset second current parameter; wherein the first current parameter is the current parameter actually output by the power adapter, and the second current parameter is the target current parameter for charging the electronic device through the power adapter.
[0224] Wherein, the electronic device determines whether the first current parameter satisfies the preset current condition in a manner including: determining the magnitude relationship and the absolute value of the difference between the first current parameter and a preset second current parameter; if the first current parameter is smaller than the second current parameter and the absolute value of the difference is greater than a second preset threshold, or the first current parameter is greater than or equal to the second current parameter, determining that the first current parameter does not satisfy the preset current condition; if the first current parameter is smaller than the second current parameter and the absolute value of the difference is less than or equal to the second preset threshold, determining that the first current parameter satisfies the preset current condition;
[0225] Among them, the electronic device determines the third current parameter based on the first current parameter and the preset second current parameter, including: determining the step value corresponding to the first current parameter based on the numerical range of the absolute value of the difference; the step value and the absolute value of the difference are positively correlated; if the first current parameter is greater than or equal to the second current parameter, subtracting the step value corresponding to the first current parameter from the first current parameter to obtain the third current parameter; if the first current parameter is less than the second current parameter and the absolute value of the difference is greater than the second preset threshold, adding the step value corresponding to the first current parameter to the first charging parameter to obtain the third current parameter.
[0226] Step B6, when the third current parameter is within the current parameter range, receiving a voltage parameter that meets the preset current pressure difference requirement and corresponds to the third current parameter sent by the electronic device; adjusting the current first voltage parameter to a voltage parameter that meets the preset current pressure difference requirement.
[0227] Step B7, receiving a third current parameter sent by the electronic device, and adjusting the output current parameter based on the third current parameter.
[0228] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0229] Based on the same inventive concept, the embodiment of the present application also provides a charging control device for implementing the charging control method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more charging control device embodiments provided below can refer to the limitations of the charging control method above, and will not be repeated here.
[0230] In one embodiment, Figure 8 As shown, a charging control device is provided, which is applied to an electronic device. The charging control device includes: a first charging parameter acquisition module 802, a third charging parameter determination module 804 and a sending module 806, wherein:
[0231] The first charging parameter acquisition module 802 is used to acquire a first charging parameter sent by an external power adapter when the electronic device is electrically connected to the external power adapter; the first charging parameter is a charging parameter actually output by the power adapter.
[0232] The third charging parameter determination module 804 is used to determine the third charging parameter based on the first charging parameter and the preset second charging parameter if the first charging parameter does not meet the preset charging condition; wherein the second charging parameter is a charging parameter of the target for charging the electronic device through the power adapter.
[0233] The sending module 806 is configured to send the third charging parameter to the power adapter to instruct the power adapter to adjust the charging parameter output by the power adapter based on the third charging parameter.
[0234] In the above-mentioned charging control device, when the electronic device is electrically connected to an external power adapter, the electronic device obtains a first charging parameter sent by the power adapter, and the first charging parameter is the charging parameter actually output by the power adapter, thereby avoiding data deviation caused by taking the charging parameter recorded by the software as the actual charging parameter; if the first charging parameter does not meet the preset charging condition, a third charging parameter is determined based on the first charging parameter and the preset second charging parameter, and the second charging parameter is the charging parameter of the target for charging the electronic device through the power adapter, and a more accurate third charging parameter can be determined, so that the third charging parameter is sent to the power adapter, and the power adapter adjusts the charging parameter output by the power adapter based on the more accurate third charging parameter, thereby avoiding current backflow caused by the charging adjustment by the power adapter and damaging the components of the power adapter, thereby improving the safety of charging control.
[0235] In one embodiment, the third charging parameter determination module 804 is further used to determine the step value corresponding to the first charging parameter based on the first charging parameter and the preset second charging parameter; and to determine the third charging parameter based on the step value corresponding to the first charging parameter and the first charging parameter.
[0236] In one embodiment, the third charging parameter determination module 804 is further used to determine the absolute value of the difference between the first charging parameter and the preset second charging parameter; based on the magnitude of the absolute value of the difference, determine the step value corresponding to the first charging parameter; and there is a positive correlation between the step value and the absolute value of the difference.
[0237] In one embodiment, the first charging parameter includes a first voltage parameter, and the second charging parameter includes a second voltage parameter; the third charging parameter determination module 804 is also used to add the first voltage parameter to the step value corresponding to the first voltage parameter to obtain the third voltage parameter if the first voltage parameter is less than the second voltage parameter; if the first voltage parameter is greater than or equal to the second voltage parameter, and the absolute value of the difference is greater than the first preset threshold, subtract the step value corresponding to the first voltage parameter from the first voltage parameter to obtain the third voltage parameter.
[0238] In one embodiment, the second voltage parameter is greater than a battery voltage parameter of the electronic device. The battery in the electronic device includes at least two battery cells connected in series. The battery voltage parameter is obtained by adding voltage parameters of each battery cell.
[0239] In one embodiment, the first charging parameter includes a first current parameter, the second charging parameter includes a second current parameter, and the third charging parameter includes a third current parameter; the third charging parameter determination module 804 is also used to, if the first current parameter is greater than or equal to the second current parameter, subtract the step value corresponding to the first current parameter from the first current parameter to obtain the third current parameter; if the first current parameter is less than the second current parameter and the absolute value of the difference is greater than a second preset threshold, add the step value corresponding to the first current parameter to the first charging parameter to obtain the third current parameter.
[0240] In one embodiment, the above-mentioned device also includes a module for determining voltage parameters that meet the current pressure difference requirements, and the module for determining voltage parameters that meet the current pressure difference requirements is used to determine the voltage parameters that meet the preset current pressure difference requirements corresponding to the third current parameter; the above-mentioned sending module 806 is also used to send the voltage parameters that meet the preset current pressure difference requirements to the power adapter to instruct the power adapter to adjust the current first voltage parameter to the voltage parameter that meets the preset current pressure difference requirements.
[0241] In one embodiment, the above-mentioned device also includes a judgment module, which is used to determine the size relationship and the absolute value of the difference between the first charging parameter and the preset second charging parameter; based on the size relationship and the absolute value of the difference, determine whether the first charging parameter meets the preset charging condition.
[0242] In one embodiment, the first charging parameter includes a first voltage parameter, the second charging parameter includes a second voltage parameter, and the preset charging condition includes a preset voltage condition; the above-mentioned judgment module is also used to determine that the first voltage parameter does not meet the preset voltage condition if the first voltage parameter is greater than or equal to the second voltage parameter and the absolute value of the difference is greater than the first preset threshold, or the first voltage parameter is less than the second voltage parameter; if the first voltage parameter is greater than or equal to the second voltage parameter and the absolute value of the difference is less than or equal to the first preset threshold, determine that the first voltage parameter meets the preset voltage condition.
[0243] In one embodiment, the first charging parameter includes a first current parameter, the second charging parameter includes a second current parameter, and the preset charging condition includes a preset current condition; the above-mentioned judgment module is also used to determine that if the first current parameter is less than the second current parameter and the absolute value of the difference is greater than the second preset threshold, or the first current parameter is greater than or equal to the second current parameter, then the first current parameter does not meet the preset current condition; if the first current parameter is less than the second current parameter and the absolute value of the difference is less than or equal to the second preset threshold, then it is determined that the first current parameter meets the preset current condition.
[0244] In one embodiment, the first charging parameter includes a first voltage parameter, the second charging parameter includes a second voltage parameter, the second voltage parameter is greater than the battery voltage of the electronic device, the third charging parameter includes a third voltage parameter, and the preset charging condition includes a preset voltage condition; after the above-mentioned sending module is used to send the third charging parameter to the power adapter, the first charging parameter acquisition module 802 is also used to obtain the current first voltage parameter of the power adapter, until the first voltage parameter meets the preset voltage condition, the current parameter output by the power adapter is adjusted.
[0245] In one embodiment, the first charging parameter acquisition module 802 is also used to acquire a first current parameter sent by a power adapter; the first current parameter is a current parameter actually output by the power adapter; the third charging parameter determination module 804 is also used to determine a third current parameter based on the first current parameter and a preset second current parameter if the first current parameter does not meet a preset current condition; the second current parameter is a current parameter of a target for charging an electronic device through a power adapter; the sending module 806 is also used to send the third current parameter to the power adapter to instruct the power adapter to adjust the current parameter output by the power adapter based on the third current parameter.
[0246] In one embodiment, the above-mentioned device also includes a detection module; the above-mentioned sending module 806 is used to send the third current parameter to the power adapter, and the above-mentioned first charging parameter acquisition module 802 is also used to obtain the first current parameter sent by the power adapter until the first current parameter meets the preset current condition, and the detection module is used to detect whether the second current parameter or the second voltage parameter changes; if the second voltage parameter changes, the above-mentioned first charging parameter acquisition module 802 is also used to obtain the first voltage parameter sent by the power adapter; if the second current parameter changes, the above-mentioned first charging parameter acquisition module 802 is also used to obtain the first current parameter sent by the power adapter.
[0247] In one embodiment, the sending module 806 is also used to send the current lower limit value for the power adapter to the power adapter when the electronic device controls the power adapter to adjust the voltage parameters, so as to instruct the power adapter to adjust the current first current parameter to the lower limit value.
[0248] In one embodiment, the above-mentioned device also includes a target mode determination module; the target mode determination module is used to obtain at least one charging mode supported by the power adapter; determine the target charging mode from at least one charging mode; the target charging mode includes a charging parameter range corresponding to the target charging mode supported and output by the power adapter; the above-mentioned sending module 806 is also used to determine whether the third charging parameter is within the charging parameter range, and if so, send the third charging parameter to the power adapter.
[0249] In one embodiment, the target mode determination module is further configured to switch the target charging mode if the third charging parameter is not within the charging parameter range, wherein the third charging parameter matches the charging parameter range of the target charging mode after switching.
[0250] In one embodiment, Fig. 9 As shown, a charging control device is provided, which is applied to a power adapter. The charging control device includes: a sending module 902, a receiving module 904 and a third charging parameter adjustment module 906, wherein:
[0251] The sending module 902 is used to obtain a first charging parameter when an external electronic device and a power adapter are electrically connected, and send the first charging parameter to the electronic device, so that when the first charging parameter does not meet the preset charging condition, the electronic device determines a third charging parameter based on the first charging parameter and a preset second charging parameter; the first charging parameter is the charging parameter actually output by the power adapter, and the second charging parameter is the charging parameter of the target for charging the electronic device through the power adapter.
[0252] The receiving module 904 is configured to receive a third charging parameter sent by the electronic device.
[0253] The charging parameter adjustment module 906 is configured to adjust the output charging parameter based on the third charging parameter.
[0254] In the above-mentioned charging control device, when an external electronic device and a power adapter are electrically connected, the power adapter obtains a first charging parameter and sends the first charging parameter to the electronic device, so that when the first charging parameter does not meet the preset charging condition, the electronic device determines a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the first charging parameter is the charging parameter actually output by the power adapter, which can avoid data deviation caused by taking the charging parameter recorded by the software as the actual charging parameter, and the second charging parameter is the charging parameter of the target for charging the electronic device through the power adapter, which can determine a more accurate third charging parameter; then, the power adapter receives the third charging parameter sent by the electronic device, and can adjust the output charging parameter based on the more accurate third charging parameter, thereby avoiding current backflow caused by the charging adjustment by the power adapter and damaging the components of the power adapter, thereby improving the safety of charging control.
[0255] In one embodiment, the first charging parameter includes a first current parameter, the second charging parameter includes a second current parameter, and the third charging parameter includes a third current parameter; the above-mentioned receiving module 904 is also used to receive a voltage parameter corresponding to the third current parameter sent by the electronic device and meeting the preset current pressure difference requirement; the above-mentioned charging parameter adjustment module 906 is also used to adjust the current first voltage parameter to a voltage parameter meeting the preset current pressure difference requirement.
[0256] In one embodiment, the first charging parameter includes a first voltage parameter, the second charging parameter includes a second voltage parameter, the second voltage parameter is greater than the battery voltage of the electronic device, and the third charging parameter includes a third voltage parameter; the above-mentioned charging parameter adjustment module 906 is also used to obtain the current lower limit value for the power adapter sent by the electronic device when the power adapter adjusts the first voltage parameter, and adjust the current first current parameter to the lower limit value.
[0257] In one embodiment, the sending module 902 is also used to send at least one charging mode supported by the power adapter to the electronic device to instruct the electronic device to determine a target charging mode from at least one charging mode; the target charging mode includes a charging parameter range corresponding to the target charging mode supported by the power adapter, and when the third charging parameter is within the charging parameter range, the receiving module is also used to receive the third charging parameter sent by the electronic device.
[0258] Each module in the above charging control device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device or a power adapter in the form of hardware, or can be stored in a memory in an electronic device or a power adapter in the form of software, so that the processor can call and execute operations corresponding to each module.
[0259] In one embodiment, a computer device is provided, which may be an electronic device or a power adapter. Taking the electronic device as a terminal as an example, its internal structure diagram may be as follows: Fig.10As shown. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and the external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a charging control method is implemented. The display unit of the electronic device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.
[0260] Those skilled in the art will understand that Fig.10 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0261] The embodiment of the present application also provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the charging control method.
[0262] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the charging control method.
[0263] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0264] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0265] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0266] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A charging control method, characterized in that: Applied to electronic equipment, the method comprises: When the electronic device is electrically connected to an external power adapter, obtaining a first charging parameter sent by the power adapter; the first charging parameter is a charging parameter actually output by the power adapter; If the first charging parameter does not meet the preset charging condition, determining a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter; The third charging parameter is sent to the power adapter to instruct the power adapter to adjust the charging parameter output by the power adapter based on the third charging parameter.
2. The method according to claim 1, characterized in that The determining a third charging parameter based on the first charging parameter and a preset second charging parameter includes: Based on the first charging parameter and a preset second charging parameter, determining a step value corresponding to the first charging parameter; A third charging parameter is determined based on the step value corresponding to the first charging parameter and the first charging parameter.
3. The method according to claim 2, characterized in that The determining, based on the first charging parameter and a preset second charging parameter, a step value corresponding to the first charging parameter includes: Determining an absolute value of a difference between the first charging parameter and a preset second charging parameter; Based on the magnitude of the absolute value of the difference, a step value corresponding to the first charging parameter is determined; and there is a positive correlation between the step value and the absolute value of the difference.
4. The method according to claim 3, characterized in that The first charging parameter includes a first voltage parameter, the second charging parameter includes a second voltage parameter, and the third charging parameter includes a third voltage parameter; The determining a third charging parameter based on the step value corresponding to the first charging parameter and the first charging parameter includes: If the first voltage parameter is less than the second voltage parameter, the first voltage parameter is added with the step value corresponding to the first voltage parameter to obtain the third voltage parameter; if the first voltage parameter is greater than or equal to the second voltage parameter and the absolute value of the difference is greater than a first preset threshold, the first voltage parameter is subtracted from the step value corresponding to the first voltage parameter to obtain the third voltage parameter.
5. The method according to claim 4, characterized in that The second voltage parameter is greater than a battery voltage parameter of the electronic device. The battery in the electronic device includes at least two battery cells connected in series. The battery voltage parameter is obtained by adding voltage parameters of each battery cell.
6. The method according to claim 3, characterized in that The first charging parameter includes a first current parameter, the second charging parameter includes a second current parameter, and the third charging parameter includes a third current parameter; The determining a third charging parameter based on the step value corresponding to the first charging parameter and the first charging parameter includes: If the first current parameter is greater than or equal to the second current parameter, subtracting the step value corresponding to the first current parameter from the first current parameter to obtain a third current parameter; If the first current parameter is less than the second current parameter, and the absolute value of the difference is greater than a second preset threshold, the first charging parameter is added to the step value corresponding to the first current parameter to obtain a third current parameter.
7. The method according to claim 6, characterized in that Before sending the third current parameter to the power adapter, the method further includes: Determining a voltage parameter corresponding to the third current parameter and meeting a preset current-voltage difference requirement; The voltage parameter that meets the preset current-voltage difference requirement is sent to the power adapter to instruct the power adapter to adjust the current first voltage parameter to the voltage parameter that meets the preset current-voltage difference requirement.
8. The method according to claim 1, characterized in that After acquiring the first charging parameter sent by the power adapter, the method further includes: Determine a magnitude relationship and an absolute value of a difference between the first charging parameter and a preset second charging parameter; Based on the magnitude relationship and the absolute value of the difference, it is determined whether the first charging parameter meets a preset charging condition.
9. The method according to claim 8, characterized in that The first charging parameter includes a first voltage parameter, the second charging parameter includes a second voltage parameter, and the preset charging condition includes a preset voltage condition; The determining, based on the magnitude relationship and the absolute value of the difference, whether the first charging parameter satisfies a preset charging condition includes: If the first voltage parameter is greater than or equal to the second voltage parameter and the absolute value of the difference is greater than a first preset threshold, or the first voltage parameter is less than the second voltage parameter, it is determined that the first voltage parameter does not meet the preset voltage condition; If the first voltage parameter is greater than or equal to the second voltage parameter, and the absolute value of the difference is less than or equal to a first preset threshold, it is determined that the first voltage parameter meets a preset voltage condition.
10. The method according to claim 8, characterized in that The first charging parameter includes a first current parameter, the second charging parameter includes a second current parameter, and the preset charging condition includes a preset current condition; The determining, based on the magnitude relationship and the absolute value of the difference, whether the first charging parameter satisfies a preset charging condition includes: If the first current parameter is less than the second current parameter and the absolute value of the difference is greater than a second preset threshold, or the first current parameter is greater than or equal to the second current parameter, then the first current parameter does not meet the preset current condition; If the first current parameter is less than the second current parameter, and the absolute value of the difference is less than or equal to the second preset threshold, it is determined that the first current parameter meets the preset current condition.
11. The method according to claim 1, characterized in that: The first charging parameter includes a first voltage parameter, the second charging parameter includes a second voltage parameter, the second voltage parameter is greater than a battery voltage parameter of the electronic device, the third charging parameter includes a third voltage parameter, and the preset charging condition includes a preset voltage condition; After sending the third charging parameter to the power adapter, the method further includes: The step of obtaining the first voltage parameter sent by the power adapter is performed again until the first voltage parameter meets the preset voltage condition, and then the current parameter output by the power adapter is adjusted.
12. The method according to claim 11, characterized in that The adjusting of the current parameter output by the power adapter includes: Acquire a first current parameter sent by the power adapter; the first current parameter is a current parameter actually output by the power adapter; If the first current parameter does not meet the preset current condition, a third current parameter is determined based on the first current parameter and a preset second current parameter; the second current parameter is a current parameter for charging the electronic device through the power adapter; The third current parameter is sent to the power adapter to instruct the power adapter to adjust the current parameter output by the power adapter based on the third current parameter.
13. The method according to claim 12, characterized in that After sending the third current parameter to the power adapter, the method further includes: Return to the step of obtaining the first current parameter sent by the power adapter, and until the first current parameter meets the preset current condition, detect whether the second current parameter or the second voltage parameter changes; If the second voltage parameter changes, the step of obtaining the first voltage parameter sent by the power adapter is performed again; If the second current parameter changes, the step of obtaining the first current parameter sent by the power adapter is performed again.
14. The method according to claim 11, characterized in that The method further comprises: When the electronic device controls the power adapter to adjust the voltage parameter, the current lower limit value for the power adapter is sent to the power adapter to instruct the power adapter to adjust the current first current parameter to the lower limit value.
15. The method according to claim 1, characterized in that Before acquiring the first charging parameter sent by the power adapter, the method further includes: Acquire at least one charging mode supported by the power adapter; Determining a target charging mode from the at least one charging mode; the target charging mode includes a charging parameter range corresponding to the target charging mode and supported and output by the power adapter; The sending the third charging parameter to the power adapter includes: Determine whether the third charging parameter is within the charging parameter range, and if so, send the third charging parameter to the power adapter.
16. The method according to claim 15, characterized in that The method further comprises: If the third charging parameter is not within the charging parameter range, the target charging mode is switched, wherein the third charging parameter matches the charging parameter range of the target charging mode after the switching.
17. A charging control method, characterized in that: Applied to a power adapter, the method comprises: When an external electronic device is electrically connected to the power adapter, a first charging parameter is obtained, and the first charging parameter is sent to the electronic device, so that when the first charging parameter does not meet a preset charging condition, the electronic device determines a third charging parameter based on the first charging parameter and a preset second charging parameter; wherein the first charging parameter is a charging parameter actually output by the power adapter, and the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter; A third charging parameter sent by the electronic device is received, and the output charging parameter is adjusted based on the third charging parameter.
18. The method according to claim 17, characterized in that The first charging parameter includes a first current parameter, the second charging parameter includes a second current parameter, and the third charging parameter includes a third current parameter; Before receiving the third charging parameter sent by the electronic device, the method further includes: receiving a voltage parameter corresponding to the third current parameter and meeting a preset current voltage difference requirement and sent by the electronic device; The current first voltage parameter is adjusted to the voltage parameter that meets the preset current-voltage difference requirement.
19. The method according to claim 17, characterized in that The first charging parameter includes a first voltage parameter, the second charging parameter includes a second voltage parameter, the second voltage parameter is greater than a battery voltage parameter of the electronic device, and the third charging parameter includes a third voltage parameter; The method further comprises: When the power adapter adjusts the first voltage parameter, the current lower limit value for the power adapter sent by the electronic device is obtained, and the current first current parameter is adjusted to the lower limit value.
20. The method according to claim 17, characterized in that Before sending the first charging parameter to the electronic device, the method further includes: At least one charging mode supported by the power adapter is sent to the electronic device to instruct the electronic device to determine a target charging mode from the at least one charging mode; the target charging mode includes a charging parameter range corresponding to the target charging mode supported and output by the power adapter, and when a third charging parameter is within the charging parameter range, the step of receiving the third charging parameter sent by the electronic device is performed.
21. A charging control device, characterized in that: Applied to electronic equipment, the device comprises: A first charging parameter acquisition module, configured to acquire a first charging parameter sent by an external power adapter when the electronic device is electrically connected to the power adapter; the first charging parameter is a charging parameter actually output by the power adapter; a third charging parameter determination module, configured to determine a third charging parameter based on the first charging parameter and a preset second charging parameter if the first charging parameter does not meet a preset charging condition; wherein the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter; The sending module is used to send the third charging parameter to the power adapter to instruct the power adapter to adjust the charging parameter output by the power adapter based on the third charging parameter.
22. A charging control device, characterized in that: Applied to a power adapter, the device comprises: a sending module, configured to obtain a first charging parameter when an external electronic device is electrically connected to the power adapter, and send the first charging parameter to the electronic device, so that the electronic device determines a third charging parameter based on the first charging parameter and a preset second charging parameter when the first charging parameter does not meet a preset charging condition; the first charging parameter is a charging parameter actually output by the power adapter, and the second charging parameter is a charging parameter of a target for charging the electronic device through the power adapter; a receiving module, configured to receive a third charging parameter sent by the electronic device, A charging parameter adjustment module is used to adjust the output charging parameter based on the third charging parameter.
23. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the charging control method according to any one of claims 1 to 20.
24. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 20 are implemented.
