Charging control method and device, electronic equipment, adapter and storage medium
By detecting intermittent events during the fast charging process of electronic devices and switching fast charging power according to the number of interruptions, the impact of interruption phenomenon during the fast charging process on charging speed is solved, and a more stable charging process is achieved.
Patent Information
- Application Number
- CN202510295873.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-06-20
AI Technical Summary
Intermittent charging interruption may occur during fast charging, affecting the charging speed of electronic devices.
By detecting the number of interruptions of interruptions during the charging process of the electronic device, when the adapter type and interruptions meet a specific switching condition, switch from the first fast charging power to the second fast charging power.
It effectively avoids the negative impact of occasional intermittent on charging speed, and ensures the charging speed of electronic devices to the greatest extent.
Smart Images

Figure CN120185142A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of fast charging technology, and particularly to a charging control method, device, electronic device, adapter, and storage medium. Background Art
[0002] With the development of fast charging technology, electronic devices can be charged through fast charging technology. However, during fast charging, "intermittency" may occur due to certain reasons, that is, an intermittent interruption phenomenon occurs during charging, affecting the charging of the electronic device. Summary of the Invention
[0003] Embodiments of this application provide a charging control method, device, electronic device, adapter, and storage medium, which can avoid the problem of affecting the charging speed of an electronic device when an occasional "intermittency" occurs during the charging process of the electronic device.
[0004] In a first aspect, an embodiment of this application provides a charging control method applied to an electronic device, and the method includes:
[0005] During the charging process of the electronic device, in response to a detected intermittency event, obtain the number of intermittency events that occur during the charging process of the electronic device;
[0006] When the type of the adapter charging the electronic device and the number of intermittency events meet the corresponding switching conditions, switch from a first fast charging power to a second fast charging power; the first fast charging power is greater than the second fast charging power.
[0007] In a second aspect, an embodiment of this application provides a charging control method applied to an adapter, and the method includes:
[0008] During the charging process of the electronic device, in response to an intermittency event, obtain the number of intermittency events that occur during the charging process of the electronic device;
[0009] When the type of the adapter and the number of intermittency events meet the corresponding switching conditions, switch from a first fast charging power to a second fast charging power; the first fast charging power is greater than the second fast charging power.
[0010] In a third aspect, an embodiment of this application provides a charging control method applied to an adapter, and the method includes:
[0011] Receive a switching instruction; the switching instruction is sent by the electronic device during the charging process, in response to a detected intermittency event, obtain the number of intermittency events that occur during the charging process of the electronic device, and when it is determined that the type of the adapter charging the electronic device and the number of intermittency events meet the corresponding switching conditions;
[0012] In response to the switching instruction, switch from the first fast charging power to the second fast charging power; the first fast charging power is greater than the second fast charging power.
[0013] Fourthly, an embodiment of the present application provides a charging control device applied to an electronic device. The device includes:
[0014] A first acquisition module, configured to, during the charging process of the electronic device, in response to a detected intermittent event, acquire the number of intermittent events that occur during the charging process of the electronic device.
[0015] A switching module, configured to switch from the first fast charging power to the second fast charging power when the type of the adapter for charging the electronic device and the number of intermittent events meet the corresponding switching conditions; the first fast charging power is greater than the second fast charging power.
[0016] Fifthly, an embodiment of the present application provides a charging control device applied to an adapter. The device includes:
[0017] An acquisition module, configured to, during the charging process of the electronic device, in response to an intermittent event, acquire the number of intermittent events that occur during the charging process of the electronic device.
[0018] A switching module, configured to switch from the first fast charging power to the second fast charging power when the type of the adapter and the number of intermittent events meet the corresponding switching conditions; the first fast charging power is greater than the second fast charging power.
[0019] Sixthly, an embodiment of the present application provides a charging control device applied to an adapter. The device includes:
[0020] A receiving module, configured to receive a switching instruction; the switching instruction is sent by the electronic device during the charging process, in response to a detected intermittent event, acquire the number of intermittent events that occur during the charging process of the electronic device, and when it is determined that the type of the adapter for charging the electronic device and the number of intermittent events meet the corresponding switching conditions.
[0021] A switching module, configured to, in response to the switching instruction, switch from the first fast charging power to the second fast charging power; the first fast charging power is greater than the second fast charging power.
[0022] Seventhly, an embodiment of the present application provides an electronic device, including a memory and a processor. When the computer program stored in the memory is executed by the processor, the processor is caused to execute the steps of the charging control method as described in the first aspect.
[0023] In an eighth aspect, an embodiment of the present application provides an adapter, including a memory and a processor. A computer program is stored in the memory. When the computer program is executed by the processor, the processor is caused to execute the steps of the charging control method described in the second aspect or the third aspect.
[0024] In a ninth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first aspect, the second aspect, or the third aspect are implemented.
[0025] In a tenth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the method described in the first aspect, the second aspect, or the third aspect are implemented.
[0026] In the above-mentioned charging control method, device, electronic device, adapter, and storage medium, during the charging process of the electronic device, in response to a detected intermittent event, the number of intermittent occurrences during the charging process of the electronic device is obtained. When the type of the adapter for charging the electronic device and the number of intermittent occurrences meet the corresponding switching conditions, the fast charging power can be switched from the first fast charging power to the second fast charging power, where the first fast charging power is greater than the second fast charging power. Compared with switching to other low fast charging powers for fast charging when a detected intermittent event occurs, by switching the fast charging power of the electronic device when the type of the adapter and the number of intermittent occurrences meet the corresponding switching conditions, the problem of reducing the charging speed of the electronic device due to reducing the current flow by switching the fast charging power to avoid occasional interruptions during the charging process is avoided, and the charging speed of the electronic device is ensured to the greatest extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0028] Figure 1 It is an application environment diagram of the charging control method in an embodiment;
[0029] Figure 2 It is a flowchart of the charging control method in an embodiment;
[0030] Figure 3 It is a flowchart of the charging control method in another embodiment;
[0031] Figure 4 It is a flowchart of the charging control method in another embodiment;
[0032] Figure 5 is a flowchart of a charging control method in an embodiment;
[0033] Figure 6 is a flowchart of a charging control method in an embodiment;
[0034] Figure 7 is a flowchart of a charging control method in another embodiment;
[0035] Figure 8 is a structural block diagram of a charging control device in an embodiment;
[0036] Figure 9 is a structural block diagram of a charging control device in an embodiment;
[0037] Figure 10 is a structural block diagram of a charging control device in an embodiment;
[0038] Figure 11 is a schematic internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0039] In order to make the objectives, technical solutions, and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to 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.
[0040] The charging control method provided in the embodiments of the present application can be applied to an application environment as shown in Figure 1 . Among them, the adapter 104 can charge the electronic device 102. The electronic device 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The adapter 104 can be chargers of various models, can also be a mobile power supply, or can also be various terminals such as laptop computers and tablet computers. It can be understood that when the adapter 104 is a terminal, for example, when the adapter 104 is a laptop computer and the electronic device 102 is a smart phone, the smart phone can be charged by the laptop computer. Another example is that when the adapter 104 is a laptop computer and the electronic device 102 is a smart watch, the smart watch can be charged by the laptop computer. In addition, it should be noted that the adapter 104 in the embodiments of the present application is an adapter that supports fast charging, and the charging control method provided in the embodiments of the present application is applicable to a fast charging scenario.
[0041] In one embodiment, as shown in Figure 2 , a charging control method is provided. Taking the method applied to the electronic device in Figure 1 as an example, the method includes the following steps:
[0042] S201. During the charging process of the electronic device, in response to the detected intermittent event, obtain the number of intermittent occurrences of the intermittent event during the charging process of the electronic device.
[0043] Among them, the intermittent event refers to the intermittent charging interruption phenomenon that occurs in the electronic device during the fast charging process due to reasons such as unstable connection between the adapter and the electronic device, damaged charging cable, and power voltage fluctuation, that is, the charging is not continuously and stably carried out, but will stop charging from time to time and then start charging again. For example, when the mobile phone is fast charging, the charging icon may show that it is charging for a while and then show that the charging has stopped, and the increase in battery power is not a smooth rise but a jumpy one. This is the "intermittent" phenomenon in fast charging.
[0044] Exemplarily, the electronic device can determine whether an intermittent event is detected through a power management chip. For example, it can determine whether an intermittent event is detected through the flag bit of the power management chip. If the value of the flag bit of the power management chip is 1, it can be determined that an intermittent event is detected. If the value of the flag bit of the power management chip is 0, it can be determined that no intermittent event is detected. Or, the electronic device can determine whether an intermittent event is detected based on the time difference between the access time when the adapter is connected to the electronic device and the removal time when the adapter is removed from the electronic device. For example, if the above time difference is less than a preset time threshold, it is determined that an intermittent event is detected. If the above time difference is greater than the preset time threshold, it may indicate that it is a manual plugging and unplugging, not an intermittent event. Or, a current monitoring point can be set in the charging circuit, and the charging current data is collected in real time through a high-precision current sensor. When the current has a short interruption or abnormal fluctuation, it is determined that an intermittent event is detected.
[0045] Exemplarily, in this embodiment, the number of intermittent occurrences of the intermittent event can be the number of intermittent events that occur within a period of time adjacent to the intermittent time corresponding to the detected intermittent event, such as within one minute, or it can also be the total number of intermittent events that occur during the charging process of the electronic device.
[0046] As a possible implementation, a counter for counting intermittent events can be set in the electronic device, and the number of intermittent occurrences of the intermittent event during the charging process of the electronic device can be obtained from this counter. Exemplarily, the number of intermittent occurrences of the intermittent event during the charging process of the electronic device may be 0 times, or 1 time, or 5 times, etc. It can be understood that if the electronic device has 5 intermittent events during the charging process, it means that the electronic device frequently has intermittent events during the charging process.
[0047] S202. When the type and number of interruptions of the adapter for charging the electronic device meet the corresponding switching conditions, switch from the first fast charging power to the second fast charging power; the first fast charging power is greater than the second fast charging power.
[0048] Exemplarily, the type of the adapter may be a normal adapter or an abnormal adapter. It should be noted that the abnormal adapter in the embodiments of the present application refers to an adapter with too large impedance that requires current reduction processing after interruption. As a possible implementation manner, after the electronic device establishes a communication connection with the adapter, the electronic device can obtain the product identification code of the adapter, such as a Type-C adapter, through interaction with the adapter, and then can determine whether the adapter is an abnormal adapter from the pre-established abnormal adapter product identification code table.
[0049] Among them, the electronic device can support multiple different fast charging protocols, and the charging powers of multiple different fast charging protocols are different. If it is determined that the current fast charging power is no longer suitable for fast charging the electronic device, the fast charging power can be switched to a fast charging power lower than the current fast charging power. For example, the electronic device supports four fast charging protocols A, B, C, and D. The sorting of the average charging powers of the four fast charging protocols for a predetermined charging stage is D > A > C > B. The current fast charging power is the power corresponding to protocol D. If it is determined that the power corresponding to fast charging protocol D is no longer suitable for fast charging the electronic device, the fast charging power can be switched to the power corresponding to fast charging protocol A.
[0050] In this embodiment, the corresponding switching conditions can be determined according to the type of the adapter, and then it can be determined whether to switch the fast charging power by judging whether the number of interruptions of the interruption event occurring during the charging process meets the corresponding switching conditions. Further, when it is determined that the type of the adapter and the number of interruptions of the interruption event occurring during the charging process meet the corresponding switching conditions, the electronic device can switch the fast charging power from the first fast charging power to the second fast charging power that is less than the first fast charging power. For example, if the type of the adapter is an abnormal adapter, it can be determined whether the switching conditions are met according to the total number of interruption events occurring during the charging process of the electronic device; if the type of the adapter is a non-abnormal adapter, it can be determined whether the switching conditions are met according to the number of interruption events occurring within a preset time period adjacent to the interruption time of the detected interruption event.
[0051] In the above charging control method, during the charging process of the electronic device, in response to the detected intermittent event, the number of intermittent occurrences during the charging process of the electronic device is obtained. When the type of the adapter for charging the electronic device and the number of intermittent occurrences meet the corresponding switching conditions, the fast charging power can be switched from the first fast charging power to the second fast charging power, where the first fast charging power is greater than the second fast charging power. Compared with switching to other low fast charging powers for fast charging when an intermittent event is detected, by switching the fast charging power of the electronic device when the type of the adapter and the number of intermittent occurrences meet the corresponding switching conditions, the problem of reducing the charging speed of the electronic device due to the occasional intermittence during the charging process and reducing the charging current by switching the fast charging power is avoided, and the charging speed of the electronic device is ensured to the greatest extent.
[0052] In this embodiment, the detailed process of determining whether the type of the adapter and the number of intermittent occurrences during the charging process meet the corresponding switching conditions will be explained. In one embodiment, the above method further includes:
[0053] Step A, if the type of the adapter is the first type, determine whether the switching condition is met according to the first number of intermittent occurrences and the charging current corresponding to the first fast charging power; the first number of intermittent occurrences is the total number of intermittent events during the charging process of the electronic device.
[0054] In this embodiment, the number of intermittent occurrences during the charging process of the electronic device includes the first number of intermittent occurrences and the second number of intermittent occurrences, where the first number of intermittent occurrences is the total number of intermittent events during the charging process of the electronic device, and the second number of intermittent occurrences is the number of intermittent events occurring within a preset time period adjacent to the intermittent time of the detected intermittent event. For example, the second number of intermittent occurrences can be the number of intermittent events occurring within the previous minute of the intermittent time of the detected intermittent event.
[0055] In this embodiment, if it is determined that the type of the adapter is the first type, for example, the adapter of the first type may be the abnormal adapter mentioned above, an adapter with an excessive impedance that requires current reduction processing after intermittent interruption, then the product value of the above-mentioned first intermittent count and the preset current value can be obtained to obtain the current adjustment value. The preset current value may be 1A, 1.5A, 2A, etc. Then, the current difference between the charging current corresponding to the first fast charging power and the current adjustment value is obtained. For example, assuming that the preset current value is 1A, the charging current corresponding to the first fast charging power is max_power, and the total number of intermittent events occurring during the charging process of the electronic device is total_break_cnt, then the current difference can be determined according to the formula max_power - total_break_cnt * 1A, that is, subtract 1A each time based on the charging current corresponding to the first fast charging power, and the obtained current difference is determined as the current value applied to the adapter. Further, if the current difference is less than the current value corresponding to the second fast charging power, that is, the current value applied to the adapter is less than the current value corresponding to the second fast charging power, it is determined that the switching condition is satisfied. For example, assuming that the charging current corresponding to the first fast charging power is 6A and the charging current corresponding to the second fast charging power is 4A, if the total number of intermittent events occurring during the charging process of the electronic device is 3 when the current intermittent event is detected, the current difference is 3A, which is less than the charging current corresponding to the second fast charging power, then it is determined that the switching condition is satisfied; if the total number of intermittent events occurring during the charging process of the electronic device is 1 when the current intermittent event is detected, the current difference is 5A, which is greater than the charging current corresponding to the second fast charging power, then it can be determined that the switching condition is not satisfied.
[0056] Step B, if the type of the adapter is the second type, then determine whether the switching condition is satisfied according to the second intermittent count; the second type is different from the first type; the second intermittent count is the number of intermittent events occurring within a preset duration adjacent to the intermittent time of the detected intermittent event.
[0057] In this embodiment, if it is determined that the type of the adapter is the second type, for example, the adapter of the second type may be a non-abnormal adapter, then whether the switching condition is met can be determined according to the above-mentioned second interruption count. As a possible implementation, if the above-mentioned second interruption count is greater than a preset count threshold, it can be determined that the switching condition is met. It can be understood that the second interruption count is the number of interruption events that occur within a preset duration adjacent to the interruption time of the detected interruption event. If the second interruption count is greater than the preset count threshold, it indicates that the number of interruption events occurring within a short period of time is excessive. At this time, the first fast charging power is no longer suitable, and it is necessary to switch to other fast charging power for charging. For example, assuming that the preset count threshold is 5 times, and the second interruption count is the number of interruption events that occur within one minute adjacent to the interruption time of the detected interruption event. If the second interruption count is greater than 5 times, it indicates that the number of interruption events occurring within the adjacent one minute is excessive, and it is necessary to switch the fast charging power. Then it can be determined that the switching condition is met at this time, and the fast charging power can be switched from the first fast charging power to the second fast charging power; if the second interruption count is less than 5 times, the existing fast charging power can be maintained for charging, that is, the first fast charging power can continue to be used for charging.
[0058] In this embodiment, when the type of the adapter is the first type, whether the switching condition is met can be determined according to the total number of interruption events that occur during the charging process of the electronic device and the charging current corresponding to the first fast charging power. When the type of the adapter is the second type, whether the switching condition is met can be determined according to the number of interruption events that occur within a preset duration adjacent to the interruption time of the detected interruption event. For different types of adapters, different switching conditions can be determined, and then whether the corresponding switching condition is met can be determined according to the number of interruption events that occur during the charging process of the electronic device, ensuring the rationality of the fast charging power switching, avoiding the problem of reducing the charging current and thus the charging speed of the electronic device if the fast charging power is switched for occasional interruptions, and maximizing the charging speed of the electronic device.
[0059] This embodiment will explain the detailed process of detecting interruption events. In one embodiment, as Figure 3 shown, the above method further includes:
[0060] S301, during the charging process of the electronic device, obtain the status flag bit of the adapter.
[0061] As a possible implementation manner, in this embodiment, when it is detected that the output voltage of the adapter is inconsistent with the preset voltage value, the status flag bit of the adapter can be obtained. Herein, the preset voltage value can be the standard output voltage of the adapter. For example, the preset voltage value can be 3.6V, or it can also be other voltage values. Exemplarily, in this embodiment, the inconsistency between the output voltage of the adapter and the preset voltage value can be that the output voltage of the adapter is greater than the preset voltage value, or it can also be that the output voltage of the adapter is less than the preset voltage value.
[0062] As an alternative implementation manner, the power management chip of the electronic device can be used to detect whether the output voltage of the adapter is inconsistent with the preset voltage. When it is detected that the output voltage of the adapter is inconsistent with the preset voltage, the interrupt handling function is triggered, and the status flag bit of the adapter in the register is obtained through the interrupt handling function. Exemplarily, the status flag bit of the adapter can be 1 or 0. If the status flag bit of the adapter is 1, it indicates that the adapter is connected to the electronic device. If the status flag bit of the adapter is 0, it indicates that the adapter is removed from the electronic device.
[0063] S302. When the status flag bit is the target value, if it is determined that the difference between the access time of the adapter and the removal time of the adapter is less than the preset threshold, it is determined that a disconnection event is detected; the target value is used to indicate that the adapter is connected to the electronic device.
[0064] In this embodiment, when the status flag bit of the adapter is the target value indicating that the adapter is connected to the electronic device, the access time when the adapter is connected to the electronic device and the removal time when the adapter was last removed from the electronic device can be determined. Then, the difference between the access time of the adapter and the last removal time of the adapter is obtained, and it is determined whether this difference is less than the preset threshold. If this difference is less than the preset threshold, it is determined that a disconnection event is detected. Exemplarily, the preset threshold can be 1.5s, or it can be 1s, etc. This embodiment does not limit this here. Taking the preset threshold of 1.5s as an example, if the difference between the access time when the adapter is connected to the electronic device this time and the removal time when the adapter was last removed from the electronic device is less than 1.5s, it is determined that a disconnection event is detected. If the difference between the access time when the adapter is connected to the electronic device this time and the removal time when the adapter was last removed from the electronic device is greater than 1.5s, it can be determined that the adapter is unplugged manually rather than a disconnection event.
[0065] In this embodiment, during the charging process of the electronic device, if it is detected that the output voltage of the adapter is inconsistent with the preset voltage, then by obtaining the status flag bit of the adapter, and when the status flag bit of the adapter is the target value indicating that the adapter is connected to the electronic device, if it is determined that the difference between the connection time and the removal time of the adapter is less than the preset threshold, it is determined that a disconnection event is detected. This determination method can ensure the accuracy of the detected disconnection event as much as possible and avoid the problem of inaccurate detected disconnection events.
[0066] In some scenarios, a disconnection information memory can be set in the electronic device. By storing the information of the disconnection event that occurs during the charging process of the electronic device in the disconnection information memory, the number of disconnection events that occur during the charging process of the electronic device can be counted. In one embodiment, as Figure 4 shown, the above method further includes:
[0067] S401, add the event content to the disconnection information memory and update the number of times the disconnection event occurs stored in the disconnection information memory.
[0068] In this embodiment, when a disconnection event is detected, at least one of the disconnection time, the disconnection reason, and the type of the adapter of the detected disconnection event can be determined as the event content of the detected disconnection event. As a possible implementation manner, the disconnection event detected in this embodiment may be the first disconnection event detected during the charging process of the electronic device, or it may also be the third or more disconnection events detected during the charging process of the electronic device.
[0069] Exemplarily, in this embodiment, when a disconnection event is detected, the disconnection reason for the disconnection event can be obtained from other processing modules, the system time of the electronic device can be determined as the disconnection time of the detected disconnection event, and the type of the adapter can be determined through communication interaction with the adapter, etc.
[0070] In this embodiment, the event content of the detected disconnection event can be added to the disconnection information memory, the event content of the detected disconnection event can be stored, and the number of times the disconnection event occurs is incremented by 1 to update the number of times the disconnection event occurs stored in the disconnection information memory, so as to obtain the total number of disconnection events that occur during the charging process of the electronic device. If no disconnection event has occurred before the disconnection event is detected, after the above operations, the number of times the disconnection event occurs stored in the disconnection information memory can be updated to 1; if a disconnection event has occurred before the disconnection event is detected, after the above operations, it can be incremented by 1 based on the number of times the disconnection event occurred before to obtain the new total number of disconnection events that occur during the charging process of the electronic device.
[0071] As an alternative implementation, before adding the event content of the detected intermittent event to the intermittent information memory, the event content of the intermittent event can be used as an element to determine whether the total number of elements stored in the intermittent information memory reaches the capacity of the intermittent information memory. If not, it means that the intermittent information memory is not full yet, and the event content of the detected intermittent event can be directly added to the intermittent information memory. If so, it means that the intermittent information memory is full, and the elements stored in the intermittent information memory can be moved forward as a whole by one position. The vacated position is filled with the intermittent content of the newly detected intermittent event, and the number of times the intermittent event occurs is incremented by 1.
[0072] In addition, it should be noted that during the charging process of the electronic device, if it is detected that the output voltage of the adapter is inconsistent with the preset voltage value, but the status flag of the adapter indicates that the adapter is unplugged from the electronic device, all the information stored in the intermittent information memory can be cleared.
[0073] S402. For each intermittent event in the intermittent information memory, obtain the count value where the difference between the intermittent time corresponding to the intermittent event and the intermittent times corresponding to other intermittent events is less than a preset threshold, and determine the count value as the number of intermittent events occurring within a preset duration adjacent to the intermittent time of the intermittent event.
[0074] In this embodiment, for each intermittent event in the intermittent information memory, the difference between the intermittent time corresponding to the intermittent event and the intermittent times corresponding to other intermittent events stored in the intermittent information memory can be obtained, and then it is determined whether the difference is less than the preset threshold. If it is less than the preset threshold, the count is incremented by 1 to obtain the number of intermittent events occurring within a preset duration adjacent to the intermittent time of the intermittent event. For example, the preset duration adjacent to the intermittent time of the detected intermittent event can be 60s. The electronic device can subtract the intermittent time of the first element stored in the intermittent information memory from the intermittent times of other elements respectively and check whether it is within 60s. If it is, then cnt + 1. Finally, the number cnt of the intermittent times of the first element and the intermittent times of other elements other than itself within 60s is obtained, and it is determined whether the number 1min_break_cnt of intermittent events occurring within one minute stored in the intermittent information memory is less than cnt. If it is less, then 1min_break_cnt is updated to cnt. The second element, the third element, …, the element_nums in the intermittent information memory are calculated in the above manner in turn, and finally the maximum value 1min_break_cnt of the intermittent events within 1min among these elements can be obtained.
[0075] It can be understood that in this embodiment, by adding the event content of the detected intermittent event to the intermittent information memory and updating the number of occurrences of the intermittent event stored in the intermittent information memory, the total number of intermittent events occurring during the charging process of the electronic device can be obtained; for each intermittent event in the intermittent information memory, by obtaining the count value of the difference between the intermittent time corresponding to this intermittent event and the intermittent times corresponding to other intermittent events being less than a preset threshold, the number of intermittent events occurring within a preset duration adjacent to the intermittent time of the detected intermittent event can be obtained. Therefore, in the scenario of obtaining the number of intermittent events occurring during the charging process of the electronic device as described above, the number of intermittent events occurring during the charging process of the electronic device can be obtained from the intermittent information memory.
[0076] In this embodiment, when an intermittent event is detected, the process of determining the event content of the detected intermittent event is relatively simple, so that the event content of the detected intermittent event can be quickly added to the intermittent information memory, ensuring the timeliness of storing the event content of the detected intermittent event. Thus, the number of occurrences of the intermittent event stored in the intermittent information memory can be updated in a timely manner. Further, for each intermittent event in the intermittent information memory, by obtaining the count value of the difference between the intermittent time corresponding to this intermittent event and the intermittent times corresponding to other intermittent events being less than a preset threshold, the number of intermittent events occurring within a preset duration adjacent to the intermittent time of the detected intermittent event can be accurately determined, ensuring the accuracy of the number of intermittent events occurring within a preset duration adjacent to the intermittent time of the detected intermittent event.
[0077] In one embodiment, as Figure 5 shown, a charging control method is provided. Taking the adapter in Figure 1 as an example for illustration, the method includes the following steps:
[0078] S501, during the charging process of the electronic device, in response to an intermittent event, obtain the number of intermittent events occurring during the charging process of the electronic device.
[0079] Among them, an intermittent event refers to an intermittent charging interruption phenomenon that occurs in the electronic device during fast charging due to reasons such as unstable connection between the adapter and the electronic device, damaged charging cable, power voltage fluctuation, etc., that is, the charging is not continuously and stably carried out, but will stop charging from time to time and then start charging again. For example, when a mobile phone is fast charging, the charging icon may sometimes show that it is charging and sometimes show that the charging has stopped, and the increase in battery power is not a smooth rise but a jumpy one. This is the "intermittent" phenomenon in fast charging.
[0080] It should be noted that the intermittent event in this embodiment can be detected by the adapter itself, or can be detected by the electronic device and sent to the adapter. Exemplarily, the adapter can determine whether an intermittent event is detected based on the time difference between the access time when the electronic device accesses the adapter and the removal time when the electronic device is removed from the adapter. For example, if the above time difference is less than the preset time threshold, it is determined that an intermittent event is detected. If the above time difference is greater than the preset time threshold, it indicates that it may be a manual plugging and unplugging, not an intermittent event. Or, a current monitoring point can be set in the power supply circuit of the adapter, and the power supply current data is collected in real time through a high-precision current sensor. When the current has a short interruption or abnormal fluctuation, it is determined that an intermittent event is detected.
[0081] Exemplarily, the number of intermittent occurrences of the intermittent event in this embodiment can be the number of intermittent events that occur within a period of time adjacent to the intermittent time corresponding to the detected intermittent event, such as within one minute, or can also be the total number of intermittent events that occur during the charging process of the electronic device.
[0082] As a possible implementation, a counter for counting intermittent events can be set in the adapter, and the number of intermittent events that occur during the charging process of the electronic device can be obtained from this counter. Exemplarily, the number of intermittent events that occur during the charging process of the electronic device may be 0 times, may also be 1 time, may also be 5 times, and so on. It can be understood that if the electronic device has 5 intermittent events during the charging process, it means that the electronic device has frequent intermittent events during the charging process.
[0083] S502, when the type of the adapter and the number of intermittent occurrences meet the corresponding switching conditions, switch from the first fast charging power to the second fast charging power; the first fast charging power is greater than the second fast charging power.
[0084] Exemplarily, the type of the adapter may be a normal adapter or an abnormal adapter. It should be noted that the abnormal adapter in the embodiments of this application refers to an adapter with too large impedance that requires current reduction processing after intermittent. As a possible implementation, the product identification code of the adapter, such as a Type-C adapter, can be determined, and then it can be determined whether the adapter is an abnormal adapter from the pre-established abnormal adapter product identification code table.
[0085] Among them, the electronic device can support multiple different fast charging protocols, and the charging powers of multiple different fast charging protocols are all different. If it is determined that the current fast charging power is no longer suitable for fast charging the electronic device, the fast charging power can be switched to a fast charging power lower than the current fast charging power. For example, the electronic device supports four fast charging protocols A, B, C, and D, and the average charging powers of the four fast charging protocols for a predetermined charging stage are sorted as D > A > C > B. The current fast charging power is the power corresponding to protocol D. If it is determined that the power corresponding to fast charging protocol D is no longer suitable for fast charging the electronic device, the fast charging power can be switched to the power corresponding to fast charging protocol A.
[0086] In this embodiment, the corresponding switching condition can be determined according to the type of the adapter, and then it is determined whether to switch the fast charging power by judging whether the number of interruptions of the interruption event occurring during the charging process meets the corresponding switching condition. Further, when it is determined that the type of the adapter and the number of interruptions of the interruption event occurring during the charging process meet the corresponding switching condition, the fast charging power can be switched from the first fast charging power to the second fast charging power smaller than the first fast charging power. For example, if the type of the adapter is an abnormal adapter, the total number of interruption events occurring during the charging process of the electronic device can be used to determine whether the switching condition is met; if the type of the adapter is a non-abnormal adapter, the number of interruption events occurring within a preset time period adjacent to the interruption time of the detected interruption event can be used to determine whether the switching condition is met.
[0087] In the above charging control method, during the charging process of the electronic device, the adapter responds to the interruption event and obtains the number of interruptions of the interruption event occurring during the charging process of the electronic device. When the type of the adapter for charging the electronic device and the number of interruptions meet the corresponding switching condition, it can be switched from the first fast charging power to the second fast charging power, where the first fast charging power is greater than the second fast charging power. Compared with switching to other low fast charging powers for fast charging when the interruption event is detected, by switching the fast charging power of the electronic device when the type of the adapter and the number of interruptions meet the corresponding switching condition, the problem of reducing the charging speed of the electronic device by reducing the current through switching the fast charging power for occasional interruptions occurring during the charging process is avoided, and the charging speed of the electronic device is guaranteed to the greatest extent.
[0088] In this embodiment, the detailed process of determining whether the type of the adapter and the number of interruptions of the interruption event occurring during the charging process meet the corresponding switching condition will be explained. In one embodiment, the above method further includes:
[0089] Step C, if the type of the adapter is the first type, determine whether the switching condition is met according to the first number of interruptions and the charging current corresponding to the first fast charging power; the first number of interruptions is the total number of interruption events occurring during the charging process of the electronic device.
[0090] In this embodiment, the number of interruptions of the intermittent event during the charging process of the electronic device includes a first number of interruptions and a second number of interruptions. Among them, the first number of interruptions is the total number of intermittent events during the charging process of the electronic device, and the second number of interruptions is the number of intermittent events occurring within a preset duration adjacent to the interruption time of the detected intermittent event. For example, the second number of interruptions can be the number of intermittent events occurring within the previous minute of the interruption time of the detected intermittent event.
[0091] In this embodiment, if the type of the adapter is the first type, for example, the first type of adapter can be the above abnormal adapter, an adapter with too large impedance that requires current reduction processing after interruption, then the product value of the above first number of interruptions and the preset current value can be obtained to get the current adjustment value. The preset current value can be 1A, 1.5A, 2A, etc. Then, the current difference between the charging current corresponding to the first fast charging power and the current adjustment value is obtained. For example, assume that the preset current value is 1A, the charging current corresponding to the first fast charging power is max_power, and the total number of intermittent events during the charging process of the electronic device is total_break_cnt. Then, the current difference can be determined according to the formula max_power - total_break_cnt * 1A, that is, subtract 1A each time based on the charging current corresponding to the first fast charging power, and the obtained current difference is determined as the current value for supplying power to the electronic device. Further, if the current difference is less than the current value corresponding to the second fast charging power, that is, the current value for supplying power to the electronic device is less than the current value corresponding to the second fast charging power, it is determined that the switching condition is satisfied. For example, assume that the charging current corresponding to the first fast charging power is 6A and the charging current corresponding to the second fast charging power is 4A. If the total number of intermittent events during the charging process of the electronic device is 3 when the current intermittent event is detected, the current difference is 3A, which is less than the current value corresponding to the second fast charging power, then it is determined that the switching condition is satisfied; if the total number of intermittent events during the charging process of the electronic device is 1 when the current intermittent event is detected, the current difference is 5A, which is greater than the current value corresponding to the second fast charging power, then it can be determined that the switching condition is not satisfied.
[0092] Step D, if the type of the adapter is the second type, then determine whether the switching condition is satisfied according to the second number of interruptions; the second type is different from the first type; the second number of interruptions is the number of intermittent events occurring within a preset duration adjacent to the interruption time of the detected intermittent event.
[0093] In this embodiment, if the type of the adapter is the second type, for example, the adapter of the second type can be a non-abnormal adapter, then it is possible to determine whether the switching condition is satisfied according to the above-mentioned second interruption count. As a possible implementation, if the above-mentioned second interruption count is greater than a preset count threshold, it can be determined that the switching condition is satisfied. It can be understood that the second interruption count is the number of interruption events that occur within a preset duration adjacent to the interruption time of the detected interruption event. If the second interruption count is greater than the preset count threshold, it indicates that the number of interruption events occurring within a short period of time is excessive. At this time, the first fast charging power is no longer suitable, and it is necessary to switch to other fast charging power for power supply. For example, assume that the preset count threshold is 5 times, and the second interruption count is the number of interruption events that occur within one minute adjacent to the interruption time of the detected interruption event. If the second interruption count is greater than 5 times, it indicates that the number of interruption events occurring within the adjacent one minute is excessive, and it is necessary to switch the fast charging power. Then it can be determined that the switching condition is satisfied at this time, and the fast charging power can be switched from the first fast charging power to the second fast charging power; if the second interruption count is less than 5 times, the existing fast charging power supply can be maintained, that is, the first fast charging power can continue to be used for power supply.
[0094] In this embodiment, when the type of the adapter is the first type, it is possible to determine whether the switching condition is satisfied according to the total number of interruption events that occur during the charging process of the electronic device and the charging current corresponding to the first fast charging power. When the type of the adapter is the second type, it is possible to determine whether the switching condition is satisfied according to the number of interruption events that occur within a preset duration adjacent to the interruption time of the detected interruption event. For different types of adapters, different switching conditions can be determined, and then it is determined whether the corresponding switching condition is satisfied according to the number of interruption events that occur during the charging process of the electronic device, ensuring the rationality of the fast charging power switching, avoiding the problem of reducing the charging current of the electronic device and thus reducing the charging speed if the fast charging power is switched for occasional interruptions, and maximizing the charging speed of the electronic device.
[0095] In one embodiment, as Figure 6 shown, a charging control method is provided. Taking the adapter in Figure 1 as an example, the method includes the following steps:
[0096] S601, receive a switching instruction; the switching instruction is sent by the electronic device during the charging process in response to the detected interruption event, after obtaining the number of interruption events that occur during the charging process of the electronic device and determining that the type of the adapter for charging the electronic device and the number of interruption events meet the corresponding switching conditions.
[0097] Among them, an intermittent event refers to an intermittent charging interruption phenomenon that occurs in an electronic device during fast charging due to reasons such as unstable connection between the adapter and the electronic device, damaged charging cable, power voltage fluctuation, etc. That is, the charging is not continuously and stably carried out, but will stop charging from time to time and then start charging again. For example, when a mobile phone is fast charging, the charging icon may show that it is charging for a while and then show that the charging has stopped for a while. The increase in battery power is not a smooth rise but a jumpy one. This is the "intermittent" phenomenon in fast charging.
[0098] Exemplarily, the electronic device can determine whether an intermittent event is detected through a power management chip. For example, it can determine whether an intermittent event is detected through a flag bit of the power management chip. If the value of the flag bit of the power management chip is 1, it can be determined that an intermittent event is detected. If the value of the flag bit of the power management chip is 0, it can be determined that no intermittent event is detected. Or, the electronic device can determine whether an intermittent event is detected based on the time difference between the access time when the adapter is connected to the electronic device and the removal time when the adapter is removed from the electronic device. For example, if the above time difference is less than a preset time threshold, it is determined that an intermittent event is detected. If the above time difference is greater than the preset time threshold, it may indicate that it is a manual plugging and unplugging, not an intermittent event. Or, a current monitoring point can be set in the charging circuit, and the charging current data can be collected in real time through a high-precision current sensor. When the current has a short interruption or abnormal fluctuation, it is determined that an intermittent event is detected.
[0099] Exemplarily, in this embodiment, the number of intermittent occurrences of an intermittent event can be the number of intermittent events that occur within a period of time adjacent to the intermittent time corresponding to the detected intermittent event, such as within one minute, or it can also be the total number of intermittent events that occur during the charging process of the electronic device.
[0100] As a possible implementation, a counter for counting intermittent events can be set in the electronic device, and the number of intermittent events that occur during the charging process of the electronic device can be obtained from this counter. Exemplarily, the number of intermittent events that occur during the charging process of the electronic device may be 0 times, 1 time, 5 times, etc. It can be understood that if the electronic device has 5 intermittent events during the charging process, it means that the electronic device has frequent intermittent events during the charging process.
[0101] Exemplarily, the type of the adapter may be a normal adapter or an abnormal adapter. It should be noted that the abnormal adapter in the embodiments of the present application refers to an adapter with too large impedance that requires current reduction processing after intermittence. As a possible implementation, after the electronic device establishes a communication connection with the adapter, the electronic device can obtain the product identification code of the adapter, such as a Type-C adapter, through interaction with the adapter, and then can determine whether the adapter is an abnormal adapter from a pre-established abnormal adapter product identification code table.
[0102] Among them, the electronic device can support multiple different fast charging protocols, and the charging powers of the multiple different fast charging protocols are all different. If it is determined that the current fast charging power is no longer suitable for fast charging the electronic device, the fast charging power can be switched to a fast charging power lower than the current fast charging power. For example, the electronic device supports four fast charging protocols, A, B, C, and D. The sorting of the average charging powers of the four fast charging protocols for a predetermined charging stage is D > A > C > B. The current fast charging power is the power corresponding to protocol D. If it is determined that the power corresponding to fast charging protocol D is no longer suitable for fast charging the electronic device, the fast charging power can be switched to the power corresponding to fast charging protocol A.
[0103] In this embodiment, the corresponding switching condition can be determined according to the type of the adapter, and then it can be determined whether to switch the fast charging power by judging whether the number of intermittence times of the intermittence event occurring during the charging process meets the corresponding switching condition. Further, when it is determined that the type of the adapter and the number of intermittence times of the intermittence event occurring during the charging process meet the corresponding switching condition, the electronic device can switch the fast charging power from the first fast charging power to the second fast charging power that is less than the first fast charging power. For example, if the type of the adapter is an abnormal adapter, the total number of intermittence events occurring during the charging process of the electronic device can be used to determine whether the switching condition is met; if the type of the adapter is a non-abnormal adapter, the number of intermittence events occurring within a preset duration adjacent to the intermittence time of the detected intermittence event can be used to determine whether the switching condition is met.
[0104] Further, when it is determined that the type of the adapter charging the electronic device and the number of intermittence times meet the corresponding switching condition, the electronic device can generate a switching instruction for switching the fast charging power and send the switching instruction to the adapter.
[0105] S602, in response to the switching instruction, switch from the first fast charging power to the second fast charging power; the first fast charging power is greater than the second fast charging power.
[0106] In this embodiment, the adapter can switch from the first fast charging power to the second fast charging power in response to the received switching instruction, and supply power to the electronic device using the fast charging power with a lower fast charging power.
[0107] In the above charging control method, during the charging process of the electronic device, the electronic device can respond to the detected intermittent event, obtain the number of intermittent events that occur during the charging process of the electronic device, and when the type of the adapter for charging the electronic device and the number of intermittent events meet the corresponding switching conditions, send a switching instruction for the fast charging power to the adapter, so that the adapter can respond to the switching instruction and switch from the first fast charging power to the second fast charging power, where the first fast charging power is greater than the second fast charging power. Compared with switching to other low fast charging powers for fast charging when detecting an intermittent event, by switching the fast charging power of the electronic device when the type of the adapter and the number of intermittent events meet the corresponding switching conditions, it avoids the problem of reducing the charging speed of the electronic device due to the occasional intermittence during the charging process and reducing the charging current by switching the fast charging power, and maximally ensures the charging speed of the electronic device.
[0108] For the convenience of understanding by those skilled in the art, as Figure 7 shown, the following will introduce the charging control method provided by the present application in detail in combination with a complete embodiment:
[0109] S1. During the charging process of the electronic device, if it is detected that the output voltage of the adapter is inconsistent with the preset voltage value, obtain the status flag bit of the adapter.
[0110] S2. In the case where the status flag bit of the adapter is 1, it is determined that the adapter is connected to the electronic device; in the case where the status flag bit of the adapter is 0, it is determined that the adapter is removed from the electronic device.
[0111] S3. In the case where it is determined that the adapter is removed from the electronic device, determine the removal time when the adapter is pulled out of the electronic device, and determine whether the number of intermittent events occurring within 1 minute is greater than 0. If it is greater than 0, start the intermittent logging information thread scheduling, where the intermittent logging information thread will be scheduled with a delay of 2 s.
[0112] S4. After 2 s, if the intermittent logging information thread has not been cancelled, package the adapter type + intermittent reason + electronic device name + the number of intermittent events occurring within 1 minute into logging information, and upload the logging information to the server.
[0113] S5. In the case where it is determined that the adapter is connected to the electronic device, determine the connection time when the adapter is connected to the electronic device, and obtain the difference between the connection time of the adapter and the removal time when the adapter was last removed from the electronic device.
[0114] S6. Determine whether the difference between the connection time of the adapter and the removal time when it was last removed from the electronic device is less than the preset threshold.
[0115] S7, if the access time is greater than the removal time, it is determined that the time exceeds the standard and it is a manual plugging and unplugging. At this time, the relevant variables stored in the intermittent information memory are cleared, including clearing the total number of intermittent times total_break_cnt of the intermittent event, the maximum number of intermittent times within one minute 1min_break_cnt, the event content of all stored intermittent events, and the number of elements element_nums recorded in the intermittent information memory.
[0116] S7, if the access time is less than the removal time, it is determined that an intermittent event is detected, and record the event content A of the detected intermittent event, including the current system time of the intermittent break_jiffies, the reason for the interruption Reason, the adapter type Adapter_type, etc.
[0117] S8, determine whether the number of elements element_nums recorded in the intermittent information memory is equal to 10.
[0118] S9, if it is not equal to 10, it means that the elements recorded in the intermittent information memory have not been fully recorded. At this time, it is necessary to store the content A as an element at the starting address of the remaining free space in the intermittent information memory, and increment the recorded value of element_nums by 1.
[0119] S10, if it is equal to 10, it means that the elements recorded in the intermittent information memory are full. At this time, it is necessary to move the elements in the intermittent information memory one position forward as a whole, fill the vacated position with the newly added content A, and element_nums remains 10.
[0120] S11, increment the total number of interruptions by 1: total_break_cnt += 1.
[0121] S12, for each intermittent event in the intermittent information memory, obtain the count value cnt of the difference between the intermittent time corresponding to the intermittent event and the intermittent times corresponding to other intermittent events being less than a preset threshold, and determine whether 1min_break_cnt is less than cnt. If it is less, update 1min_break_cnt to cnt.
[0122] S13, according to the product identification code of the adapter that charges the electronic device, determine whether the adapter is an adapter in the abnormal adapter product identification table. An abnormal adapter refers to an adapter with too large impedance that requires current reduction processing after intermittent interruption.
[0123] S14, determine whether it is an abnormal adapter.
[0124] S15. If it is an abnormal adapter, set the expected current expect applied to the adapter to: the maximum charging current max_power supported by the current fast charging power - total_break_cnt * 1A.
[0125] S16. Determine whether the applied current expect is greater than the maximum current supported by other fast charging powers.
[0126] S17. If the applied current expect is greater than the maximum current supported by other fast charging powers, charge at the existing fast charging power and cancel the upload of intermittent buried point information.
[0127] S18. If it is a non - abnormal adapter, determine whether 1min_break_cnt is greater than 5.
[0128] S19. If 1min_break_cnt is greater than 5, it indicates that the number of interruptions within a short time is too many. At this time, the fast charging power is no longer suitable, and other fast charging powers need to be switched for charging; if 1min_break_cnt is less than 5, charge at the existing fast charging power.
[0129] It should be noted that the above - mentioned charging control method reasonably selects the fast charging power by counting the short - time intermittent times and the total intermittent times. For the abnormal adapter obtained through interaction, the current is reduced by 1A successively according to the total intermittent times until it is less than the power of other fast charging powers, and then other fast charging powers are switched; secondly, for non - abnormal adapters, when the short - time intermittent times reach a certain threshold, other fast charging powers are switched to ensure the most reasonable charging speed. Finally, through the buried points of counting the total intermittent times and the short - time intermittent times, this solution can discover the problem of frequent interruptions caused by real device abnormalities, which is convenient for early warning and bad machine analysis.
[0130] It should be understood that although the steps in the flowcharts involved in the above - mentioned embodiments are shown in sequence according to the arrows, these steps do not necessarily need to be executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, 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 may include multiple steps or multiple stages. These steps or stages do not necessarily need to be executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0131] Based on the same inventive concept, an embodiment of the present application further provides a charging control device for implementing the charging control method involved above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the charging control device provided below can refer to the limitations on the charging control method in the foregoing, and will not be repeated here.
[0132] In one embodiment, as Figure 8 shown, a charging control device is provided, which is applied to an electronic device and includes: a first acquisition module and a switching module, where:
[0133] The first acquisition module is configured to, during the charging process of the electronic device, in response to a detected intermittent event, acquire the number of intermittent times of the intermittent event occurring during the charging process of the electronic device.
[0134] The switching module is configured to switch from the first fast charging power to the second fast charging power when the type of the adapter for charging the electronic device and the number of intermittent times meet the corresponding switching conditions; the first fast charging power is greater than the second fast charging power.
[0135] The charging control device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be repeated here.
[0136] Based on the above embodiment, optionally, the above number of intermittent times includes the first number of intermittent times or the second number of intermittent times; the above device further includes: a first determination module and a second determination module, where:
[0137] The first determination module is configured to, if the type of the adapter is the first type, determine whether the switching condition is met according to the first number of intermittent times and the charging current corresponding to the first fast charging power; the first number of intermittent times is the total number of intermittent events occurring during the charging process of the electronic device.
[0138] The second determination module is configured to, if the type of the adapter is the second type, determine whether the switching condition is met according to the second number of intermittent times; the second type is different from the first type; the second number of intermittent times is the number of intermittent events occurring within a preset duration adjacent to the intermittent time of the detected intermittent event.
[0139] The charging control device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be repeated here.
[0140] Based on the above embodiment, optionally, the above first determination module includes: a first acquisition unit and a first determination unit, where:
[0141] A first acquisition unit, configured to acquire a current difference between a charging current and a current adjustment value; the current adjustment value is determined according to a first number of discontinuous times.
[0142] A first determination unit, configured to determine that a switching condition is satisfied if the current difference is less than a current value corresponding to a second fast charging power.
[0143] The charging control device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0144] Based on the above embodiment, optionally, the above second determination module includes: a second determination unit, where:
[0145] The second determination unit is configured to determine that the switching condition is satisfied if the second number of discontinuous times is greater than a preset number threshold.
[0146] The charging control device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0147] Based on the above embodiment, optionally, the above device further includes: a second acquisition module and a third determination module, where:
[0148] The second acquisition module is configured to acquire a status flag bit of an adapter during the charging process of the electronic device.
[0149] The third determination module is configured to determine that a discontinuous event is detected if, when the status flag bit is a target value, a difference between an access time and a removal time of the adapter is less than a preset threshold; the target value is used to represent that the adapter is connected to the electronic device.
[0150] The charging control device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0151] Based on the above embodiment, optionally, the above device further includes: a fourth determination module, where:
[0152] The fourth determination module is configured to determine an event content of the detected discontinuous event; the event content includes at least one of a discontinuous time, a discontinuous reason, and a type of the adapter of the detected discontinuous event.
[0153] The charging control device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0154] Based on the above embodiment, optionally, the above device further includes: an addition module and a third acquisition module, where:
[0155] An adding module, configured to add event content to the intermittent information memory and update the number of times of intermittent events stored in the intermittent information memory.
[0156] A third obtaining module, configured to obtain, for each intermittent event in the intermittent information memory, a count value that the difference between the intermittent time corresponding to the intermittent event and the intermittent times corresponding to other intermittent events is less than a preset threshold, and determine the count value as the number of times of intermittent events occurring within a preset duration adjacent to the intermittent time of the intermittent event.
[0157] The charging control device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0158] In one embodiment, as Figure 9 shown, a charging control device is provided, which is applied to an adapter and includes: an obtaining module and a switching module, where:
[0159] The obtaining module is configured to obtain the number of times of intermittent events occurring during the charging process of the electronic device in response to an intermittent event during the charging process of the electronic device.
[0160] The switching module is configured to switch from the first fast charging power to the second fast charging power when the type of the adapter and the number of times of intermittent events meet the corresponding switching conditions; the first fast charging power is greater than the second fast charging power.
[0161] The charging control device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0162] Based on the above embodiment, optionally, the number of times of intermittent events includes the first number of times of intermittent events or the second number of times of intermittent events; the device further includes: a first determination module and a second determination module, where:
[0163] The first determination module is configured to determine whether the switching condition is met according to the first number of times of intermittent events and the charging current corresponding to the first fast charging power if the type of the adapter is the first type; the first number of times of intermittent events is the total number of times of intermittent events occurring during the charging process of the electronic device.
[0164] The second determination module is configured to determine whether the switching condition is met according to the second number of times of intermittent events if the type of the adapter is the second type; the second type is different from the first type; the second number of times of intermittent events is the number of times of intermittent events occurring within a preset duration adjacent to the intermittent time of the detected intermittent event.
[0165] The charging control device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0166] In one embodiment, asFigure 10 As shown, a charging control device is provided, which is applied to an adapter and includes: a receiving module and a switching module, where:
[0167] The receiving module is configured to receive a switching instruction; the switching instruction is sent by the electronic device during the charging process in response to a detected intermittent event, obtaining the number of intermittent events that occur during the charging process of the electronic device, and when it is determined that the type and the number of intermittent events of the adapter for charging the electronic device meet the corresponding switching conditions.
[0168] The switching module is configured to switch from a first fast charging power to a second fast charging power in response to the switching instruction; the first fast charging power is greater than the second fast charging power.
[0169] The charging control device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0170] Each module in the above charging control device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so as to facilitate the processor to call and execute the operations corresponding to the above respective modules.
[0171] In one embodiment, a computer device is provided. The computer device may be an electronic device, and its internal structure diagram may be as Figure 11As shown in the figure. The computer 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 computer device is used to provide computing and control capabilities. The memory of the computer 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 computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals 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, it implements a charging control method. The display unit of the computer 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. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0172] Those skilled in the art can understand that Figure 11 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0173] 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, cause the processors to execute the steps of the charging control method.
[0174] The embodiment of the present application also provides a computer program product containing instructions, which when running on a computer, causes the computer to execute the charging control method.
[0175] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. 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 methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., and are not limited thereto.
[0176] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, 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, it should be considered as the scope described in this specification.
[0177] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A charging control method, characterized in that: Applied to electronic equipment, the method comprises: In response to a detected intermittent event during the charging process of the electronic device, obtaining the number of intermittent events occurring during the charging process of the electronic device; When the type of the adapter for charging the electronic device and the number of intermittent times meet the corresponding switching conditions, switch from the first fast charging power to the second fast charging power; the first fast charging power is greater than the second fast charging power.
2. The method according to claim 1, characterized in that: The number of intermittent times includes a first number of intermittent times or a second number of intermittent times; the method further includes: If the type of the adapter is the first type, determining whether the switching condition is met according to the first intermittent number and the charging current corresponding to the first fast charging power; the first intermittent number is the total number of intermittent events that occur during the charging process of the electronic device; If the type of the adapter is the second type, determine whether the switching condition is met based on the second intermittent number; the second type is different from the first type; the second intermittent number is the number of intermittent events occurring within a preset time length adjacent to the intermittent time of the detected intermittent event.
3. The method according to claim 2, characterized in that The determining whether the switching condition is met according to the first intermittent number and the charging current corresponding to the first fast charging power includes: Obtaining a current difference between the charging current and a current adjustment value; the current adjustment value is determined according to the first discontinuous number of times; If the current difference is less than the current value corresponding to the second fast charging power, it is determined that the switching condition is met.
4. The method according to claim 2, characterized in that: The determining, according to the second discontinuous number, whether the switching condition is met includes: If the second discontinuous number is greater than a preset number threshold, it is determined that the switching condition is met.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: During the charging process of the electronic device, obtaining a status flag of the adapter; When the status flag is a target value, if the difference between the adapter connection time and the adapter removal time is determined to be less than a preset threshold, it is determined that an intermittent event is detected; the target value is used to characterize that the adapter is connected to the electronic device.
6. The method according to claim 5, characterized in that The method further comprises: Determine the event content of the detected intermittent event; the event content includes at least one of the intermittent time, the intermittent cause and the type of the adapter of the detected intermittent event.
7. The method according to claim 6, characterized in that The method further comprises: Adding the event content to the intermittent information storage device, and updating the number of occurrences of the intermittent event stored in the intermittent information storage device; For each intermittent event in the intermittent information storage device, obtain a count value whose difference between the intermittent time corresponding to the intermittent event and the intermittent time corresponding to other intermittent events is less than a preset threshold, and determine the count value as the number of times the intermittent event occurs within a preset time length adjacent to the intermittent time of the intermittent event.
8. A charging control method, characterized in that: Applied to an adapter, the method comprises: In response to an intermittent event during the charging process of the electronic device, obtaining the number of intermittent events occurring during the charging process of the electronic device; When the type of the adapter and the number of intermittent times meet corresponding switching conditions, switch from the first fast charging power to the second fast charging power; the first fast charging power is greater than the second fast charging power.
9. The method according to claim 8, characterized in that The number of intermittent times includes a first number of intermittent times or a second number of intermittent times; the method further includes: If the type of the adapter is the first type, determining whether the switching condition is met according to the first intermittent number and the charging current corresponding to the first fast charging power; the first intermittent number is the total number of intermittent events that occur during the charging process of the electronic device; If the type of the adapter is the second type, determine whether the switching condition is met based on the second intermittent number; the second type is different from the first type; the second intermittent number is the number of intermittent events occurring within a preset time length adjacent to the intermittent time of the detected intermittent event.
10. A charging control method, characterized in that: Applied to an adapter, the method comprises: Receive a switching instruction; the switching instruction is sent when the type of the adapter charging the electronic device and the number of intermittent events that occur during the charging process of the electronic device are determined to meet the corresponding switching conditions in response to the intermittent event detected by the electronic device during the charging process; In response to the switching instruction, switch from a first fast charging power to a second fast charging power; the first fast charging power is greater than the second fast charging power.
11. A charging control device, characterized in that: Applied to electronic equipment, the device comprises: A first acquisition module is used to acquire the number of intermittent events occurring during the charging process of the electronic device in response to the detected intermittent event; A switching module is used to switch from a first fast charging power to a second fast charging power when the type of the adapter for charging the electronic device and the number of intermittent times meet corresponding switching conditions; the first fast charging power is greater than the second fast charging power.
12. A charging control device, characterized in that: Applied to an adapter, the device comprises: An acquisition module, used for, in response to an intermittent event, acquiring the number of intermittent events occurring during the charging process of the electronic device; A switching module is used to switch from a first fast charging power to a second fast charging power when the type of the adapter and the number of intermittent times meet corresponding switching conditions; the first fast charging power is greater than the second fast charging power.
13. A charging control device, characterized in that: Applied to an adapter, the device comprises: A receiving module, configured to receive a switching instruction; the switching instruction is sent when the type of the adapter charging the electronic device and the number of intermittent events that occur during the charging process of the electronic device are determined to meet a corresponding switching condition in response to a detected intermittent event during the charging process of the electronic device, and the intermittent event times are obtained; A switching module is used to switch from a first fast charging power to a second fast charging power in response to the switching instruction; the first fast charging power is greater than the second fast charging power.
14. An electronic 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 execute the steps of the charging control method according to any one of claims 1 to 7.
15. An adapter, comprising a memory and a processor, wherein a computer program is stored in the memory, characterized in that: 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 8 to 10.
16. 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 10 are implemented.
17. A computer program product comprising a computer program, 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 10 are implemented.