Battery electric quantity monitoring method, device and equipment based on embedded controller, storage medium and computer program product

By acquiring raw battery data through an embedded controller, determining basic battery information, and updating power data, the problem of inaccurate power monitoring caused by unprocessed output from the fuel gauge chip is solved, thus improving the accuracy and real-time performance of battery power monitoring.

CN120928215APending Publication Date: 2025-11-11SHENZHEN EMDOOR DIGITAL TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511066821.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

In the existing technology, the battery power monitoring data output by the fuel gauge chip is unprocessed and is easily affected by changes in current, resulting in poor accuracy of power monitoring, especially when the battery state changes rapidly, which can easily cause power jumps.

Method used

By interacting with the fuel gauge chip through an embedded controller, the system obtains raw battery data, determines basic battery information including battery voltage, current, and temperature, and updates battery power data based on this information, thereby reducing data lag and processing errors.

Benefits of technology

It improves the accuracy and real-time performance of battery power monitoring, ensuring that battery power data comes from raw data collected in real time, and reducing data lag or deviations in the processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120928215A_ABST
    Figure CN120928215A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of battery management, in particular to a battery electric quantity monitoring method, device and equipment based on an embedded controller, a storage medium and a computer program product. The method comprises the following steps: when a voltameter chip is in a data interaction state, carrying out data interaction with the voltameter chip through an embedded controller to obtain battery original data stored in a voltameter chip register; battery basic information is determined according to the battery original data, and the battery basic information comprises battery voltage information, battery current information and battery temperature information; determining battery electric quantity information according to the battery basic information; based on the battery electric quantity information, the battery electric quantity data is updated in the embedded controller, and the accuracy of battery electric quantity monitoring is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of battery management technology, and in particular to a battery power monitoring method, device, equipment, storage medium, and computer program product based on an embedded controller. Background Technology

[0002] With the widespread use of portable electronic devices such as laptops and wearables, fuel gauge chips are used to detect battery voltage, current, temperature, and remaining charge, and manage this data through embedded controllers. However, existing fuel gauge chips primarily output unprocessed raw register data, making the accuracy of charge calculations susceptible to current variations and prone to sudden charge jumps during rapid changes in battery state, resulting in inaccurate battery charge monitoring. Therefore, improving the accuracy of battery charge monitoring has become a pressing technical problem. Summary of the Invention

[0003] The main objective of this application is to provide a battery power monitoring method, device, equipment, storage medium, and computer program product based on an embedded controller, aiming to solve the technical problem of how to improve the accuracy of battery power monitoring.

[0004] To achieve the above objectives, this application provides a battery power monitoring method based on an embedded controller. The method is applied to an electronic device containing a fuel gauge chip and includes the following steps:

[0005] If the fuel gauge chip is in a data interaction state, the embedded controller interacts with the fuel gauge chip to obtain the original battery data stored in the fuel gauge chip's register.

[0006] Based on the original battery data, the basic battery information is determined, including battery voltage information, battery current information, and battery temperature information.

[0007] Based on the aforementioned basic battery information, determine the battery power information;

[0008] Based on the battery power information, the battery power data is updated in the embedded controller.

[0009] In one embodiment, before the step of obtaining the original battery data stored in the fuel gauge chip register by interacting with the fuel gauge chip through the embedded controller when the fuel gauge chip is in a data interaction state, the method further includes:

[0010] Detect the power-on status of the fuel gauge chip;

[0011] Based on the power-on state, preset battery curve data is written into the register of the fuel gauge chip;

[0012] After the writing is completed, the control unit puts the fuel gauge chip into the data interaction state.

[0013] In one embodiment, the step of obtaining the original battery data stored in the fuel gauge chip's register by interacting with the fuel gauge chip through the embedded controller when the fuel gauge chip is in a data interaction state includes:

[0014] When the fuel gauge chip is in a data interaction state, the target register address of the fuel gauge chip is determined based on the embedded controller;

[0015] Based on the target register address, a data read request is sent to the fuel gauge chip;

[0016] The system receives the raw register data returned by the fuel gauge chip in response to the data read request, and extracts the raw battery data from the raw register data.

[0017] In one embodiment, the step of determining basic battery information based on the original battery data, wherein the basic battery information includes battery voltage information, battery current information, and battery temperature information, includes:

[0018] Voltage-related data are extracted from the original battery data, and battery voltage information is determined according to a preset conversion relationship;

[0019] Based on the battery voltage information, and combined with the current-related data in the original battery data, the battery current information is determined;

[0020] Based on the battery voltage information and the battery current information, the temperature-related data in the original battery data is processed to determine the battery temperature information;

[0021] The battery voltage information, the battery current information, and the battery temperature information are used as the basic information of the battery.

[0022] In one embodiment, the step of determining the battery power information based on the battery basic information includes:

[0023] Based on the battery current information in the battery basic information, the full charge capacity of the battery is adjusted, and based on the adjusted full charge capacity, it is determined whether the battery is in the full charge stage.

[0024] If so, update the phased battery charge value based on the battery voltage information and the battery current information;

[0025] When a jump in the staged battery power value is detected, the staged battery power value is smoothed based on the battery temperature information to obtain the battery power information.

[0026] In one embodiment, the step of adjusting the battery's full-charge capacity based on the battery current information in the battery's basic information, and determining whether the battery is in a full-charge stage based on the adjusted full-charge capacity, includes:

[0027] Obtain the battery current information from the battery basic information and determine the target full charge capacity by combining it with the preset current capacity correspondence;

[0028] Update the target full charge capacity to the current full charge capacity, and determine the current charging status based on the current full charge capacity and the battery voltage information;

[0029] Based on the correspondence between the current charging state and the current full charge capacity, it is determined whether the battery has entered the full charge stage.

[0030] Furthermore, to achieve the above objectives, this application also proposes a battery power monitoring device based on an embedded controller, which is applied to an electronic device containing a fuel gauge chip. The battery power monitoring device based on the embedded controller includes:

[0031] The data interaction module is used to interact with the fuel gauge chip through the embedded controller to obtain the original battery data stored in the register of the fuel gauge chip if the fuel gauge chip is in the data interaction state.

[0032] The basic information module is used to determine the basic information of the battery based on the original battery data. The basic information of the battery includes battery voltage information, battery current information and battery temperature information.

[0033] The power information module is used to determine the battery power information based on the battery basic information;

[0034] The target module is used to update the battery power data in the embedded controller based on the battery power information.

[0035] Furthermore, to achieve the above objectives, this application also proposes a battery power monitoring device based on an embedded controller. The device includes: a memory, a processor, and a battery power monitoring program based on an embedded controller stored in the memory and executable on the processor. The battery power monitoring program based on an embedded controller is configured to implement the steps of the battery power monitoring method based on an embedded controller as described above.

[0036] In addition, to achieve the above objectives, this application also proposes a storage medium storing a battery power monitoring program based on an embedded controller, wherein when the battery power monitoring program based on the embedded controller is executed by a processor, it implements the steps of the battery power monitoring method based on the embedded controller described above.

[0037] In addition, to achieve the above objectives, this application also proposes a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the battery power monitoring method based on an embedded controller as described above.

[0038] This application, when the fuel gauge chip is in a data interaction state, uses an embedded controller to interact with the fuel gauge chip and obtain the raw battery data stored in the fuel gauge chip's register. Based on the raw battery data, basic battery information is determined, including battery voltage, battery current, and battery temperature. Based on this basic information, the battery level is determined. Based on the battery level information, the battery level data is updated in the embedded controller. This application obtains the raw battery data stored in the register by the embedded controller when the fuel gauge chip is in a data interaction state, enabling the battery voltage, battery current, and battery temperature information to be directly determined from the raw data. Then, the embedded controller determines the battery level information based on the basic information and updates the battery level data. Through the sequential execution of the above steps, the battery level data is calculated step-by-step from the real-time acquired raw data and updated in the controller, reducing data lag or processing deviations, thereby improving the accuracy of battery level monitoring. Attached Figure Description

[0039] Figure 1 This is a flowchart illustrating the first embodiment of the battery power monitoring method based on an embedded controller according to this application;

[0040] Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the battery power monitoring method based on an embedded controller in this application;

[0041] Figure 3 This is a schematic diagram of a sub-process in the third embodiment of the battery power monitoring method based on an embedded controller in this application;

[0042] Figure 4 This is a schematic diagram of the module structure of the battery power monitoring device based on an embedded controller according to an embodiment of this application;

[0043] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the battery power monitoring method based on an embedded controller in the embodiments of this application.

[0044] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0045] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.

[0046] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0047] It should be noted that with the widespread use of portable electronic devices such as laptops and wearable devices, fuel gauge chips are used to detect battery voltage, current, temperature, and remaining charge, and manage this data through embedded controllers. However, existing fuel gauge chips mostly output unprocessed raw register data, making the accuracy of charge calculations susceptible to changes in current and prone to sudden changes in charge level during rapid battery state changes, resulting in poor accuracy in battery charge monitoring. Therefore, improving the accuracy of battery charge monitoring has become a pressing technical problem.

[0048] The main solution of this application is as follows: when the fuel gauge chip is in a data interaction state, the embedded controller interacts with the fuel gauge chip to obtain the original battery data stored in the fuel gauge chip register; based on the original battery data, the basic battery information is determined, including battery voltage information, battery current information, and battery temperature information; based on the basic battery information, the battery power information is determined; and based on the battery power information, the battery power data is updated in the embedded controller.

[0049] This application acquires raw battery data stored in the register by an embedded controller when the fuel gauge chip is in a data interaction state. This allows battery voltage, current, and temperature information to be directly determined based on the raw data. Subsequently, the embedded controller determines the battery power information based on the basic information and updates the battery power data. By executing the above steps sequentially, the battery power data is calculated step by step from the real-time acquired raw data and updated in the controller, reducing data lag or deviations in the processing, thereby improving the accuracy of battery power monitoring.

[0050] It should be noted that the execution subject of the method in this embodiment can be a computing service device with data processing, network communication, and program execution functions, or it can be the aforementioned battery power monitoring device based on an embedded controller with the same or similar functions. This embodiment and the following embodiments will be described using a battery power monitoring device based on an embedded controller as an example.

[0051] Based on this, a first embodiment of the battery power monitoring method based on an embedded controller is proposed in this application. Please refer to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the battery power monitoring method based on an embedded controller according to this application.

[0052] In this embodiment, the battery power monitoring method based on an embedded controller is applied to an electronic device containing a fuel gauge chip, and the method includes the following steps:

[0053] S1: When the fuel gauge chip is in a data interaction state, the embedded controller interacts with the fuel gauge chip to obtain the original battery data stored in the fuel gauge chip's register;

[0054] It's important to note that the fuel gauge chip is an integrated circuit chip used to detect battery status parameters such as voltage, current, and temperature. The embedded controller (EC) is a microcontroller unit in an electronic device, responsible for communicating with peripheral chips and processing the acquired data for battery management and system control. Data interaction status refers to the fuel gauge chip being in a working mode where it can read and write data with an external controller via a bus. The register is an internal storage unit within the fuel gauge chip used to store the raw battery-related data detected in real time. This raw battery data is the battery operating data directly collected and stored in the register by the fuel gauge chip, before further conversion and processing by the controller.

[0055] Specifically, when the fuel gauge chip is in data interaction mode, the embedded controller first establishes a communication connection with the fuel gauge chip via the bus. Based on its internal settings, the embedded controller sends a data read request to the fuel gauge chip, specifying the address of the register to be accessed, thereby instructing the fuel gauge chip to output the data from the corresponding memory unit.

[0056] Furthermore, after receiving a read request, the fuel gauge chip returns the raw battery data from the designated register to the embedded controller via the bus. The embedded controller receives the returned data and temporarily stores it in its internal cache for subsequent calculations of basic battery information. This completes the process of acquiring the raw battery data.

[0057] This step allows the embedded controller to directly read raw battery data from the registers of the fuel gauge chip when communication is enabled, ensuring that the collected data originates from real-time measured battery status and avoiding data lag or distortion caused by intermediate processing or multiple transmissions. This provides a reliable basis for subsequent accurate calculations of battery voltage, current, and temperature, thereby improving the accuracy and real-time performance of battery power monitoring.

[0058] S2: Determine the basic battery information based on the original battery data. The basic battery information includes battery voltage information, battery current information, and battery temperature information.

[0059] It should be noted that the basic battery information refers to the raw battery data returned by the fuel gauge chip. Battery voltage information is calculated from the raw voltage data detected by the fuel gauge chip. Battery current information is calculated from the raw current data detected by the fuel gauge chip. Battery temperature information is calculated from the raw temperature data detected by the fuel gauge chip.

[0060] Specifically, the embedded controller extracts various parameters from the cached raw battery data, including raw voltage, raw current, and raw temperature values. Based on pre-set conversion relationships or calibration parameters, the controller converts the raw data into engineering-meaning voltage, current, and temperature values. For example, the raw voltage data is calculated to obtain battery voltage information through a correspondence with the number of battery cells in series and the sampling ratio; the raw current data is converted to battery current information by combining the sampling resistor parameters; and the raw temperature data is converted to battery temperature information through proportional conversion.

[0061] Furthermore, the embedded controller organizes and stores the calculated battery voltage, current, and temperature information to form a basic battery information set. This basic information can be used by the subsequent battery capacity calculation module to ensure accurate and complete data input for capacity estimation.

[0062] This step transforms the raw battery data provided by the fuel gauge chip into basic battery information that directly characterizes the battery's operating state. This allows subsequent power calculations to be based on real-time, accurate voltage, current, and temperature data, avoiding errors caused by directly using unprocessed raw data. This provides a fundamental guarantee for the accuracy and reliability of battery power monitoring.

[0063] S3: Determine the battery power information based on the battery basic information;

[0064] S4: Update the battery power data in the embedded controller based on the battery power information.

[0065] It should be noted that battery power information is data used to characterize the battery's current remaining power or state of charge (SOC) based on basic battery information (voltage, current, and temperature). Battery power data is a record of battery power levels stored or updated in the embedded controller, used for device battery management and power display. Updating battery power data refers to the embedded controller writing new battery power information to its storage unit or target register after calculation, replacing or refreshing the original power data.

[0066] Specifically, after obtaining basic battery information, the embedded controller first analyzes the current state of the battery using battery voltage, current, and temperature information. Based on preset power calculation rules or models, the controller converts the basic information into battery power information, representing the current remaining battery power or state of charge.

[0067] Furthermore, after calculating the battery power information, the embedded controller writes the information to the internal storage unit or a designated data cache area, replacing or refreshing the battery power data stored in the previous cycle, so that the battery power data is consistent with the current battery state, for use by system management or power display.

[0068] Through the above steps, the embedded controller can update the battery power data in a timely manner after calculating the battery power information in real time, so that the battery power data is always generated based on the latest voltage, current and temperature information, avoiding inaccurate power display due to data lag or lack of updates, thereby improving the real-time performance and accuracy of battery power monitoring.

[0069] In this embodiment, when the fuel gauge chip is in a data interaction state, the embedded controller interacts with the fuel gauge chip to obtain the raw battery data stored in the fuel gauge chip's register. Based on the raw battery data, basic battery information is determined, including battery voltage, battery current, and battery temperature. Based on this basic information, the battery level is determined. Based on the battery level information, the battery level data is updated in the embedded controller. This embodiment obtains the raw battery data stored in the register by the embedded controller when the fuel gauge chip is in a data interaction state, allowing battery voltage, current, and temperature information to be directly determined from the raw data. The embedded controller then determines the battery level information based on the basic information and updates the battery level data. Through the sequential execution of these steps, the battery level data is calculated step-by-step from the real-time acquired raw data and updated in the controller, reducing data lag or processing deviations, thereby improving the accuracy of battery level monitoring.

[0070] Based on the first embodiment described above, a second embodiment of the battery power monitoring method based on an embedded controller is proposed in this application. Please refer to... Figure 2 , Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the battery power monitoring method based on an embedded controller in this application.

[0071] like Figure 2 As shown, in this embodiment, before step S1, the following steps are also included:

[0072] S1a: Detect the power-on status of the fuel gauge chip;

[0073] S1b: Based on the power-on state, write the preset battery curve data into the register of the fuel gauge chip;

[0074] S1c: After writing is completed, control the fuel gauge chip to enter the data interaction state.

[0075] It should be noted that the power-on state of the fuel gauge chip refers to the detectable working state of the fuel gauge chip after the power is connected. The preset battery curve data refers to a predefined set of battery characteristic parameters.

[0076] Specifically, after the fuel gauge chip is powered on, the embedded controller first checks its status register or uses a status detection command to determine if the chip is in a normal power-on state, confirming that its internal circuitry is ready to accept subsequent operations. After confirming the fuel gauge chip is powered on, the embedded controller, based on the current power-on state, writes pre-stored battery curve data into the fuel gauge chip's registers in a specified order, enabling the fuel gauge chip to calculate voltage, current, and capacity according to the characteristics of the target battery. Once the battery curve data is written, the embedded controller sends a command or configures the register to switch the fuel gauge chip from its default initial state to a data communication and interaction state, preparing for the subsequent acquisition of raw battery data.

[0077] By following the steps above, after the fuel gauge chip is powered on, curve data matching the battery characteristics can be written into the chip, and the chip can be switched to the data interaction state. This ensures that subsequent battery data acquisition and power calculation are based on accurate battery characteristic parameters, reduces initialization errors, and improves the reliability and accuracy of battery status monitoring.

[0078] Based on the first embodiment described above, in this embodiment, step S1 includes:

[0079] S11: If the fuel gauge chip is in a data interaction state, determine the target register address of the fuel gauge chip based on the embedded controller;

[0080] S12: Send a data read request to the fuel gauge chip based on the target register address;

[0081] S13: Receive the raw register data returned by the fuel gauge chip in response to the data read request, and extract the raw battery data from the raw register data.

[0082] It should be noted that the target register address refers to the address of the register unit inside the fuel gauge chip used to store specific battery state data. A data read request is a communication command issued by the embedded controller to the fuel gauge chip. Raw register data is the unprocessed data value directly returned by the fuel gauge chip's registers.

[0083] Specifically, when the fuel gauge chip is in data interaction mode, the embedded controller determines the type and address of the registers to be accessed based on the battery data acquisition requirements, such as the address of a register used to store voltage, current, or temperature. After obtaining the target register address, the embedded controller sends a data read request to the fuel gauge chip via the bus, requesting the chip to return the data stored in the target register, thus initiating the data interaction process. Upon receiving the read request, the fuel gauge chip returns the raw register data from the target register to the embedded controller via the bus. After receiving the data, the controller extracts the raw battery data related to the battery state from the returned data and stores it in an internal cache for subsequent calculations.

[0084] Through this step, the embedded controller can access the target register and extract the original battery data as needed when the fuel gauge chip is in a data interaction state, realizing direct acquisition of the real-time status of the battery. This ensures that the acquired data is complete and of clear origin, providing a reliable data foundation for subsequent calculation of basic battery information and power monitoring, thereby improving the real-time performance and accuracy of battery power monitoring.

[0085] In this embodiment, when the fuel gauge chip is in a data interaction state, the embedded controller interacts with the fuel gauge chip to obtain the raw battery data stored in the fuel gauge chip's register. Based on the raw battery data, basic battery information is determined, including battery voltage, battery current, and battery temperature. Based on this basic information, the battery level is determined. Based on the battery level information, the battery level data is updated in the embedded controller. This embodiment obtains the raw battery data stored in the register by the embedded controller when the fuel gauge chip is in a data interaction state, allowing battery voltage, current, and temperature information to be directly determined from the raw data. The embedded controller then determines the battery level information based on the basic information and updates the battery level data. Through the sequential execution of these steps, the battery level data is calculated step-by-step from the real-time acquired raw data and updated in the controller, reducing data lag or processing deviations, thereby improving the accuracy of battery level monitoring.

[0086] Based on the second embodiment described above, a third embodiment of the battery power monitoring method based on an embedded controller is proposed in this application. Please refer to... Figure 3 , Figure 3 This is a schematic diagram of a sub-process in the third embodiment of the battery power monitoring method based on an embedded controller in this application.

[0087] In this embodiment, step S2 includes:

[0088] S21: Extract voltage-related data from the original battery data and determine the battery voltage information according to a preset conversion relationship;

[0089] S22: Based on the battery voltage information and combined with the current-related data in the original battery data, determine the battery current information;

[0090] S23: Based on the battery voltage information and the battery current information, process the temperature-related data in the original battery data to determine the battery temperature information;

[0091] S24: Use the battery voltage information, the battery current information, and the battery temperature information as the battery basic information.

[0092] It should be noted that voltage-related data refers to the numerical information used to calculate the battery terminal voltage from the raw battery data returned by the fuel gauge chip. Preset conversion relationships are proportional or parametric relationships pre-stored in the embedded controller to convert raw register values ​​into actual voltage, current, or temperature. Battery voltage information is the numerical information representing the battery terminal voltage obtained after conversion from the raw voltage-related data. Battery current information is the numerical information representing the current charging / discharging current of the battery, obtained by combining battery voltage information and current-related data. Battery temperature information is the numerical information representing the battery temperature state obtained by processing temperature-related data, based on the battery voltage and current information. Basic battery information is a collection including battery voltage information, battery current information, and battery temperature information.

[0093] Specifically, the embedded controller extracts voltage-related data from the raw battery data returned by the fuel gauge chip and converts this raw value into the actual battery terminal voltage using a pre-set conversion relationship, forming battery voltage information. After obtaining the battery voltage information, the controller reads current-related data from the raw battery data and, in conjunction with the battery voltage information, calculates the battery current information using a pre-set conversion relationship to reflect the current charging and discharging state of the battery. The controller further processes the temperature-related data in the raw battery data based on the battery voltage and current information to obtain battery temperature information. Subsequently, the battery voltage, current, and temperature information are organized to form basic battery information and stored for subsequent power calculations.

[0094] Through this step, the raw battery data is sequentially converted into battery voltage, battery current, and battery temperature information, and then summarized into basic battery information, achieving a complete and accurate representation of the battery's current state. This process ensures that the input data used for subsequent battery capacity calculations comes from real-time collected and processed basic information, thus guaranteeing the accuracy and reliability of battery capacity monitoring.

[0095] Based on the second embodiment described above, in this embodiment, step S3 includes:

[0096] S31: Based on the battery current information in the battery basic information, adjust the full charge capacity of the battery, and based on the adjusted full charge capacity, determine whether the battery is in the full charge stage.

[0097] S32: If so, update the phased battery power value based on the battery voltage information and the battery current information;

[0098] S33: When a jump in the phased battery power value is detected, the phased battery power value is smoothed based on the battery temperature information to obtain the battery power information.

[0099] It should be noted that full charge capacity refers to the maximum usable capacity the battery can achieve under current usage conditions. The staged battery capacity value is calculated based on the battery's basic information during the current charge / discharge phase. The battery capacity information is a smoothed and updated value that accurately represents the remaining battery capacity. A jump refers to a sudden, discontinuous increase or decrease in the staged battery capacity value within a short period. Smoothing refers to the processing of the detected staged battery capacity values.

[0100] Specifically, the embedded controller first dynamically adjusts the battery's full-charge capacity based on the battery current information in the battery's basic information to reflect the battery's available capacity under different discharge current conditions. Then, the controller determines whether the battery has entered the full-charge stage based on the adjusted full-charge capacity and the current battery state, providing conditions for subsequent power level updates. When the battery is determined to be in the full-charge stage, the controller uses battery voltage and current information to calculate the current stage battery power value and updates the previously recorded power value, thereby obtaining a stage battery power value that matches the current charging state. The controller continuously monitors changes in the stage battery power value. When a sudden jump is detected, it smooths the stage battery power value based on battery temperature information, eliminating abnormal fluctuations and generating the final battery power information for subsequent power display or system management.

[0101] Through the above steps, the battery power calculation process can dynamically consider the impact of current on the full-charge capacity and update the power level during the full-charge phase. Simultaneously, temperature-assisted smoothing suppresses sudden changes in power level. This method ensures that battery power information is derived from a comprehensive assessment of voltage, current, and temperature, reducing power estimation errors and maintaining the continuity of data changes, thereby improving the accuracy and stability of battery power monitoring.

[0102] In this embodiment, step S31 includes:

[0103] S311: Obtain the battery current information from the battery basic information, and determine the target full charge capacity by combining it with the preset current capacity correspondence;

[0104] S312: Update the target full charge capacity to the current full charge capacity, and determine the current charging status based on the current full charge capacity and the battery voltage information;

[0105] S313: Based on the correspondence between the current charging state and the current full charge capacity, determine whether the battery has entered the full charge stage.

[0106] It should be noted that the current-capacity correspondence is a pre-defined mapping relationship used to determine the corresponding target full-charge capacity based on the battery current. The target full-charge capacity is the theoretical maximum usable capacity under this operating condition, calculated based on the current battery current information. The current full-charge capacity is the battery's usable capacity value updated in real time by the embedded controller. The current charging state is the battery charging stage determined based on the battery voltage information and the current full-charge capacity. The full-charge stage refers to the stage where the battery is close to or has reached a fully charged state.

[0107] Specifically, the embedded controller first extracts battery current information from the battery's basic information and calculates the target full-charge capacity based on a preset current-capacity correspondence, reflecting the theoretical usable capacity of the battery under the current charging or discharging conditions. The controller updates the target full-charge capacity to the current full-charge capacity, and then, based on the battery voltage information, calculates and determines the current charging state to determine whether the battery is in a normal charging, near-full charging, or full-charge stage. Based on the correspondence between the current charging state and the current full-charge capacity, the controller further determines whether the battery has entered the full-charge stage, providing a basis for subsequent battery capacity updates or takeover calculations.

[0108] Through the above steps, the embedded controller can dynamically adjust the battery's full charge capacity based on current changes and determine the charging status by combining voltage information, thereby accurately identifying whether the battery has entered the full charge stage. This method makes battery status determination more consistent with actual working conditions, providing a reliable basis for subsequent power level updates, thus improving the accuracy and stability of battery power monitoring and management.

[0109] In this embodiment, when the fuel gauge chip is in a data interaction state, the embedded controller interacts with the fuel gauge chip to obtain the raw battery data stored in the fuel gauge chip's register. Based on the raw battery data, basic battery information is determined, including battery voltage, battery current, and battery temperature. Based on this basic information, the battery level is determined. Based on the battery level information, the battery level data is updated in the embedded controller. This embodiment obtains the raw battery data stored in the register by the embedded controller when the fuel gauge chip is in a data interaction state, allowing battery voltage, current, and temperature information to be directly determined from the raw data. The embedded controller then determines the battery level information based on the basic information and updates the battery level data. Through the sequential execution of these steps, the battery level data is calculated step-by-step from the real-time acquired raw data and updated in the controller, reducing data lag or processing deviations, thereby improving the accuracy of battery level monitoring.

[0110] This application also provides a battery power monitoring device based on an embedded controller. Please refer to... Figure 4 , Figure 4 This is a schematic diagram of the module structure of a battery power monitoring device based on an embedded controller according to an embodiment of this application. The device is applied to an electronic device containing a fuel gauge chip. The battery power monitoring device based on the embedded controller includes:

[0111] The data interaction module 401 is used to interact with the fuel gauge chip through the embedded controller to obtain the original battery data stored in the register of the fuel gauge chip if the fuel gauge chip is in a data interaction state.

[0112] The basic information module 402 is used to determine the basic information of the battery based on the original battery data. The basic information of the battery includes battery voltage information, battery current information and battery temperature information.

[0113] The power information module 403 is used to determine the battery power information based on the battery basic information;

[0114] The target module 404 is used to update the battery power data in the embedded controller based on the battery power information.

[0115] The battery power monitoring device based on an embedded controller provided in this application adopts the battery power monitoring method based on an embedded controller in the above embodiments, and can solve the technical problem of how to improve the accuracy of battery power monitoring. Compared with the prior art, the beneficial effects of the battery power monitoring device based on an embedded controller provided in this application are the same as the beneficial effects of the battery power monitoring method based on an embedded controller provided in the above embodiments, and other technical features in the battery power monitoring device based on an embedded controller are the same as the features disclosed in the methods of the above embodiments, and will not be repeated here.

[0116] This application provides a battery power monitoring device based on an embedded controller. The battery power monitoring device based on an embedded controller includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the battery power monitoring method based on the embedded controller in the above embodiment.

[0117] The following is for reference. Figure 5 , Figure 5 This is a schematic diagram of the hardware operating environment involved in the battery power monitoring method based on an embedded controller in the embodiments of this application. It shows a schematic diagram of the structure of the battery power monitoring device based on an embedded controller suitable for implementing the embodiments of this application. Figure 5 The battery power monitoring device based on an embedded controller shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0118] like Figure 5As shown, the battery power monitoring device based on an embedded controller may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the battery power monitoring device based on the embedded controller. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the embedded controller-based battery power monitoring device to communicate wirelessly or wiredly with other devices to exchange data. Although various systems are shown in the figure for embedded controller-based battery power monitoring devices, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems can be implemented alternatively.

[0119] In particular, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. When the computer program is executed by the processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0120] The battery power monitoring device based on an embedded controller provided in this application, employing the battery power monitoring method based on an embedded controller as described in the above embodiments, can solve the technical problem of how to improve the accuracy of battery power monitoring. Compared with the prior art, the beneficial effects of the battery power monitoring device based on an embedded controller provided in this application are the same as those of the battery power monitoring method based on an embedded controller provided in the above embodiments, and other technical features of this battery power monitoring device based on an embedded controller are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0121] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0122] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0123] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the battery power monitoring method based on an embedded controller in the above embodiments.

[0124] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by a battery power monitoring device based on an embedded controller, the device causes the following: when the fuel gauge chip is in a data interaction state, the device interacts with the fuel gauge chip through the embedded controller to obtain raw battery data stored in the fuel gauge chip's register; based on the raw battery data, it determines basic battery information, including battery voltage, battery current, and battery temperature; based on the basic battery information, it determines battery power information; and based on the battery power information, it updates the battery power data in the embedded controller. Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof. These programming languages ​​include object-oriented programming languages—such as Java, Smalltalk, and C++—and conventional procedural programming languages—such as C or similar languages. The program code can be executed entirely on a user's computer, partially on a user's computer, as a standalone software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer through any type of network—including a local area network (LAN) or a wide area network (WAN)—or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0126] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0127] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described battery power monitoring method based on an embedded controller, thereby solving the technical problem of how to improve the accuracy of battery power monitoring. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the battery power monitoring method based on an embedded controller provided in the above embodiments, and will not be repeated here.

[0128] This application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the battery power monitoring method based on an embedded controller as described above.

[0129] The computer program product provided in this application can solve the technical problem of how to improve the accuracy of battery power monitoring. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the battery power monitoring method based on embedded controller provided in the above embodiments, and will not be repeated here.

[0130] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent scope of this application.

Claims

1. A battery power monitoring method based on an embedded controller, characterized in that, The method is applied to an electronic device containing a fuel gauge chip, and the method includes: If the fuel gauge chip is in a data interaction state, the embedded controller interacts with the fuel gauge chip to obtain the original battery data stored in the fuel gauge chip's register. Based on the original battery data, the basic battery information is determined, including battery voltage information, battery current information, and battery temperature information. Based on the aforementioned basic battery information, determine the battery power information; Based on the battery power information, the battery power data is updated in the embedded controller.

2. The method as described in claim 1, characterized in that, Before the step of obtaining the original battery data stored in the fuel gauge chip's register by interacting with the fuel gauge chip through the embedded controller when the fuel gauge chip is in a data interaction state, the method further includes: Detect the power-on status of the fuel gauge chip; Based on the power-on state, preset battery curve data is written into the register of the fuel gauge chip; After the writing is completed, the control unit puts the fuel gauge chip into the data interaction state.

3. The method as described in claim 1, characterized in that, The step of obtaining the original battery data stored in the battery chip register by interacting with the embedded controller through the data interaction state of the fuel gauge chip when the fuel gauge chip is in a data interaction state includes: If the fuel gauge chip is in a data interaction state, the target register address of the fuel gauge chip is determined based on the embedded controller; Based on the target register address, a data read request is sent to the fuel gauge chip; The system receives the raw register data returned by the fuel gauge chip in response to the data read request, and extracts the raw battery data from the raw register data.

4. The method as described in claim 1, characterized in that, The step of determining basic battery information based on the original battery data, wherein the basic battery information includes battery voltage information, battery current information, and battery temperature information, includes: Voltage-related data are extracted from the original battery data, and battery voltage information is determined according to a preset conversion relationship; Based on the battery voltage information, and combined with the current-related data in the original battery data, the battery current information is determined; Based on the battery voltage information and the battery current information, the temperature-related data in the original battery data is processed to determine the battery temperature information; The battery voltage information, the battery current information, and the battery temperature information are used as the basic information of the battery.

5. The method as described in claim 1, characterized in that, The step of determining the battery power information based on the battery basic information includes: Based on the battery current information in the battery basic information, the full charge capacity of the battery is adjusted, and based on the adjusted full charge capacity, it is determined whether the battery is in the full charge stage. If so, update the phased battery charge value based on the battery voltage information and the battery current information; When a jump in the staged battery power value is detected, the staged battery power value is smoothed based on the battery temperature information to obtain the battery power information.

6. The method as described in claim 5, characterized in that, The step of adjusting the battery's full-charge capacity based on the battery current information in the battery's basic information, and determining whether the battery is in a full-charge stage based on the adjusted full-charge capacity, includes: Obtain the battery current information from the battery basic information, and determine the target full charge capacity by combining it with the preset current capacity correspondence; Update the target full charge capacity to the current full charge capacity, and determine the current charging status based on the current full charge capacity and the battery voltage information; Based on the correspondence between the current charging state and the current full charge capacity, it is determined whether the battery has entered the full charge stage.

7. A battery power monitoring device based on an embedded controller, characterized in that, The device is applied to an electronic device containing a fuel gauge chip, and the device includes: The data interaction module is used to interact with the fuel gauge chip through the embedded controller and obtain the original battery data stored in the register of the fuel gauge chip if the fuel gauge chip is in the data interaction state. The basic information module is used to determine the basic information of the battery based on the original battery data. The basic information of the battery includes battery voltage information, battery current information and battery temperature information. The power information module is used to determine the battery power information based on the battery basic information; The target module is used to update the battery power data in the embedded controller based on the battery power information.

8. A computer device, characterized in that, The device includes: a memory, a processor, and a battery power monitoring program based on an embedded controller stored in the memory and executable on the processor, the battery power monitoring program based on the embedded controller being configured to implement the steps of the battery power monitoring method based on an embedded controller as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium stores a battery power monitoring program based on an embedded controller, which, when executed by a processor, implements the steps of the battery power monitoring method based on an embedded controller as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the battery power monitoring method based on an embedded controller as described in any one of claims 1 to 6.