Charging control method, device, computer equipment and storage medium

By detecting the battery voltage during charging of the terminal device and adjusting the charging threshold according to the aging degree, the repeated restart problems caused by battery aging are solved, and the starting efficiency of the device is improved.

CN115514031BActive Publication Date: 2024-11-05GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110691668.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-22
Publication Date
2024-11-05
Estimated Expiration
2041-06-22

AI Technical Summary

Technical Problem

When the terminal device is charged in the power-off state, the battery aging causes repeated restarts, reducing the charging startup efficiency.

Method used

By detecting the battery voltage during the charging process and adjusting the charging threshold according to the degree of battery aging, the first voltage and the second voltage are determined, and charging is stopped or continued to ensure that the battery voltage is sufficient to turn on, reducing the phenomenon of repeated restarts.

Benefits of technology

It effectively improves the startup efficiency of the terminal device in the shutdown state, reduces the repeated restarts during the charging process, and improves the stability of the charging process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115514031B_ABST
    Figure CN115514031B_ABST
Patent Text Reader

Abstract

The present application discloses a charging control method, device, terminal device and storage medium, and relates to the field of charging technology. The method includes: when the terminal device is in a shutdown state, determining to enter the first charging stage of charging the battery; during the first charging stage, when it is detected that the battery voltage of the terminal device is greater than the first voltage, stopping charging the battery and ending the first charging stage; if the battery voltage of the battery is greater than the second voltage after falling back, then turning on the terminal device and continuing to charge the battery, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage. The present application ensures that the battery voltage of the terminal device is sufficient when it is restarted by detecting the relationship between the battery voltage after falling back and the second voltage, thereby reducing the phenomenon of repeated restarts of the terminal device when charging when it is shut down, and improving the startup efficiency of the terminal device.
Need to check novelty before this filing date? Find Prior Art

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 storage medium. Background Art

[0002] With the continuous development of science and technology, people's pace of life is getting faster and faster. Most of the terminal devices used in daily life are powered by their own internal batteries. These terminal devices have also been configured with the function of charging the battery.

[0003] At present, in terminal devices, the charging control module is usually integrated in the analog digital signal processing chip (Analog Digital Singal Processor, ADSP), and the ADSP controls the charging process of the battery in the terminal device. Among them, when the terminal device is in the off state, it is usually detected whether the battery voltage of the battery is greater than the minimum starting voltage. If it is not less than the minimum starting voltage, the charging is stopped and the terminal device is controlled to start up. However, as the number of times the battery is used increases, battery aging will affect the charging process. After stopping charging, when the terminal device is about to be controlled to start up, the battery voltage is less than the minimum starting voltage, causing the terminal device to restart repeatedly, resulting in the problem of low startup efficiency of the terminal device during the charging process. Summary of the invention

[0004] The embodiments of the present application provide a charging control method, device, computer equipment and storage medium, which can reduce the phenomenon of repeated restarts of terminal equipment when charging in a shutdown state, and improve the startup efficiency of the terminal equipment. The technical solution is as follows:

[0005] On the one hand, an embodiment of the present application provides a charging control method, which is applied to a terminal device, and the method includes:

[0006] When the terminal device is in a powered-off state, when it is detected that the terminal device is connected to a charging device for charging, determining to enter a first charging stage for charging the battery;

[0007] During the first charging stage, if it is detected that the battery voltage of the terminal device is greater than a first voltage, charging of the battery is stopped, and the first charging stage is ended, wherein the first voltage is determined according to a minimum startup voltage at which the terminal device can be turned on and a first threshold, and the first threshold is related to the degree of aging of the battery;

[0008] If the battery voltage of the battery is greater than a second voltage after falling back, the terminal device is turned on and the battery continues to be charged, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage.

[0009] On the other hand, an embodiment of the present application provides a charging control device, which is applied to a terminal device, and the device includes:

[0010] a stage determination module, configured to determine, when the terminal device is in a shutdown state, to enter a first charging stage for charging the battery when detecting that the terminal device is connected to a charging device for charging;

[0011] a stage ending module, configured to stop charging the battery and end the first charging stage if it is detected that the battery voltage of the terminal device is greater than a first voltage during the first charging stage, wherein the first voltage is determined according to a minimum starting voltage at which the terminal device can be turned on and a first threshold, wherein the first threshold is related to the degree of aging of the battery;

[0012] A charging control module is used to power on the terminal device and continue charging the battery if the battery voltage of the battery is greater than a second voltage after falling back, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage.

[0013] On the other hand, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor implements the charging control method as described in one aspect above.

[0014] On the other hand, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the charging control method as described in one aspect above is implemented.

[0015] On the other hand, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the charging control method as described in one aspect above.

[0016] On the other hand, an embodiment of the present application provides an application publishing platform, which is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes the charging control method as described in one aspect above.

[0017] The technical solution provided by the embodiments of the present application may at least include the following beneficial effects:

[0018] When the terminal device is in a shutdown state, it is determined to enter the first charging stage of charging the battery; during the first charging stage, when it is detected that the battery voltage of the terminal device is greater than the first voltage, the battery charging is stopped and the first charging stage is ended, the first voltage is determined according to the minimum starting voltage that the terminal device can start and the first threshold, and the first threshold is related to the degree of aging of the battery; if the battery voltage of the battery is greater than the second voltage after falling back, the terminal device is turned on again, and the battery continues to be charged, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage. In the first charging stage, if the battery voltage is greater than the first voltage, the battery charging is stopped and the first charging stage is ended. The application can adjust the first voltage according to the degree of aging of the battery to ensure that the battery voltage that falls back after the battery stops charging is sufficient to start the terminal device, thereby reducing the phenomenon of repeated restarts of the terminal device when charging when it is turned off, and improving the startup efficiency of the terminal device. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 is a schematic diagram of a charging control structure of a terminal device provided by an exemplary embodiment of the present application;

[0021] Figure 2 This is a flow chart of a charging solution provided as an example in this application;

[0022] Figure 3 is a method flow chart of a charging control method provided by an exemplary embodiment of the present application;

[0023] Figure 4 is a method flow chart of a charging control method provided by an exemplary embodiment of the present application;

[0024] Figure 5 is a method flow chart of a charging control method provided by an exemplary embodiment of the present application;

[0025] Figure 6 is a method flow chart of a charging control method provided by an exemplary embodiment of the present application;

[0026] Figure 7 is a structural block diagram of a charging control device provided by an exemplary embodiment of the present application;

[0027] Figure 8It is a structural diagram of a terminal device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0028] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0029] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0030] The solution provided by the present application can be used in real-life scenarios where people charge terminal devices when using terminal devices in daily life. To facilitate understanding, some nouns and application scenarios involved in the embodiments of the present application are first briefly introduced below.

[0031] UEFI (Unified Extensible Firmware Interface) is a software interface between the operating system and the system firmware. It is also called the unified extensible firmware interface. It is a standard for describing type interfaces. This interface is usually used for terminal devices to automatically load an operating system from a pre-boot operating environment.

[0032] With the continuous development of science and technology, people use terminal devices in more and more scenarios in their daily lives. Terminal devices are powered by batteries. When the battery of a terminal device is low, the battery of the terminal device needs to be charged.

[0033] At present, in a battery charging technology, most of the battery charging methods are controlled by ADSP chips, please refer to Figure 1 , which shows a schematic diagram of a charging control structure of a terminal device provided by an exemplary embodiment of the present application. Figure 1 As shown, the charging control architecture includes a central processing unit CPU 101 and an analog digital signal processing chip (Analog Digital Singal Processor, ADSP) 102.

[0034] In the central processing unit CPU 101 of the terminal device, an operating system is usually running, and the operating system includes a kernel layer 101a and a framework layer 101b. The CPU 101 and the ADSP 102 are electrically connected via a GLINK bus. Figure 1 The charging logic in the circuit is controlled by ADSP 102. During the charging process, ADSP 102 can detect the actions of charger insertion and removal, identify the type of charger, and send messages through the GLINK bus to inform CPU 101 of the relevant charging status.

[0035] Optionally, the charging logic control can usually be directly implemented in the kernel layer of the CPU 101. The kernel layer is operable and controlled by the ADSP, and the ADSP is loaded during charging. When the terminal device is in a shutdown state, the activation of the charging logic during the charging process will drive the terminal device to start up, and adjust the terminal device from the shutdown state to the power-on state.

[0036] Please refer to Figure 2 , which shows a flow chart of a charging solution provided by an example of the present application. This process can be applied to the above Figure 1 In the architecture shown, it is controlled by the ADSP of the terminal device. Figure 2 As shown, the process may include the following steps:

[0037] Step 201, when the charger is inserted, detect whether the battery voltage is greater than 3.35 volts.

[0038] If yes, go to step 202, if no, go to step 203.

[0039] Step 202, continue to execute the boot process.

[0040] Step 203, charging the battery until the battery voltage is higher than 3.4 volts.

[0041] Step 204, shut down the computer and restart the computer.

[0042] That is to say, in the above process, if the battery of the terminal device is not over-discharged during use, that is, the battery voltage is greater than 3.35V, the terminal device will continue to execute the power-on process and directly start up when the charger is plugged in for charging. If the battery of the terminal device is less than 3.35V when the initial battery voltage is less than 3.35V, the battery will be charged first. When the battery voltage is charged to 3.4V (or higher), the device will be shut down first. After shutting down, the terminal device will continue to start up because it is plugged in to the charger. In the above scheme, when the battery is not aged or has not been used many times (for example, less than 10 times), the internal resistance of the battery is small. When the device continues to start up this time, the battery voltage re-acquired by the terminal device will be between 3.35V and 3.4V, so that it can be successfully started up.

[0043] However, in daily life, as the number of times the battery is used increases, the battery will sooner or later have problems such as aging and damage. When the battery is damaged or aged, in the above process, step 203 is usually implemented by mounting ADSP through UEFI. After charging to 3.4V, the kernel needs to re-mount ADSP, so the terminal device needs to be shut down and restarted. Considering the battery damage or aging problem mentioned above, during the process of shutting down and restarting, if the battery voltage drops from 3.4V to below 3.35, the above cycle will be re-entered, causing the terminal device to fail to start up and repeatedly restart.

[0044] In order to avoid repeated restarts during charging due to battery aging of the terminal device and improve the startup efficiency of the terminal device, the present application provides a solution. When the terminal device is in a shutdown state, a first threshold value related to the aging degree of the battery is selected during charging, and a first voltage as a detection condition is determined.

[0045] Please refer to Figure 3 , which shows a method flow chart of a charging control method provided by an exemplary embodiment of the present application. The method is applied to a terminal device, and the terminal device may include Figure 1 The charging control architecture shown in Figure 3 As shown, the method includes the following steps:

[0046] Step 301: When the terminal device is in a shutdown state and it is detected that the terminal device is connected to a charging device for charging, it is determined to enter a first charging stage for charging the battery.

[0047] Optionally, the charging device can be a wired charger or a wireless charger. When the terminal device detects that the charging device is inserted and charging, it determines that the battery enters the first charging stage. Before entering the first charging stage, the terminal device can be regarded as having executed the power-on step. The first charging stage refers to the stage of charging through the unified extensible firmware interface UEFI.

[0048] Step 302, during the first charging stage, if it is detected that the battery voltage of the terminal device is greater than the first voltage, the battery charging is stopped and the first charging stage is ended. The first voltage is determined based on the minimum starting voltage that the terminal device can start up and the first threshold value, and the first threshold value is related to the degree of aging of the battery.

[0049] Optionally, during the first charging stage, the terminal device obtains the battery voltage and detects the magnitude relationship between the battery voltage and the first voltage. If it is detected that the battery voltage is greater than the first voltage, the battery is stopped from being charged and the first charging stage is ended. Optionally, the first charging stage can be ended by shutting down the terminal device, thereby ending the first charging stage that has been entered.

[0050] Optionally, the minimum startup voltage is the minimum voltage that the battery needs to provide when the terminal device is switched from a shutdown state to a startup state. The first threshold value is related to the aging degree of the battery. That is, the aging degree of the battery of the terminal device will affect the magnitude of the first threshold value, thereby affecting the magnitude of the first voltage. For example, the higher the aging degree of the battery, the larger the first threshold value.

[0051] Optionally, the first voltage may be the sum of the minimum startup voltage and the first threshold, or may be the value obtained by calculating the minimum startup voltage and the first threshold according to a first formula, and the first formula may be pre-set in the terminal device by a developer or an operation and maintenance personnel. This application does not limit the calculation method of the first voltage.

[0052] Step 303: If the battery voltage of the battery is greater than the second voltage after falling back, the terminal device is turned on and the battery continues to be charged, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage.

[0053] Optionally, if the battery voltage of the battery is still greater than the second voltage after the fallback, the terminal device is turned on and charging continues. The fallback refers to the process in which the battery voltage decreases after the battery stops charging in step 302. Due to battery damage or aging, the value of the battery voltage after the fallback may be different. Therefore, if the value of the battery voltage after the fallback is still greater than the second voltage, it means that the battery can ensure the normal startup process of the terminal device, and then the startup is executed and charging continues.

[0054] In summary, when the terminal device is in a shutdown state, it is determined to enter the first charging stage of charging the battery; during the first charging stage, when it is detected that the battery voltage of the terminal device is greater than the first voltage, the battery charging is stopped and the first charging stage is ended, the first voltage is determined according to the minimum starting voltage that the terminal device can start and the first threshold, and the first threshold is related to the degree of battery aging; if the battery voltage of the battery is greater than the second voltage after falling back, the terminal device is turned on again, and the battery continues to be charged, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage. In the present application, if the battery voltage is greater than the first voltage in the first charging stage, the battery charging is stopped and the first charging stage is ended, and the relationship between the battery voltage after falling back and the second voltage is detected again, so as to ensure that the battery voltage of the terminal device is sufficient when it is restarted, reduce the phenomenon of repeated restarts of the terminal device when charging when it is shut down, and improve the startup efficiency of the terminal device.

[0055] In one possible implementation, the terminal device can also adjust the above-mentioned first threshold, and continue to re-set the first threshold for the terminal device in a cyclic manner, so as to realize dynamic adjustment of the first voltage during the charging process, thereby improving the flexibility and scalability of the solution.

[0056] Please refer to Figure 4 , which shows a method flow chart of a charging control method provided by an exemplary embodiment of the present application. The method is applied to a terminal device, and the terminal device may include Figure 1 The charging control architecture shown in Figure 4 As shown, the method includes the following steps:

[0057] Step 401, when the terminal device is in a shutdown state, when it is detected that the terminal device is connected to a charging device for charging, the battery parameters of the battery are obtained, and the battery parameters are used to reflect the aging degree of the battery.

[0058] The charging device may be a wired charger or a wireless charger. When the terminal device detects that the charging device is plugged in and charging is in progress, the terminal device may initialize UEFI, and UEFI obtains battery parameters of the battery through an analog-to-digital converter (ADC). Optionally, the battery parameters include one or more of battery temperature, battery aging coefficient, battery charge and discharge times, and battery internal resistance.

[0059] Due to different battery parameters, the battery internal resistance is different, resulting in different amounts of battery voltage drop when the battery falls back later. For example, when the battery temperature is high, the battery internal resistance is large, and when the battery temperature is low, the battery internal resistance is small. Alternatively, the larger the battery aging coefficient, the more serious the battery aging, the larger the battery internal resistance, the smaller the battery aging coefficient, the lighter the battery aging, and the smaller the battery internal resistance. Therefore, when the terminal device initializes UEFI, it will read the battery parameters of the battery in advance through ADC.

[0060] Step 402: Acquire a first threshold value corresponding to the battery parameter according to the battery parameter.

[0061] Optionally, the terminal device queries the corresponding correspondence table according to the battery parameters to obtain the first threshold value corresponding to the battery parameters. Please refer to Table 1, which shows a correspondence table between a battery parameter and a first threshold value involved in an exemplary embodiment of the present application, and the correspondence table contains the correspondence between the battery parameter and the first threshold value.

[0062] Battery parameters First threshold Battery parameter 1 The first threshold Battery parameter 2 First threshold two Battery parameter three First threshold three …… ……

[0063] Table 1

[0064] As shown in Table 1, when the battery parameter acquired by the terminal device is battery parameter three, the value of the first threshold corresponding to the battery parameter obtained by querying Table 1 is the first threshold three, thereby acquiring the corresponding first threshold.

[0065] Optionally, in this step, the terminal device may also determine a parameter interval of the battery parameter based on the battery parameter, and obtain a first threshold value corresponding to the parameter interval based on the parameter interval. For example, if the battery parameter is the battery temperature, the terminal device may also determine a temperature interval of the battery temperature based on the battery temperature, and obtain a first threshold value corresponding to the temperature interval based on the temperature interval. Please refer to Table 2, which shows a correspondence table between a temperature interval and a first threshold value involved in an exemplary embodiment of the present application, and the correspondence table contains a correspondence between the temperature interval and the first threshold value.

[0066] Temperature range First threshold Temperature range 1 The first threshold Temperature range 2 First threshold two Temperature range three First threshold three …… ……

[0067] Table 2

[0068] As shown in Table 2, when the terminal device obtains the battery temperature, when it is determined that the temperature interval of the battery temperature is interval two according to the battery temperature, the value of the first threshold corresponding to the temperature interval is obtained by querying Table 2, which is the first threshold two, thereby obtaining the first threshold corresponding to the temperature interval. For example, temperature interval one is greater than 16 degrees, the first threshold one is 50mv (millivolts), temperature interval two is 12 degrees to 16 degrees, the first threshold two is 75mv, temperature interval three is less than 12 degrees, and the first threshold three is 100mv. When the terminal device obtains that the battery temperature is 8 degrees, it is determined that the temperature interval of the battery temperature is interval three (less than 12 degrees) according to the battery temperature, and the first threshold determined by the terminal device is 100mv.

[0069] In a possible implementation, when the battery parameter includes multiple types, the corresponding relationships in the corresponding relationship table may also be increased. Please refer to Table 3, which shows another corresponding relationship table between the first battery parameter, the second battery parameter and the first threshold involved in an exemplary embodiment of the present application, and the corresponding relationship table includes the corresponding relationship between the first battery parameter, the second battery parameter and the first threshold.

[0070]

[0071] Table 3

[0072] As shown in Table 3, when the terminal device obtains battery parameters including the first battery parameter and the second battery parameter, the parameter values ​​obtained by the terminal device are the first battery parameter one and the second battery parameter one. The terminal device queries Table 3 based on the first battery parameter one and the second battery parameter one and obtains the corresponding first threshold value of the first threshold six, thereby obtaining the first threshold corresponding to the temperature range.

[0073] Step 403: determine a first voltage according to a first threshold and a minimum starting voltage.

[0074] The minimum startup voltage is the minimum voltage that the battery needs to provide when the terminal device is switched from the shutdown state to the startup state. Optionally, the terminal device can determine the first voltage based on the sum of the first threshold and the minimum startup voltage. For example, if the minimum startup voltage of the terminal device is 3.35V, and the first threshold determined in the above steps is 100mv, then the terminal device sums the minimum startup voltage and the first threshold, and the first voltage obtained is 3.45V.

[0075] In one possible implementation, the developer or operation and maintenance personnel pre-sets a calculation formula in the terminal device, and the terminal device can also bring the obtained first threshold and the minimum starting voltage into the calculation formula to calculate the first voltage. For example, the calculation formula is y=kx+b, where y represents the first voltage, x is the first threshold, b is the minimum starting voltage, and k is the coefficient for adjusting the first threshold. Optionally, k can be determined by the charging current, charging voltage, etc. of the terminal device.

[0076] Step 404, reading the battery voltage of the terminal device.

[0077] Optionally, the initialized UEFI may read the battery voltage of the terminal device and detect the battery voltage.

[0078] Step 405: When the battery voltage of the terminal device is not greater than the minimum starting voltage, it is determined to enter the first charging stage of charging the battery.

[0079] The first charging stage is a stage of charging through the unified extensible firmware interface UEFI. When the battery voltage is not greater than the minimum startup voltage, the voltage that the battery can provide cannot meet the needs of the terminal device when it switches from the off state to the on state, and it is determined to enter the first charging stage of charging the battery, that is, the terminal device first enters the first charging stage. In the first charging stage, UEFI can load ADSP and control ADSP to charge the battery through UEFI.

[0080] Optionally, when the battery voltage is greater than the minimum starting voltage, the voltage provided by the battery can meet the requirement of the terminal device to switch from the off state to the on state. The terminal device is directly turned on without entering the first charging stage and directly enters the second charging stage.

[0081] Step 406, during the first charging stage, if it is detected that the battery voltage of the terminal device is greater than the first voltage, the battery charging is stopped and the first charging stage is ended. The first voltage is determined based on the minimum starting voltage that the terminal device can start up and the first threshold value, and the first threshold value is related to the degree of aging of the battery.

[0082] Optionally, during the first charging stage, the terminal device may continue to collect the battery voltage of the terminal device. When the battery voltage of the terminal device is greater than the first voltage, the battery charging is stopped and the first charging stage is ended. That is, during the first charging stage, the terminal device will obtain the battery voltage and detect the magnitude relationship between the battery voltage and the first voltage. If it is detected that the battery voltage is greater than the first voltage, the battery charging is stopped and the first charging stage is ended. Optionally, ending the first charging stage may refer to stopping charging the battery through UEFI control. Among them, the terminal device can obtain the battery voltage in real time or periodically.

[0083] Optionally, during the first charging stage, if it is detected that the battery voltage of the terminal device is not greater than the first voltage, the battery continues to be charged in the first charging stage.

[0084] Step 407: If the battery voltage of the battery is greater than the second voltage after the first duration of the first charging stage ends, the terminal device is turned on and enters the second charging stage.

[0085] The second charging stage is a stage in which charging is performed through the kernel of the operating system of the terminal device.

[0086] After the first period of time, the terminal device detects whether the battery voltage of the battery is greater than the second voltage. If it is greater than the second voltage, the terminal device is turned on and the system desktop is loaded to enter the second charging stage.

[0087] That is, after the first duration of the first charging phase ends, the terminal device needs to be turned on, the operating system is run, and the system desktop is loaded on the display screen of the terminal device. Figure 5 , which shows a schematic diagram of a system desktop interface involved in an exemplary embodiment of the present application. Figure 5 As shown, the system desktop 500 includes various application controls 501. The user can enter the corresponding application interface by clicking the application control 501. Optionally, the system desktop is an interface displayed based on the operating system of the terminal device. For example, the operating system of the terminal device can be an Android operating system, an IOS operating system, a Windows operating system, etc.

[0088] Optionally, the charging logic of the second charging stage can be implemented in the kernel layer. That is, in this application, the first charging stage is implemented by UEFI, and the second charging stage is implemented by the kernel layer in the operating system. During the first charging stage, ADSP is mounted to UEFI and enters the over-discharge charging mode through UEFI. During the second charging stage, ADSP is mounted to the kernel layer and enters the mode of booting to the system desktop and continuing charging.

[0089] In one possible implementation, the terminal device includes a target register, which is used to record the historical charge and discharge times of the terminal device from the shutdown state to the startup state; before this step, the terminal device can also read the historical charge and discharge times of the target register; and determine the first duration based on the historical charge and discharge times. For example, each time the terminal device charges and discharges once, the number of the target register is increased once. After the first charging stage is finished, the number of the target register can be obtained first, and the range of the number of charge and discharge times of the terminal device can be determined based on the historical charge and discharge times of the terminal device. The corresponding first duration is determined through the range of times, and then the corresponding first duration is waited.

[0090] Optionally, please refer to Table 4, which shows a correspondence table between a first duration and a frequency range involved in an exemplary embodiment of the present application, wherein the correspondence table contains a one-to-one correspondence between the first duration and the frequency range.

[0091] Rep Range First duration Scope 1 First duration Scope 2 First Hour Two Scope 3 First Hour Three …… ……

[0092] Table 4

[0093] As shown in Table 4, after the terminal device obtains the historical charge and discharge times in the target register, the terminal device determines the number range corresponding to the historical charge and discharge times, and obtains the first duration corresponding to the number range by querying Table 4. For example, if the number range is range 2, then the first duration obtained by the terminal device is first duration 2.

[0094] The terminal device uses the battery voltage after the first time period as the battery voltage after falling back. Optionally, after the first time period, the terminal device uses the battery voltage at this time as the battery voltage after falling back. That is, after waiting for the first time period, the terminal device reacquires the battery voltage, thereby obtaining the value of the battery voltage after falling back after the first time period.

[0095] Step 408: If the battery voltage of the battery is greater than the second voltage after falling back, the terminal device is turned on and the battery continues to be charged, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage.

[0096] Optionally, the terminal device detects the relationship between the battery voltage after falling back and the second voltage. If the battery voltage of the battery is greater than the second voltage after falling back, the terminal device is turned on and the battery continues to be charged. Among them, the setting method of the second voltage can refer to the setting method of the first voltage, or the setting method of the second voltage is calculated according to the second threshold value obtained from practical experience, which is not repeated here. For example, the second voltage is the sum of the minimum starting voltage and the second threshold value, the second threshold value is less than the first threshold value, and the second voltage is set to 3.35V+25mV. When the battery voltage of the battery is greater than 3.35V+25mV after falling back, the terminal device is turned on and the battery continues to be charged.

[0097] Step 409: If the battery voltage of the battery is not greater than the second voltage after falling back, a new first threshold is determined according to the battery voltage after falling back.

[0098] In a possible implementation, during the above process of detecting the magnitude relationship between the battery voltage after falling back and the second voltage, if it is found that the battery voltage of the battery after falling back is not greater than the second voltage, the terminal device may further recalculate the first threshold value according to the second formula based on the battery voltage after falling back, and reset the calculated first threshold value. For example, the terminal device increases the difference between the voltage threshold value after falling back and the minimum starting voltage on the basis of the first threshold value.

[0099] For example, the second formula is as follows: P1 = P2 + (3.35-V) + 25mV. Where P1 is the new first threshold, P2 is the first threshold, and V is the battery voltage after the fallback. Taking the first threshold as 100mV and the second voltage as 3.35V + 25mV as an example, the battery voltage before the fallback is 3.45V, and the battery voltage after the fallback is 3.33V. At this time, the battery voltage after the fallback is lower than 3.35V + 25mV. The terminal device will bring the battery voltage of 3.33V after the fallback into the second formula and calculate that the reset first threshold is 145mV. Wherein, the 25mV in the second formula can be obtained based on experience, in order to prevent the new first threshold from increasing too much (for example, 1mV) than the previous first threshold.

[0100] In one possible implementation, the terminal device may also calculate the voltage drop value of the battery based on the battery voltage after the drop and the battery voltage before the drop, and set a new first threshold value based on the voltage drop value. The voltage drop value is used to indicate the amount of reduction in the battery voltage during the drop time. For example, in the above-mentioned process of detecting the magnitude relationship between the battery voltage after the drop and the second voltage, if it is found that the battery voltage of the battery is not greater than the second voltage after the drop, the terminal device may also calculate the voltage drop value of the battery based on the battery voltage before the drop and the battery voltage after the drop. For example, the battery voltage before the drop is 3.43V, and the battery voltage after the drop is 3.33V. The terminal device calculates that the voltage drop value is 0.12V based on the battery voltage before the drop minus the battery voltage after the drop. The terminal device adds the voltage drop value to the original first threshold, and uses the increased first threshold as the new first threshold.

[0101] Step 410, determining a new first voltage according to the new first threshold and the minimum starting voltage, and re-performing the step of determining to enter the first charging stage of charging the battery, until the battery voltage of the battery is greater than the second voltage after falling back.

[0102] Optionally, the terminal device calculates a new first voltage according to the new first threshold and the minimum starting voltage, resets the first voltage, and re-executes the above step of determining to enter the first charging stage of charging the battery, until entering step 409, that is, the battery voltage after falling back is greater than the second voltage. For example, the terminal device re-determines the first voltage according to the method in the above step 403, and restarts the above step 401. Optionally, after determining the new first threshold, the terminal device can also update the first threshold in the above correspondence table containing the first threshold, and calculate the new first voltage according to the new first threshold and the minimum starting voltage, which is not limited in this application. .

[0103] In summary, when the terminal device is in a shutdown state, it is determined to enter the first charging stage of charging the battery; during the first charging stage, when it is detected that the battery voltage of the terminal device is greater than the first voltage, the battery charging is stopped and the first charging stage is ended, the first voltage is determined according to the minimum starting voltage that the terminal device can start and the first threshold, and the first threshold is related to the degree of battery aging; if the battery voltage of the battery is greater than the second voltage after falling back, the terminal device is turned on again, and the battery continues to be charged, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage. In the present application, if the battery voltage is greater than the first voltage in the first charging stage, the battery charging is stopped and the first charging stage is ended, and the relationship between the battery voltage after falling back and the second voltage is detected again, so as to ensure that the battery voltage of the terminal device is sufficient when it is restarted, reduce the phenomenon of repeated restarts of the terminal device when charging when it is shut down, and improve the startup efficiency of the terminal device.

[0104] In addition, when the battery voltage drops to less than the second voltage after falling back, the terminal device can also recalculate the first threshold value according to the battery voltage after falling back, and then adjust the first voltage to ensure that the battery voltage after falling back in the subsequent process is greater than the second voltage, thereby avoiding the effect of multiple restarts of the terminal device and improving the flexibility of the charging process of the terminal device.

[0105] In addition, this solution can also determine the first duration through the historical charge and discharge times, so that when the terminal device is charging in the off state, the fallback duration can be selected in advance, avoiding the waste of time caused by always waiting according to the fixed duration, shortening the time consumed by UEFI charging, and improving the efficiency of charging and starting. The terminal device also reflects the degree of battery aging according to different battery parameters, thereby setting the first threshold, which can improve the accuracy of the first threshold setting.

[0106] Below, take the terminal device's operating system as Android system and the battery parameter as battery temperature as an example. Figure 3 and Figure 4 Please refer to the embodiment shown in Figure 6 , which shows a method flow chart of a charging control method provided by an exemplary embodiment of the present application. The method is applied to a terminal device, and the terminal device may include Figure 1 The charging control architecture shown in Figure 6 As shown, the method includes the following steps:

[0107] Step 601, UEFI initialization.

[0108] Step 602: UEFI reads the battery temperature through ADC.

[0109] Step 603: determine a first threshold value according to the battery temperature.

[0110] Optionally, the terminal device may determine the first threshold value according to the battery temperature with reference to the description in the above step 402, which will not be repeated here.

[0111] Step 604: UEFI reads the battery voltage through ADC.

[0112] Step 605, detecting whether the battery voltage is greater than the minimum starting voltage.

[0113] If it is not greater than the minimum starting voltage, execute step 606 ; otherwise, execute step 614 .

[0114] Step 606, mount the ADSP on UEFI and charge it, entering the UEFI charging phase.

[0115] Step 607, detecting whether the battery voltage is greater than the first voltage.

[0116] If it is greater than the first voltage, execute step 608 ; otherwise, execute step 612 .

[0117] Step 608: After the first time period, reacquire the battery voltage.

[0118] Step 609, detecting whether the battery voltage is greater than the second voltage.

[0119] If it is not greater than the second voltage, execute step 610 ; if it is greater than the second voltage, execute step 613 .

[0120] Step 610: reset the first threshold value according to the battery voltage.

[0121] Step 611, setting the charging state of UEFI to a continuing charging state.

[0122] Step 612, continue charging in the UEFI stage.

[0123] Step 613, shut down the terminal device.

[0124] Step 614, reboot to kernel.

[0125] In summary, when the terminal device is in a shutdown state, it is determined to enter the first charging stage of charging the battery; during the first charging stage, when it is detected that the battery voltage of the terminal device is greater than the first voltage, the battery charging is stopped and the first charging stage is ended, the first voltage is determined according to the minimum starting voltage that the terminal device can start and the first threshold, and the first threshold is related to the degree of battery aging; if the battery voltage of the battery is greater than the second voltage after falling back, the terminal device is turned on again, and the battery continues to be charged, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage. In the present application, if the battery voltage is greater than the first voltage in the first charging stage, the battery charging is stopped and the first charging stage is ended, and the relationship between the battery voltage after falling back and the second voltage is detected again, so as to ensure that the battery voltage of the terminal device is sufficient when it is restarted, reduce the phenomenon of repeated restarts of the terminal device when charging when it is shut down, and improve the startup efficiency of the terminal device.

[0126] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0127] Please refer to Figure 7 , which shows a structural block diagram of a charging control device provided by an exemplary embodiment of the present application. The charging control device 700 can be used in the above-mentioned terminal device to perform Figure 2 , Figure 3 ,or Figure 6 All or part of the steps in the method provided in the illustrated embodiment. The charging control device 700 may include the following modules:

[0128] The stage determination module 701 is used to determine to enter the first charging stage of charging the battery when it is detected that the terminal device is connected to a charging device for charging when the terminal device is in a shutdown state;

[0129] a stage ending module 702, configured to stop charging the battery and end the first charging stage if it is detected that the battery voltage of the terminal device is greater than a first voltage during the first charging stage, wherein the first voltage is determined according to a minimum starting voltage at which the terminal device can be turned on and a first threshold, wherein the first threshold is related to the degree of aging of the battery;

[0130] The charging control module 703 is used to power on the terminal device and continue charging the battery if the battery voltage of the battery is greater than a second voltage after falling back, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage.

[0131] Optionally, the device further comprises:

[0132] A first determining module, configured to stop charging the battery if it is detected by the stage ending module 702 during the first charging stage that the battery voltage of the terminal device is greater than the first voltage, and after the first charging stage is ended, if the battery voltage of the battery is not greater than the second voltage after falling back, determine a new first threshold value according to the battery voltage after falling back;

[0133] The second determination module is used to determine a new first voltage according to the new first threshold and the minimum starting voltage, and re-execute the step of determining to enter the first charging stage of charging the battery until the battery voltage of the battery is greater than the second voltage after falling back.

[0134] Optionally, the first determination module is used to calculate a voltage difference between the second voltage and the battery voltage after the fall back, and determine the sum of the first threshold and the voltage difference as a new first threshold.

[0135] Optionally, the second voltage is the sum of the minimum starting voltage and a second threshold, and the second threshold is less than the first threshold.

[0136] Optionally, the device further comprises:

[0137] A first acquisition module, used for acquiring battery parameters of the battery before the stage determination module 701 determines to enter the first charging stage of charging the battery, wherein the battery parameters are used to reflect the aging degree of the battery;

[0138] A second acquisition module, configured to acquire a first threshold value corresponding to the battery parameter according to the battery parameter;

[0139] The third determining module is configured to determine the first voltage according to the first threshold and the minimum starting voltage.

[0140] Optionally, the battery parameters include one or more of battery temperature, battery aging coefficient, battery charge and discharge times, and battery internal resistance.

[0141] Optionally, the stage determination module 701 includes: a voltage reading unit and a stage determination unit;

[0142] The voltage reading unit is used to read the battery voltage of the terminal device;

[0143] The stage determination unit is used to determine to enter the first charging stage of charging the battery when the battery voltage of the terminal device is not greater than the minimum starting voltage, and the first charging stage is a stage of charging through the unified extensible firmware interface UEFI.

[0144] Optionally, the charging control module 703 is also used to power on the terminal device and enter a second charging stage if the battery voltage of the battery is greater than a second voltage after the first time period of the first charging stage ends. The second charging stage is a stage of charging through the kernel of the operating system of the terminal device.

[0145] Optionally, the terminal device includes a target register, and the target register is used to record the historical charge and discharge times of the terminal device from a shutdown state to a startup state;

[0146] The device also includes:

[0147] A first reading module, used for the charging control module 703 to read the historical charge and discharge times of the target register before starting the terminal device and continuing to charge the battery if the battery voltage of the battery is greater than the second voltage after falling back;

[0148] The fourth determination module is used to determine the first duration according to the historical charge and discharge times.

[0149] In summary, when the terminal device is in a shutdown state, it is determined to enter the first charging stage of charging the battery; during the first charging stage, when it is detected that the battery voltage of the terminal device is greater than the first voltage, the battery charging is stopped and the first charging stage is ended, the first voltage is determined according to the minimum starting voltage that the terminal device can start and the first threshold, and the first threshold is related to the degree of battery aging; if the battery voltage of the battery is greater than the second voltage after falling back, the terminal device is turned on again, and the battery continues to be charged, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage. In the present application, if the battery voltage is greater than the first voltage in the first charging stage, the battery charging is stopped and the first charging stage is ended, and the relationship between the battery voltage after falling back and the second voltage is detected again, so as to ensure that the battery voltage of the terminal device is sufficient when it is restarted, reduce the phenomenon of repeated restarts of the terminal device when charging when it is shut down, and improve the startup efficiency of the terminal device.

[0150] Figure 8 is a schematic diagram of the structure of a terminal device provided by an exemplary embodiment of the present application. Figure 8As shown, the terminal device 800 includes a central processing unit (CPU) 801, a system memory 804 including a random access memory (RAM) 802 and a read only memory (ROM) 803, and a system bus 805 connecting the system memory 804 and the central processing unit 801. The terminal device 800 also includes a basic input / output system (I / O system) 808 for helping to transmit information between various components in the computer, and a large-capacity storage device 807 for storing an operating system 812, application programs 813 and other program modules 814.

[0151] The basic input / output system 806 includes a display 808 for displaying information and an input device 809 such as a mouse and a keyboard for user inputting information. The display 808 and the input device 809 are connected to the central processing unit 801 through an input / output controller 810 connected to the system bus 805. The basic input / output system 806 may also include an input / output controller 810 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 810 also provides output to a display screen, a printer, or other types of output devices.

[0152] The mass storage device 807 is connected to the central processing unit 801 via a mass storage controller (not shown) connected to the system bus 805. The mass storage device 807 and its associated computer-readable medium provide non-volatile storage for the terminal device 800. That is, the mass storage device 807 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.

[0153] The computer readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, cassettes, magnetic tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above. The above-mentioned system memory 804 and mass storage device 807 can be collectively referred to as memory.

[0154] The terminal device 800 can be connected to the Internet or other network devices through a network interface unit 811 connected to the system bus 805 .

[0155] The memory also includes one or more programs, which are stored in the memory. The central processing unit 801 implements all or part of the steps performed by the computer device in the methods provided in the above embodiments of the present application by executing the one or more programs.

[0156] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0157] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a high-density digital video disc (Digital Video Disc, DVD)), or a semiconductor medium (e.g., a solid-state drive (Solid State Disk, SSD)), etc.

[0158] It should be noted that: in the charging control method provided in the above embodiments, the steps performed by the pixel module and the terminal are only exemplified by the above embodiments. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0159] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0160] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A charging control method, characterized in that: Applied to a terminal device, the method comprises: When the terminal device is in a powered-off state, when it is detected that the terminal device is connected to a charging device for charging, determining to enter a first charging stage for charging the battery; During the first charging stage, if it is detected that the battery voltage of the terminal device is greater than a first voltage, charging of the battery is stopped, and the first charging stage is ended, wherein the first voltage is determined according to a minimum startup voltage at which the terminal device can be turned on and a first threshold, and the first threshold is related to the degree of aging of the battery; If the battery voltage of the battery is greater than a second voltage after falling back, the terminal device is turned on and the battery continues to be charged, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage; If the battery voltage of the battery is not greater than the second voltage after falling back, determining a new first threshold value according to the battery voltage after falling back; A new first voltage is determined according to the new first threshold and the minimum starting voltage, and the step of determining to enter the first charging stage for charging the battery is re-executed until the battery voltage of the battery is greater than the second voltage after falling back.

2. The method according to claim 1, characterized in that The step of determining a new first threshold value according to the battery voltage after the battery voltage drops back down comprises: A voltage difference between the second voltage and the battery voltage after the fall back is calculated, and a sum of the first threshold and the voltage difference is determined as a new first threshold.

3. The method according to claim 1 or 2, characterized in that: The second voltage is the sum of the minimum starting voltage and a second threshold, and the second threshold is less than the first threshold.

4. The method according to claim 1, characterized in that: Before determining to enter the first charging stage of charging the battery, the method further includes: Acquiring battery parameters of the battery, where the battery parameters are used to reflect the aging degree of the battery; According to the battery parameter, acquiring a first threshold value corresponding to the battery parameter; The first voltage is determined according to the first threshold and the lowest starting voltage.

5. The method according to claim 4, characterized in that The battery parameters include one or more of battery temperature, battery aging coefficient, battery charge and discharge times, and battery internal resistance.

6. The method according to claim 1, characterized in that The step of determining to enter a first charging stage of charging the battery comprises: Reading the battery voltage of the terminal device; When the battery voltage of the terminal device is not greater than the minimum starting voltage, it is determined to enter a first charging stage for charging the battery, where the first charging stage is a stage for charging through a unified extensible firmware interface UEFI.

7. The method according to claim 1, characterized in that If the battery voltage of the battery is greater than the second voltage after falling back, the terminal device is turned on and the battery is continuously charged, comprising: If after the first duration of the first charging stage ends, the battery voltage of the battery is greater than the second voltage, the terminal device is turned on and enters the second charging stage, which is a stage of charging through the kernel of the terminal device's operating system.

8. The method according to claim 7, characterized in that The terminal device includes a target register, and the target register is used to record the historical charge and discharge times of the terminal device from the shutdown state to the startup state; If the battery voltage of the battery is greater than the second voltage after falling back, the terminal device is turned on and before continuing to charge the battery, the method further includes: Read the historical charge and discharge times of the target register; A first duration is determined according to the historical number of charge and discharge times.

9. A charging control device, characterized in that: Applied to a terminal device, the device comprises: a stage determination module, configured to determine, when the terminal device is in a shutdown state, to enter a first charging stage for charging the battery when detecting that the terminal device is connected to a charging device for charging; a stage ending module, configured to stop charging the battery and end the first charging stage if it is detected that the battery voltage of the terminal device is greater than a first voltage during the first charging stage, wherein the first voltage is determined according to a minimum starting voltage at which the terminal device can be turned on and a first threshold, wherein the first threshold is related to the degree of aging of the battery; a charging control module, configured to power on the terminal device and continue charging the battery if the battery voltage of the battery is greater than a second voltage after falling back, wherein the second voltage is not less than the minimum starting voltage and not greater than the first voltage; The device also includes: A first determining module, configured to stop charging the battery if it is detected by the stage ending module during the first charging stage that the battery voltage of the terminal device is greater than the first voltage, and after the first charging stage ends, if the battery voltage of the battery is not greater than the second voltage after falling back, determine a new first threshold value according to the battery voltage after falling back; The second determination module is used to determine a new first voltage according to the new first threshold and the minimum starting voltage, and re-execute the step of determining to enter the first charging stage of charging the battery until the battery voltage of the battery is greater than the second voltage after falling back.

10. A terminal device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the charging control method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the charging control method according to any one of claims 1 to 8 is implemented.