A power detection method and device, electronic equipment and storage medium
By referencing the battery's actual charge level at the previous moment during charge detection, and determining the battery's actual charge level based on the relationship between the detected charge level and the actual charge level at the current moment, the problem of inaccurate charge detection is solved, achieving higher detection accuracy.
Patent Information
- Application Number
- CN202210486130.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2042-05-06
AI Technical Summary
Existing power detection methods, which calculate power based on the collected battery voltage using a fuel gauge, suffer from insufficient calculation accuracy, leading to inaccurate results.
By obtaining the detected battery charge at time k+1 and determining the actual charge at time k+1 based on the relationship between the actual charge at time k and the actual charge at time k, the accuracy is improved by referencing the actual charge at time k.
This improves the accuracy of power detection results and ensures the precision of power detection.
Smart Images

Figure CN114814617B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of electrical charge detection technology, and in particular relates to an electrical charge detection method, device, electronic device and storage medium. Background Technology
[0002] Currently, for electronic devices equipped with batteries, the power detection method is usually to calculate the battery power based on the collected battery voltage using a fuel gauge. However, due to the limited calculation accuracy of the fuel gauge, the calculation results are prone to inaccuracy. Summary of the Invention
[0003] In view of this, embodiments of this application provide a power detection method, apparatus, electronic device, and storage medium to solve the problem that existing methods for calculating battery power based on the collected battery voltage using a fuel gauge are prone to inaccurate calculation results due to the limited calculation accuracy of the fuel gauge.
[0004] The first aspect of this application provides a power detection method, including:
[0005] Obtain the battery level at time k+1, where k is any positive integer;
[0006] The actual charge of the battery at time k+1 is determined based on the relationship between the detected charge at time k+1 and the actual charge at time k.
[0007] A second aspect of this application provides a power detection device, comprising:
[0008] The power acquisition unit is used to acquire the detected power of the battery at time k+1, where k is any positive integer;
[0009] The power determination unit is used to determine the actual power of the battery at time k+1 based on the relationship between the detected power at time k+1 and the actual power at time k.
[0010] A third aspect of this application provides an electronic device, including a battery, a power module, a voltage acquisition module, a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the power detection method as described in the first aspect of this application.
[0011] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the power detection method as described in the first aspect of this application.
[0012] The power detection method provided in the first aspect of this application obtains the detected power of the battery at time k+1 and determines the actual power of the battery at time k+1 based on the relationship between the detected power of the battery at time k+1 and the actual power at time k. Since the actual power of the battery at time k+1 is referenced when determining the actual power of the battery, the accuracy of the power detection result can be effectively improved compared with the method of calculating the power of the battery based on the collected battery voltage.
[0013] It is understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a schematic flowchart of the first power detection method provided in the embodiments of this application;
[0016] Figure 2 This is a schematic diagram of the second type of power detection method provided in the embodiments of this application;
[0017] Figure 3 This is a schematic diagram of the third power detection method provided in the embodiments of this application;
[0018] Figure 4 This is a schematic diagram of the fourth process of the power detection method provided in the embodiments of this application;
[0019] Figure 5 This is a schematic diagram of the fifth type of power detection method provided in the embodiments of this application;
[0020] Figure 6 This is a schematic diagram of the sixth type of power detection method provided in the embodiments of this application;
[0021] Figure 7 This application embodiment provides the relationship between the detected battery charge and the actual battery charge at time k+1 when the battery is in a charging state;
[0022] Figure 8 This is a schematic diagram of the seventh type of power detection method provided in the embodiments of this application;
[0023] Figure 9This is a schematic diagram of the eighth power detection method provided in the embodiments of this application;
[0024] Figure 10 This is a schematic diagram of the ninth method for detecting power consumption provided in the embodiments of this application;
[0025] Figure 11 This application provides an embodiment of the relationship between the detected battery charge and the actual battery charge at time k+1 when the battery is in a discharging state.
[0026] Figure 12 This is a schematic diagram of the tenth method for detecting power consumption provided in the embodiments of this application;
[0027] Figure 13 This is a schematic diagram of the eleventh step of the power detection method provided in the embodiments of this application;
[0028] Figure 14 This is a schematic diagram of the twelfth type of power detection method provided in the embodiments of this application;
[0029] Figure 15 This is the relationship between the charge / discharge state of the battery at time k+1, the third charge difference, and the actual charge provided in the embodiments of this application;
[0030] Figure 16 This is a schematic diagram of the power detection device provided in the embodiments of this application;
[0031] Figure 17 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Specific implementation methods
[0032] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0033] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0034] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0035] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0036] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0037] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0038] The power detection method provided in this application embodiment can be executed by the processor of an electronic device when running a computer program with corresponding functions. By acquiring the detected power of the battery at time k+1, and determining the actual power of the battery at time k+1 based on the relationship between the detected power of the battery at time k+1 and the actual power at time k, the method can effectively improve the accuracy of the power detection results compared to the method of calculating the power of the battery based on the collected battery voltage.
[0039] In application, the power detection method can be applied to any electronic device equipped with a battery and capable of detecting the battery's power level, such as wireless headphones, charging cases, power banks, mobile phones, tablets, laptops, netbooks, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, electronic clocks, and smart wearable devices. Wireless headphones can be true wireless stereo (TWS) headphones, single-ear wireless headphones, neckband wireless headphones, or over-ear wireless headphones. Charging cases can be for true wireless stereo headphones, single-ear wireless headphones, smart glasses, etc. Smart wearable devices can be smart glasses, smart rings, smart bracelets, smart neckbands, smart ankle bracelets, etc. This application does not limit the specific type of electronic device. The battery can be a rechargeable battery with both charging and discharging functions, or a non-rechargeable battery with only discharging functions.
[0040] like Figure 1 As shown, the power detection method provided in this application embodiment includes the following steps S101 and S102:
[0041] Step S101: Obtain the detected battery charge at time k+1, and proceed to step S102.
[0042] In this application, k is any positive integer, and the (k+1)th time can be any time within which the battery level of the electronic device needs to be detected. The electronic device can periodically acquire the battery's detected battery level, with the (k+1)th time being any time within the (k+1)th acquisition cycle. The battery voltage is acquired by the electronic device's voltage acquisition module, which can be set independently or integrated into the processor. The voltage acquisition module can be implemented using an analog-to-digital converter (ADC). The voltage acquisition module acquires the battery voltage in the (k+1)th detection cycle and sends it to the processor. Based on the battery voltage, the processor calculates the detected battery level at the (k+1)th time.
[0043] In applications, the battery's detected charge at time k+1 can be calculated based on only one voltage collected in the (k+1)th acquisition cycle to improve detection efficiency. However, collecting only one voltage may lead to inaccurate charge readings due to sudden voltage changes. Therefore, the battery's detected charge at time k+1 can also be calculated by averaging the multiple voltages collected in the (k+1)th acquisition cycle to improve accuracy. Alternatively, m voltages can be collected in the (k+1)th acquisition cycle, abnormal voltages can be removed, and the battery's detected charge at time k+1 can be calculated based on the average of the remaining voltages. Here, m is an integer greater than 2, and the number of abnormal voltages can be zero. Abnormal voltages are determined by obtaining the median of the m voltages, calculating the voltage difference between each of the m voltages and the median, and identifying any voltage difference outside a preset range as an abnormal voltage. The preset voltage difference range can be set according to actual needs.
[0044] like Figure 2 As shown, in one embodiment, step S101 includes the following steps S201 to S203:
[0045] S201. Collect the battery voltage multiple times at time k+1 to obtain multiple voltages of the battery at time k+1, and proceed to step S202.
[0046] S202. Obtain the average value of multiple voltages of the battery at time k+1, and proceed to step S203;
[0047] S203. Based on the average value, obtain the detected charge of the battery at time k+1.
[0048] In applications, the (k+1)th time can be the (k+1)th moment, a moment before the (k+1)th moment, or a time period including the (k+1)th moment. To improve the accuracy of the acquired detected battery power, multiple battery voltages collected at the (k+1)th moment, a moment before the (k+1)th moment, or a time period including the (k+1)th moment can be used to calculate the battery's detected battery power at the (k+1)th moment. When the (k+1)th time is a time period including the (k+1)th moment, the (k+1)th moment can be any moment within the (k+1)th time period, such as the start time, middle time, or end time. When the electronic device periodically acquires the battery's detected battery power, the (k+1)th time can be any moment within the (k+1)th acquisition cycle.
[0049] Step S102: Determine the actual charge of the battery at time k+1 based on the relationship between the detected charge at time k+1 and the actual charge at time k.
[0050] In this application, time k is the previous time before time k+1. When an electronic device periodically acquires the battery's detected power level, the k-th acquisition period is the previous period before the (k+1)-th acquisition period, time k is any time within the k-th acquisition period, and time k is any time within the k-th acquisition period. It should be understood that the logical relationship between time k, the k-th acquisition period, and time k is the same as the logical relationship between time k+1, the (k+1)-th acquisition period, and time k+1, and will not be elaborated further here.
[0051] In applications, when the power module of an electronic device is connected to an external power source to charge the battery, the charging pin of the power module is connected to a voltage from the external power source, which enables the processor to detect the voltage signal. The processor determines that the battery is in a charging state based on the voltage signal. If the processor does not detect the voltage signal, it determines that the battery is in a discharging state. If the battery is neither charging nor discharging, the electronic device is turned off.
[0052] In applications, when the battery is charging, its charge level will continuously increase. Therefore, theoretically, when the battery is charging, the detected charge level at time k+1 should be greater than the actual charge level at time k. If the detected charge level at time k+1 is less than or equal to the actual charge level at time k, it indicates that the detected charge level at time k+1 is inaccurate. Similarly, when the battery is discharging, its charge level will continuously decrease. Therefore, theoretically, when the battery is discharging, the detected charge level at time k+1 should be less than the actual charge level at time k. If the detected charge level at time k+1 is greater than or equal to the actual charge level at time k, it indicates that the detected charge level at time k+1 is inaccurate. In applications, the detected battery charge at time k+1 may be inaccurate. Therefore, it is necessary to refer to the actual battery charge at time k. Based on the relationship between the detected battery charge at time k+1 and the actual battery charge at time k, it is necessary to determine whether the detected battery charge at time k+1 is accurate. If it is inaccurate, the detected battery charge at time k+1 needs to be corrected, and the corrected detected battery charge at time k+1 is taken as the actual battery charge at time k+1. In this way, the accuracy of the charge detection results can be effectively improved.
[0053] like Figure 3 As shown, in one embodiment, step S102 includes:
[0054] Step S300: Determine the actual charge of the battery at time k+1 based on the battery's charge / discharge state at time k+1, the detected charge, and the actual charge at time k.
[0055] In applications, the relationship between the detected charge level and the actual charge level at time k+1 varies depending on the battery's charge / discharge state. Therefore, it is necessary to combine the battery's charge / discharge state, the detected charge level, and the actual charge level at time k+1 to determine the battery's actual charge level at time k+1.
[0056] like Figure 4 As shown, in one embodiment, step S300 includes steps S401 to S403:
[0057] Step S401: If the battery is in a charging state and the detected charge of the battery at time k+1 is less than or equal to the actual charge at time k, determine that the actual charge of the battery at time k+1 is equal to the actual charge at time k.
[0058] Step S402: When the battery is in a charging state and the detected charge of the battery at time k+1 is greater than the actual charge at time k, obtain the first charge difference between the detected charge of the battery at time k+1 and the actual charge at time k, and proceed to step S403.
[0059] Step S403: Determine the actual charge of the battery at time k+1 based on the first charge difference.
[0060] In the application, when the battery is charging, if the detected battery charge at time k+1 is less than or equal to the actual battery charge at time k, the actual battery charge at time k can be used as the actual battery charge at time k+1. If the detected battery charge at time k+1 is greater than the actual battery charge at time k, a first charge difference between the detected battery charge at time k+1 and the actual battery charge at time k can be obtained, and the actual battery charge at time k+1 can be determined based on the magnitude of the first charge difference.
[0061] like Figure 5 As shown, in one embodiment, step S403 includes steps S501 and S502:
[0062] Step S501: If the first power difference is within the range of the first preset power difference, determine that the actual power of the battery at time k+1 is equal to the detected power at time k+1, and proceed to step S502.
[0063] In application, theoretically, when the battery is charging, the charging rate (positive value) is known. The first charge difference should be less than or equal to the product of the charging rate and the time difference between time (k+1) and time (k). The lower limit of the first preset charge difference range is greater than 0, and the upper limit of the first preset charge difference range should be less than or equal to the product of the charging rate and the time difference between time (k+1) and time (k). Therefore, the first preset charge difference range can be (0, the product of the charging rate and the time difference between time (k+1) and time (k)). The battery charging rate is determined based on the known battery charging curve, which reflects the relationship between the battery voltage and charging time.
[0064] Step S502: If the first power difference is not within the range of the first preset power difference, determine that the actual power of the battery at time k+1 is equal to the sum of the actual power at time k and the first preset power value corresponding to the first power difference.
[0065] In application, if the first charge difference is not within the range of the first preset charge difference when the battery is charging, it indicates that the detected charge at time k+1 is inaccurate. In this case, the sum of the actual charge at time k and the first preset charge value corresponding to the first charge difference can be taken as the actual charge at time k+1. The first preset charge value can be determined according to the battery's charging rate.
[0066] like Figure 6 As shown, in one embodiment, step S502 includes:
[0067] Step S600: If the first power difference is not within the range of the first preset power difference, determine that the actual power of the battery at time k+1 is equal to the sum of the actual power at time k and the first preset power value corresponding to the first power difference interval where the first power difference is located.
[0068] In application, the first power difference interval is one of m first preset power difference intervals, where m is an integer greater than or equal to 2. When the battery is charging, all m first preset power difference intervals are positive power intervals, and the corresponding m first preset power values are all positive power values. The m first preset power difference intervals can be obtained by subdividing the positive interval (the upper limit of the first preset power difference range, +∞) into m continuous or discontinuous intervals. The relationship between the m first preset power values can be linear or stepwise, where the largest third preset power value is equal to the product of the charging rate and the time difference between time k+1 and time k. When the battery is charging, by setting multiple subdivided first power difference intervals when the first power difference is not within the first preset power difference range, and then finely adjusting the detected power of the battery at time k+1 according to the first power difference interval in which the first power difference is located, the actual power of the battery at time k+1 can be determined, thus effectively improving the accuracy of the power detection results.
[0069] like Figure 7 As shown, an exemplary illustration illustrates the relationship between the detected charge level and the actual charge level of the battery at time k+1 when the battery is in a charging state.
[0070] like Figure 8 As shown, in one embodiment, step S300 includes steps S701 to S703:
[0071] Step S701: If the battery is in a discharging state and the detected charge of the battery at time k+1 is greater than or equal to the actual charge at time k, determine that the actual charge of the battery at time k+1 is equal to the actual charge at time k.
[0072] Step S702: When the battery is in a discharging state and the detected charge of the battery at time k+1 is less than the actual charge at time k, obtain the second charge difference between the detected charge of the battery at time k+1 and the actual charge at time k, and proceed to step S703.
[0073] Step S703: Determine the actual charge of the battery at time k+1 based on the second charge difference.
[0074] In application, when the battery is in a discharging state, if the detected charge of the battery at time k+1 is greater than or equal to the actual charge at time k, the actual charge of the battery at time k can be taken as the actual charge of the battery at time k+1. If the detected charge of the battery at time k+1 is less than the actual charge at time k, a second charge difference between the detected charge at time k+1 and the actual charge at time k can be obtained. The actual charge of the battery at time k+1 is determined based on the magnitude of the second charge difference.
[0075] like Figure 9 As shown, in one embodiment, step S703 includes steps S801 and S802:
[0076] Step S801: If the second power difference is within the range of the second preset power difference, determine that the actual power of the battery at time k+1 is equal to the detected power at time k+1, and proceed to step S802.
[0077] In application, theoretically, when the battery is in a discharging state, the discharge rate (negative value) is known. The second charge difference should be greater than or equal to the product of the discharge rate and the time difference between time (k+1) and time (k). The lower limit of the second preset charge difference range should be greater than or equal to the product of the discharge rate and the time difference between time (k+1) and time (k), and the upper limit of the second preset charge difference range should be less than 0. Therefore, the second preset charge difference range can be [the product of the discharge rate and the time difference between time (k+1) and time (k), 0]. The battery's discharge rate is determined based on the known battery discharge curve, which reflects the relationship between the battery's voltage and discharge time.
[0078] Step S802: If the second power difference is not within the range of the second preset power difference, determine that the actual power of the battery at time k+1 is equal to the sum of the actual power at time k and the second preset power value corresponding to the second power difference.
[0079] In application, if the second charge difference is not within the range of the second preset charge difference when the battery is discharging, it indicates that the detected charge at time k+1 is inaccurate. In this case, the sum of the actual charge at time k and the second preset charge value corresponding to the second charge difference can be taken as the actual charge at time k+1. The second preset charge value can be determined according to the battery's discharge rate.
[0080] like Figure 10 As shown, in one embodiment, step S802 includes:
[0081] Step S900: If the second power difference is not within the range of the second preset power difference, determine that the actual power of the battery at time k+1 is equal to the sum of the actual power at time k and the second preset power value corresponding to the second power difference interval where the second power difference is located.
[0082] In application, the second power difference interval is one of n second preset power difference intervals, where n is an integer greater than or equal to 2. When the battery is discharging, all n second preset power difference intervals are negative power intervals, and the corresponding n second preset power values are all negative power values. The n second preset power difference intervals can be obtained by subdividing the negative interval (-∞, the lower limit of the second preset power difference range) into n continuous or discontinuous intervals. The relationship between the n second preset power values can be linear or stepwise decreasing, where the smallest second preset power value is equal to the product of the discharge rate and the time difference between time k+1 and time k. By setting multiple subdivided second power difference intervals when the second power difference is not within the second preset power difference range, and then finely adjusting the detected power of the battery at time k+1 according to the second power difference interval in which the second power difference is located, the actual power of the battery at time k+1 can be determined, thus effectively improving the accuracy of the power detection results.
[0083] like Figure 11 As shown, an exemplary illustration is provided of the relationship between the detected charge and the actual charge of the battery at time k+1 when the battery is in a discharging state.
[0084] like Figure 12 As shown, in one embodiment, step S102 includes steps S111 and S112:
[0085] Step S111: Obtain the third power difference between the detected power level of the battery at time k+1 and the actual power level at time k; Step S112:
[0086] Step S112: Determine the actual charge of the battery at time k+1 based on the third charge difference.
[0087] In practice, theoretically, when the battery is charging, the third charge difference between the detected charge at time k+1 and the actual charge at time k should be greater than 0. If the third charge difference is less than or equal to 0, it indicates that the detected charge at time k+1 is inaccurate. When the battery is discharging, the third charge difference should be less than 0. If the third charge difference is greater than or equal to 0, it indicates that the detected charge at time k+1 is inaccurate.
[0088] In applications, since the detected battery charge at time k+1 may be inaccurate, it is necessary to refer to the actual battery charge at time k. The actual battery charge at time k+1 is then determined based on the third charge difference between the theoretical charge at time k+1 and the actual charge at time k. This can effectively improve the accuracy of the charge detection results.
[0089] like Figure 13 As shown, in one embodiment, step S112 includes steps S121 to S123:
[0090] Step S121: If the third power difference is within the range of the third preset power difference, determine that the actual power of the battery at time k+1 is equal to the actual power at time k.
[0091] Step S122: If the third power difference is within the range of the fourth preset power difference, determine that the actual power of the battery at time k+1 is equal to the detected power at time k+1.
[0092] Step S123: If the third power difference is not within the range of the third preset power difference and not within the range of the fourth preset power difference, determine that the actual power of the battery at time k+1 is equal to the sum of the actual power at time k and the third preset power value corresponding to the third power difference.
[0093] In application, if the third power difference is within the range of the third preset power difference, the actual power of the battery at time k can be taken as the actual power of the battery at time k+1. If the third power difference is within the range of the third preset power difference, it can be further determined whether the third power difference is within the range of the fourth preset power difference. If it is, the detected power of the battery at time k+1 is taken as the actual power of the battery at time k+1. If it is not, it indicates that the detected power of the battery at time k+1 is inaccurate. In this case, the sum of the actual power of the battery at time k and the third preset power value corresponding to the third power difference can be taken as the actual power of the battery at time k+1.
[0094] In application, when the battery is charging, the upper limit of the third preset power difference range is less than or equal to 0, and the third preset power difference range can be set to (-∞, 0). The lower limit of the fourth preset power difference range is greater than 0, and the upper limit of the fourth preset power difference range should be less than or equal to the product of the charging rate and the time difference between time k+1 and time k. Therefore, the fourth preset power difference range can be (0, the product of the charging rate and the time difference between time k+1 and time k). The third preset power value can be determined according to the battery's charging rate; for example, the third preset power value is equal to the product of the charging rate and the time difference between time k+1 and time k.
[0095] In application, when the battery is discharging, the lower limit of the third preset charge difference range is greater than or equal to 0, and the third preset charge difference range can be set to [0, +∞). The upper limit of the fourth preset charge difference range is less than 0, and the upper limit of the fourth preset charge difference range should be less than or equal to the product of the discharge rate and the time difference between time k+1 and time k. Therefore, the fourth preset charge difference range can be [the product of the discharge rate and the time difference between time k+1 and time k, 0). The third preset charge value can be determined according to the battery's discharge rate; for example, the third preset charge value is equal to the product of the discharge rate and the time difference between time k+1 and time k.
[0096] like Figure 14 As shown, in one embodiment, step S123 includes:
[0097] Step S130: If the third power difference is not within the range of the third preset power difference and not within the range of the fourth preset power difference, determine that the actual power of the battery at time k+1 is equal to the sum of the actual power at time k and the third preset power value corresponding to the power difference interval where the third power difference is located.
[0098] In application, the third power difference interval is one of q third preset power difference intervals, where q is an integer greater than or equal to 2. When the battery is charging, q = q1, and all q1 third preset power difference intervals are positive power intervals, corresponding to q1 third preset power values that are all positive power values. The q1 third preset power difference intervals can be obtained by subdividing the positive interval (the upper limit of the fourth preset power difference range, +∞) into q1 continuous or discontinuous intervals. The relationship between the q1 third preset power values can be linear or stepwise increasing, where the largest third preset power value is equal to the product of the charging rate and the time difference between time k+1 and time k. When the battery is discharging, q = q², and all q² third preset charge difference intervals are negative charge intervals, corresponding to q² third preset charge values that are all negative. These q² third preset charge difference intervals can be obtained by subdividing the negative interval (-∞, the lower limit of the fourth preset charge difference range) into q² continuous or discontinuous intervals. The relationship between these q² third preset charge values can be linear or stepwise decreasing, where the smallest third preset charge value equals the product of the discharge rate and the time difference between time k+1 and time k. By setting multiple subdivided third charge difference intervals when the third charge difference is not within the fourth preset charge difference range, and then finely adjusting the detected charge at time k+1 based on the third charge difference interval in which the third charge difference falls, the actual charge at time k+1 can be determined, thus effectively improving the accuracy of the charge detection results.
[0099] like Figure 15 As shown, an exemplary illustration illustrates the relationship between the battery's charge / discharge state at time k+1, the third charge difference, and the actual charge.
[0100] In one embodiment, after step S103, the following is included:
[0101] This displays the actual charge level of the battery at time k+1.
[0102] In applications, the actual battery level is displayed via a display device on the electronic device. This display device can be, but is not limited to, a display screen, a seven-segment or eight-segment LED display, or at least one of these. After determining the actual battery level at time k+1, the electronic device can display this actual battery level so that the user can know the real-time battery status. The electronic device can also perform power management on the battery based on the actual battery level at each time point.
[0103] In applications, when the battery is discharging, if the battery level falls below a first power threshold, a corresponding initial warning message will be issued to remind the user that the electronic device is low on power and needs charging. It can also automatically enter sleep mode, low-power mode, or reduce the brightness of the display. For example, when the electronic device is a mobile terminal with a power load, such as a mobile phone, tablet, laptop, netbook, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, or smart wearable device, background applications can be closed to save power. The first power threshold can be set to a low threshold, such as 20% of the battery's nominal capacity.
[0104] In the application, when the battery is charging, if the battery level exceeds a second power threshold, a corresponding second prompt message will be issued to remind the user that the electronic device has sufficient power. It may also automatically exit sleep mode or low-power mode, or increase the brightness of the display device. The second power threshold can be set to a relatively high threshold, for example, 80% of the battery's nominal capacity.
[0105] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0106] This application also provides a power detection device for performing the steps described in the power detection method embodiments above. The power detection device can be a virtual appliance within an electronic device, run by the electronic device's processor, or it can be the electronic device itself.
[0107] like Figure 16 As shown, the power detection device 100 provided in this application embodiment includes:
[0108] The power acquisition unit 101 is used to acquire the detected power of the battery at time k+1, where k is any positive integer;
[0109] The power determination unit 102 is used to determine the actual power of the battery at time k+1 based on the relationship between the detected power of the battery at time k+1 and the actual power at time k.
[0110] In one embodiment, the power detection device further includes:
[0111] In one embodiment, the power detection device further includes:
[0112] The display unit is used to display the actual charge level of the battery at time k+1.
[0113] In one embodiment, the power detection device further includes a prompting unit for:
[0114] If the battery level is below a first charge threshold while the battery is discharging, a corresponding first warning message will be issued.
[0115] If the battery level is higher than the second charge threshold while the battery is charging, a corresponding second prompt message will be issued.
[0116] In applications, the units in the power detection device can be software program modules, or they can be implemented through different logic circuits integrated in the processor, or they can be implemented through multiple distributed processors.
[0117] like Figure 17 As shown, this application embodiment also provides an electronic device 200, including: a battery 201, a power module 202, a voltage acquisition module 203, and at least one processor 204. Figure 17 The diagram shows only one processor, memory 205, and computer program 206 stored in memory 205 and executable on at least one processor 204. When processor 204 executes computer program 206, it implements the steps in the above-described embodiments of the various power detection methods.
[0118] In applications, electronic devices may include, but are not limited to, batteries, power modules, voltage acquisition modules, memory, and processors. Those skilled in the art will understand that... Figure 17 This is merely an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than illustrated, or combinations of certain components, or different components. For example, it may also include input / output devices, network access devices, etc. Input / output devices may include cameras, audio capture / playback devices, display devices, buttons, etc. Network access devices may include communication modules for communicating with other devices.
[0119] In applications, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor.
[0120] In applications, memory can be an internal storage unit of an electronic device in some embodiments, such as a hard drive or RAM. In other embodiments, memory can be an external storage device of the electronic device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal and external storage units of the electronic device. Memory is used to store operating systems, applications, bootloaders, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0121] In applications, the communication module can be configured as any device capable of direct or indirect wired or wireless communication with other devices, depending on actual needs. For example, the communication module can provide solutions for communication on network devices, including communication interfaces such as Universal Serial Bus (USB), Local Area Networks (LAN), Wireless Local Area Networks (WLAN) (e.g., Wi-Fi), Bluetooth, Zigbee, mobile communication networks, Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR). The communication module can include an antenna, which can have a single element or be an antenna array with multiple elements. The communication module can receive electromagnetic waves through the antenna, frequency-modulate and filter the electromagnetic wave signal, and send the processed signal to the processor. The communication module can also receive signals to be transmitted from the processor, frequency-modulate and amplify them, and then convert them into electromagnetic waves for radiation via the antenna.
[0122] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0123] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units is used as an example. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. The functional units in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0124] This application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the power detection method of any of the above embodiments.
[0125] This application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the power detection method of any of the above embodiments.
[0126] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to an electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0127] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0128] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0129] In the embodiments provided in this application, it should be understood that the disclosed devices, electronic devices, and methods can be implemented by other methods. For example, the device and electronic device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, two or more units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0130] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for detecting electrical charge, characterized in that, include: Obtain the battery level at time k+1, where k is any positive integer; The actual charge of the battery at time k+1 is determined based on the relationship between the detected charge at time k+1 and the actual charge at time k. The method of obtaining the battery's detected charge level at time k+1 includes: The battery voltage is collected multiple times at time k+1 to obtain multiple voltages of the battery at time k+1. Time k+1 is the time k+1, the time before time k+1, or the time period including time k+1. Obtain the average value of multiple voltages of the battery at time k+1; Based on the average value, the detected charge level of the battery at time k+1 is obtained.
2. The power detection method as described in claim 1, characterized in that, The step of determining the actual battery charge at time k+1 based on the relationship between the detected charge level and the actual charge level at time k includes: The actual charge level of the battery at time k+1 is determined based on the battery's charge / discharge state at time k+1, the detected charge level, and the actual charge level at time k.
3. The power detection method as described in claim 2, characterized in that, The step of determining the actual charge level of the battery at time k+1 based on the battery's charge / discharge state at time k+1, the detected charge level, and the actual charge level at time k includes: If the battery is in a charging state and the detected charge level of the battery at time k+1 is less than or equal to the actual charge level at time k, then the actual charge level of the battery at time k+1 is determined to be equal to the actual charge level at time k. When the battery is in a charging state and the detected charge level of the battery at time k+1 is greater than the actual charge level at time k, a first charge difference value is obtained between the detected charge level of the battery at time k+1 and the actual charge level at time k. Based on the first charge difference, the actual charge of the battery at time k+1 is determined.
4. The power detection method as described in claim 3, characterized in that, Determining the actual battery charge at time k+1 based on the first charge difference includes: If the first power difference is within the range of the first preset power difference, it is determined that the actual power of the battery at time k+1 is equal to the detected power at time k+1. If the first power difference is not within the range of the first preset power difference, the actual power of the battery at time k+1 is determined to be equal to the sum of the actual power at time k and the first preset power value corresponding to the first power difference.
5. The power detection method as described in claim 4, characterized in that, The step of determining that the actual charge of the battery at time k+1 is equal to the sum of the actual charge at time k and the first preset charge value corresponding to the first charge difference when the first charge difference is not within the range of the first preset charge difference includes: If the first power difference is not within the first preset power difference range, the actual power of the battery at time k+1 is determined to be equal to the sum of the actual power at time k and the preset power value corresponding to the first power difference interval where the first power difference is located. The first power difference interval is one of m first preset power difference intervals, where m is an integer greater than or equal to 2.
6. The power detection method as described in claim 4, characterized in that, Before determining that the actual charge of the battery at time k+1 is equal to the sum of the actual charge at time k and the first preset charge value corresponding to the first charge difference when the first charge difference is not within the range of the first preset charge difference, the process includes: The first preset power value corresponding to the first power difference is determined based on the charging rate of the battery.
7. The power detection method as described in claim 2, characterized in that, The step of determining the actual charge level of the battery at time k+1 based on the battery's charge / discharge state at time k+1, the detected charge level, and the actual charge level at time k includes: If the battery is in a discharging state and the detected charge of the battery at time k+1 is greater than or equal to the actual charge at time k, then the actual charge of the battery at time k+1 is determined to be equal to the actual charge at time k. When the battery is in a discharging state and the detected charge of the battery at time k+1 is less than the actual charge at time k, a second charge difference value is obtained between the detected charge of the battery at time k+1 and the actual charge at time k. The actual charge level of the battery at time k+1 is determined based on the second charge difference.
8. The power detection method as described in claim 7, characterized in that, Determining the actual battery charge at time k+1 based on the second charge difference includes: If the second power difference is within the range of the second preset power difference, it is determined that the actual power of the battery at time k+1 is equal to the detected power at time k+1. If the second power difference is not within the range of the second preset power difference, the actual power of the battery at time k+1 is determined to be equal to the sum of the actual power at time k and the second preset power value corresponding to the second power difference.
9. The power detection method as described in claim 8, characterized in that, The step of determining that the actual charge of the battery at time k+1 is equal to the sum of the actual charge at time k and the preset charge value corresponding to the second charge difference when the second charge difference is not within the range of the second preset charge difference includes: If the second power difference is not within the range of the second preset power difference, the actual power of the battery at time k+1 is determined to be equal to the sum of the actual power at time k and the second preset power value corresponding to the second power difference interval where the second power difference is located. The second power difference interval is one of n second preset power difference intervals, where n is an integer greater than or equal to 2.
10. The power detection method as described in claim 8, characterized in that, Before determining that the actual charge of the battery at time k+1 is equal to the sum of the actual charge at time k and the second preset charge value corresponding to the second charge difference when the second charge difference is not within the range of the second preset charge difference, the process includes: The second preset charge value corresponding to the second charge difference is determined based on the discharge rate of the battery.
11. The power detection method as described in claim 1, characterized in that, The step of determining the actual battery charge at time k+1 based on the relationship between the detected charge level and the actual charge level at time k includes: Obtain the third charge difference between the detected charge level of the battery at time k+1 and the actual charge level at time k; The actual charge level of the battery at time k+1 is determined based on the third charge difference.
12. The power detection method as described in claim 11, characterized in that, The step of determining the actual battery charge at time k+1 based on the third charge difference includes: If the third power difference is within the range of the third preset power difference, it is determined that the actual power of the battery at time k+1 is equal to the actual power at time k. If the third power difference is within the range of the fourth preset power difference, the actual power of the battery at time k+1 is determined to be equal to the detected power at time k+1. If the third power difference is not within the range of the third preset power difference and not within the range of the fourth preset power difference, the actual power of the battery at time k+1 is determined to be equal to the sum of the actual power at time k and the third preset power value corresponding to the third power difference.
13. The power detection method as described in claim 12, characterized in that, The step of determining that the actual charge of the battery at time k+1 is equal to the sum of the actual charge at time k and the third preset charge value corresponding to the third charge difference when the third charge difference is neither within the range of the third preset charge difference nor within the range of the fourth preset charge difference includes: If the third power difference is not within the range of the third preset power difference and not within the range of the fourth preset power difference, the actual power of the battery at time k+1 is determined to be equal to the sum of the actual power at time k and the third preset power value corresponding to the third power difference interval where the third power difference is located. The third power difference interval is one of q third preset power difference intervals, where q is an integer greater than or equal to 2.
14. The power detection method as described in claim 12, characterized in that, Before determining that the actual charge of the battery at time k+1 is equal to the sum of the actual charge at time k and the third preset charge value corresponding to the third charge difference when the third charge difference is neither within the range of the third preset charge difference nor within the range of the fourth preset charge difference, the process includes: When the battery is in a charging state at time k+1, a third preset charge value corresponding to the third charge difference is determined according to the charging rate of the battery.
15. The power detection method as described in claim 12, characterized in that, Before determining that the actual charge of the battery at time k+1 is equal to the sum of the actual charge at time k and the third preset charge value corresponding to the third charge difference when the third charge difference is neither within the range of the third preset charge difference nor within the range of the fourth preset charge difference, the process includes: When the battery is in a discharging state at time k+1, a third preset charge value corresponding to the third charge difference is determined according to the battery's discharge rate.
16. A power detection device, characterized in that, include: The power acquisition unit is used to acquire the detected power of the battery at time k+1, where k is any positive integer; A power determination unit is used to determine the actual power of the battery at time k+1 based on the relationship between the detected power of the battery at time k+1 and the actual power at time k. The method of obtaining the battery's detected charge level at time k+1 includes: The battery voltage is collected multiple times at time k+1 to obtain multiple voltages of the battery at time k+1. Time k+1 is the time k+1, the time before time k+1, or the time period including time k+1. Obtain the average value of multiple voltages of the battery at time k+1; Based on the average value, the detected charge level of the battery at time k+1 is obtained.
17. An electronic device comprising a battery, a power module, a voltage acquisition module, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the power detection method as described in any one of claims 1-15.
18. The electronic device as claimed in claim 17, characterized in that, The electronic device is a wireless earphone or a charging case, wherein the charging case is a true wireless stereo earphone, a single-ear wireless earphone, or a charging case for smart glasses.
19. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the power detection method as described in any one of claims 1-15.
Citation Information
Patent Citations
Electric quantity display method and device, storage medium and electronic equipment
CN112492107A