Battery remaining power detection system based on portable electronic equipment
By automatically triggering battery detection, dynamic load adjustment, and feature extraction in portable electronic devices, and combining existing hardware resources to detect remaining battery capacity, the problem of low resource utilization is solved, and efficient and economical battery capacity detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN YUWEN MEASUREMENT TECH CO LTD
- Filing Date
- 2026-03-09
- Publication Date
- 2026-04-24
AI Technical Summary
Existing battery level detection solutions fail to fully utilize the hardware resources of portable electronic devices, such as analog-to-digital converters, processors, and display modules. They require dedicated testing equipment, resulting in low resource utilization and high testing complexity and cost.
The battery detection is automatically triggered by the mode triggering module, the signal parallel module collects the voltage signals from the internal sensors and the external battery in parallel, the dynamic load adjustment module controls the load current, the feature extraction module analyzes the voltage decay characteristics, the power calculation module performs pattern matching and load sequence reconstruction, and the result display module displays the remaining battery power.
This technology enables accurate battery level detection using existing hardware resources without adding dedicated detection circuits, improving resource utilization, reducing system resource consumption, and ensuring the reliability and economy of the detection results.
Smart Images

Figure CN121918009A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of battery remaining capacity detection technology, and more specifically to a battery remaining capacity detection system based on portable electronic devices. Background Technology
[0002] In recent years, with the widespread application of portable electronic devices, battery-powered systems have become a core component of various portable electronic devices. In the fields of environmental monitoring instruments, portable medical devices, smart home sensors, and handheld testing instruments, most devices rely on small batteries for power. These devices typically include core components such as microcontrollers (single-chip microcomputers), ADC modules, sensor modules, display modules, and power management modules. Some microcontrollers integrate ADC modules, eliminating the need for a separate ADC module. The ADC module is used to acquire and process various analog sensor signals.
[0003] Currently, battery capacity testing primarily employs techniques such as voltage detection, coulomb counting, and electrochemical impedance spectroscopy. Voltage detection estimates remaining capacity by measuring battery terminal voltage, and this method is simple to implement and relatively inexpensive. Coulomb counting calculates remaining capacity by accumulating battery discharge, providing relatively accurate measurement results. Electrochemical impedance spectroscopy assesses battery condition by analyzing the battery's internal impedance characteristics. These techniques are widely used in dedicated battery capacity testing equipment.
[0004] As can be seen from the above, existing technical solutions have certain limitations in implementation. These solutions fail to fully utilize the existing hardware resources of portable electronic devices to achieve battery level detection, often requiring dedicated battery level detection equipment. Dedicated battery level detection equipment typically requires significant hardware and software resources to perform battery level detection. For example, the accuracy of voltage detection methods is easily affected by battery load status and ambient temperature, requiring complex compensation algorithms. Coulomb counting methods require continuous current monitoring and data recording, placing high demands on system resources. Electrochemical impedance analysis requires dedicated detection circuitry, increasing system complexity and cost. Therefore, conventional methods in dedicated battery level detection equipment consume substantial hardware and software resources. Summary of the Invention
[0005] The purpose of this invention is to provide a battery remaining capacity detection system based on portable electronic devices, solving the following technical problems: Existing solutions fail to fully utilize the existing hardware resources of portable electronic devices, such as analog-to-digital converters, processors, and display modules. They require dedicated battery level detection equipment and rely on independent dedicated detection circuits, which limits the utilization rate and functional density of the hardware and software resources of portable electronic devices.
[0006] The objective of this invention can be achieved through the following technical solutions: A battery remaining capacity detection system for portable electronic devices includes: The mode trigger module is used to automatically trigger the battery detection mode after the device is powered on, while recording the device status data at the trigger time and saving the current working parameters. The parallel signal module is used to extend the input signal source of the analog-to-digital converter from the internal sensor signal to the external battery voltage signal, and establish a voltage sampling path; The dynamic load regulation module is used to control the load circuit to generate load currents of different intensities. It collects multiple sets of voltage sampling values under load conditions through the analog-to-digital converter module to obtain the voltage performance data of the battery under different operating conditions. The feature extraction module is used to construct the battery dynamic response mode based on multiple sets of voltage sampling values, analyze the voltage decay characteristics during load changes, and extract multi-dimensional feature parameters of the battery. The power calculation module is used to perform pattern matching between multi-dimensional feature parameters and a pre-stored battery feature library, and calculate the remaining battery power through a load sequence reconstruction algorithm. The results display module is used to simultaneously display the remaining battery power and load characteristic curves on the device's display screen.
[0007] As a further aspect of the present invention: the specific process by which the battery detection mode is automatically triggered after the device is powered on in the mode triggering module is as follows: The device performs a power-on self-test process, initializes the battery detection function during the self-test, records the power-on timestamp and initial device status parameters, monitors the device runtime and sets a timed detection cycle. When the preset time threshold is reached, the battery detection process is automatically started, the current device operating parameters are saved to the specified storage area, and the configuration parameters required for battery detection are loaded.
[0008] As a further aspect of the present invention: in the parallel signal module, the specific process of extending the input signal source from the internal sensor signal to the external battery voltage signal is as follows: Configure multiple input channels for the analog-to-digital converter, synchronously maintain the path connection between internal sensor signals and external battery voltage signals, set independent sampling timing for each signal channel, allocate a dedicated data buffer area to store multi-channel sampling data, establish a cross-checking mechanism between signal channels, monitor the signal quality indicators of each channel in real time, and maintain the stable operation of the parallel signal path.
[0009] As a further aspect of the present invention: the specific process by which the dynamic load adjustment module obtains the voltage performance data of the battery under different operating states is as follows: The load resistance network is controlled according to the preset load sequence configuration file. The intensity level of the load current is adjusted in stages and the adjustment time point is recorded. Voltage transient response waveform data under each load level is collected, the stability characteristic parameters of the voltage waveform are analyzed, the execution time interval of the load sequence is dynamically adjusted, a mapping relationship table between load current and voltage response is established, and a complete data record of the load regulation process is generated.
[0010] As a further aspect of the present invention: the specific process of extracting multi-dimensional feature parameters of the battery in the feature extraction module is as follows: Based on multiple sets of voltage sampling values, a dynamic response mode of the battery under load changes is constructed. The distribution trajectory of voltage sampling points in the load-voltage coordinate system is plotted, the voltage decay rate with load changes is calculated, the morphological characteristics of the voltage decay trajectory are analyzed, the coordinates of key points of trajectory curvature change are extracted, the slope change between adjacent key points is calculated, a set of feature parameters of the dynamic response mode is constructed, the set of feature parameters is normalized, and multi-dimensional feature parameters are output.
[0011] As a further aspect of the present invention: the specific process of constructing the dynamic response mode of the battery during load changes is as follows: Acquire load sequence data and corresponding voltage sampling values, plot continuous trajectory curves in the load-voltage coordinate system, divide the load change process into multiple stages, calculate the average rate of change of voltage in each stage, mark the voltage inflection points at stage transitions, calculate the curvature value at the inflection points, analyze the trajectory morphology between adjacent inflection points, construct a feature descriptor for the trajectory morphology, and verify the integrity of the feature descriptor.
[0012] As a further aspect of the present invention: the specific process of calculating the remaining battery power using the load sequence reconstruction algorithm in the power calculation module is as follows: Multi-dimensional feature parameters are matched with a pre-stored battery feature library at multiple levels. A virtual load scenario is generated based on a load sequence reconstruction algorithm. The predicted voltage response value under the virtual load scenario is calculated. The similarity between the predicted value and the actual sampled value in the feature library is compared. The feature library sample with the highest similarity is selected to construct a reference set. The power value under the current state is calculated through the load-power mapping relationship. The calculation result is corrected by combining the battery degradation characteristics in historical detection data. The sample usage record in the feature library is updated.
[0013] As a further aspect of the present invention: the specific process of the load sequence reconstruction algorithm is as follows: Analyze the load intensity distribution characteristics of the current load sequence, extract the load switching time interval statistics, generate a virtual load intensity sequence based on the load intensity distribution characteristics, set the virtual load duration according to the load switching time interval, calculate the expected voltage response curve under the virtual load sequence, perform morphological matching between the expected voltage response curve and the actual curve in the feature library, select the actual curve with the highest morphological matching degree as the reference benchmark, and reconstruct the load-power mapping relationship based on the reference benchmark.
[0014] The beneficial effects of this invention are: This invention generates multi-intensity load currents and collects corresponding voltage sampling values through a dynamic load adjustment module, constructs a battery dynamic response mode and extracts multi-dimensional feature parameters through a feature extraction module, and uses a power calculation module to perform pattern matching and load sequence reconstruction calculations, thereby achieving accurate detection of battery remaining capacity under complex load conditions.
[0015] This invention maximizes the use of existing hardware resources such as analog-to-digital converters, processors, and display modules in the device. Through resource sharing and function reuse, it achieves complete battery level detection without adding dedicated detection circuitry. Specifically, a signal parallel module enables hardware sharing between the detection function and the main functions of the device. This allows the same set of analog-to-digital converters, processing, and display resources to serve both the main functions and battery detection needs, effectively avoiding the increased cost and size associated with dedicated detection circuitry. Employing multi-level pattern matching and virtual load scenario generation technologies, it fully utilizes the device's existing computing power to perform complex algorithm calculations, effectively overcoming the limitations of traditional voltage detection methods that are affected by load status and ambient temperature. It achieves accurate measurement without requiring continuous current monitoring and complex compensation algorithms. By combining a battery feature library and a load sequence reconstruction algorithm, it significantly reduces system resource consumption while maintaining detection accuracy. The entire solution, through the collaborative work of its modules, achieves efficient integration of battery level detection functionality in a multi-functional integrated device. This fully leverages the potential of existing hardware resources, improves resource utilization efficiency, and ensures the reliability of detection results, providing an economical and practical battery management solution for portable electronic devices. Attached Figure Description
[0016] The invention will now be further described with reference to the accompanying drawings.
[0017] Figure 1 This is a schematic diagram of the modules of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Please see Figure 1 As shown, the present invention is a battery remaining capacity detection system for portable electronic devices, comprising: The mode trigger module is used to automatically trigger the battery detection mode after the device is powered on, while recording the device status data at the trigger time and saving the current working parameters. The parallel signal module is used to extend the input signal source of the analog-to-digital converter from the internal sensor signal to the external battery voltage signal, and establish a voltage sampling path; The dynamic load regulation module is used to control the load circuit to generate load currents of different intensities. It collects multiple sets of voltage sampling values under load conditions through the analog-to-digital converter module to obtain the voltage performance data of the battery under different operating conditions. The feature extraction module is used to construct the battery dynamic response mode based on multiple sets of voltage sampling values, analyze the voltage decay characteristics during load changes, and extract multi-dimensional feature parameters of the battery. The power calculation module is used to perform pattern matching between multi-dimensional feature parameters and a pre-stored battery feature library, and calculate the remaining battery power through a load sequence reconstruction algorithm. The results display module is used to simultaneously display the remaining battery power and load characteristic curves on the device's display screen.
[0020] In a preferred embodiment of the present invention, the specific process of automatically triggering the battery detection mode after the device is powered on in the mode triggering module is as follows: The system first executes a complete power-on self-test (POST) procedure. During the POST, the processor reads the device configuration parameters stored in non-volatile memory and initializes the hardware resources required for the battery detection function. This includes configuring the analog-to-digital converter's operating mode, setting voltage sampling parameters, and allocating memory space for storing the test data.
[0021] After completing basic hardware initialization, the system immediately records the power-on timestamp and initial device status parameters. The timestamp data comes from the device's internal real-time clock chip, ensuring the accuracy of the time recording. The initial device status parameters include the power supply voltage value, ambient temperature reading, and the initial status of each sensor module. This data is stored in a specific sector of non-volatile memory for subsequent analysis.
[0022] To enable timed detection, the system incorporates a runtime monitoring mechanism. This mechanism records the device's continuous running time using a system clock counter and compares it to a preset detection time threshold. The time threshold is set based on the device type and usage scenario and stored in the device's configuration parameter area. When the runtime reaches the preset threshold, the system automatically initiates the battery detection process without manual user intervention.
[0023] Before initiating the battery testing process, the system first saves the current device operating parameters. These parameters include the operating status of each sensor, intermediate data processing results, and temporary variables during system operation. The saving process is implemented through direct memory access, ensuring efficient and complete data transfer. All parameters are centrally stored in a specially designated storage area with data backup and recovery capabilities.
[0024] The system then loads the configuration parameters required for battery detection from non-volatile memory. These parameters include the voltage sampling frequency, load adjustment sequence, feature extraction algorithm parameters, and power calculation model coefficients. During loading, the system verifies the completeness and validity of the parameters; if any abnormal parameters are found, default parameters are used instead.
[0025] Finally, the system allocates independent runtime resources for the battery detection task through the memory management unit. This includes allocating a high-speed cache area for real-time data acquisition, computing resources for the feature extraction algorithm, and a display cache for displaying detection results. Resource allocation employs a dynamic priority management mechanism to ensure resource coordination between the battery detection task and the device's main functions. The entire initialization process runs in the system background and does not affect the normal operation of the device.
[0026] In another preferred embodiment of the present invention, the specific process of extending the input signal source from the internal sensor signal to the external battery voltage signal in the signal parallel module is as follows: First, the multiple input channels of the analog-to-digital converter are configured in hardware, and the operating parameters of each channel, including input impedance and sampling accuracy, are set. At the physical connection level, the internal sensor signal path and the external battery voltage signal path are kept synchronously connected. The two paths are connected in parallel through an analog switch array, avoiding the method of selecting a single signal source by switching operation in traditional solutions.
[0027] During signal acquisition, the system sets independent sampling timing sequences for the internal sensor signal channel and the external battery voltage signal channel. The sampling frequency of the internal sensor signal channel is configured according to the requirements of the device's main functions, while the sampling parameters of the external battery voltage signal channel are set according to the battery detection requirements. The sampling timing sequences of the two channels are coordinated through a precise clock synchronization mechanism to ensure that the sampling process does not interfere with each other.
[0028] The system allocates dedicated data buffer areas for multi-channel sampling data, with internal sensor sampling data and external battery voltage sampling data stored in different memory blocks. Each data buffer has independent read / write pointers and a management state machine to ensure ordered data access. The data buffers employ a circular queue structure to support automatic updates of new and old data.
[0029] To monitor signal quality, the system establishes a cross-validation mechanism between signal channels. This mechanism verifies the rationality of signal acquisition by comparing the sampling data characteristics of two channels at adjacent time points. When an abnormal data pattern is detected, the system initiates a self-check program to investigate potential problems in the signal path.
[0030] The system monitors the signal quality indicators of each channel in real time, including signal amplitude range, noise level, and stability parameters. The monitoring data is sent to a dedicated quality assessment unit for analysis, and the operating parameters of each channel are dynamically adjusted based on the analysis results. When the signal quality of a channel fails to meet requirements, the system automatically activates a backup plan to ensure continuous data acquisition.
[0031] Throughout operation, the system maintains stable operation of the parallel signal paths through multiple measures. These include periodically calibrating the reference voltage of each channel, monitoring the impact of power supply fluctuations on sampling accuracy, and implementing temperature compensation measures. The system also has a comprehensive fault detection and handling mechanism, capable of promptly identifying and isolating anomalies in the signal paths, ensuring long-term reliable operation.
[0032] In another preferred embodiment of the present invention, the specific process of obtaining battery voltage performance data under different operating states in the dynamic load adjustment module is as follows: The dynamic load regulation module achieves precise output of multi-intensity load currents and complete acquisition of corresponding voltage response data through a programmable load network and closed-loop control mechanism. Its technical implementation includes load network control, current grading regulation, transient waveform acquisition, stability analysis, interval adjustment, mapping table establishment, and data recording generation. The module's load network consists of multiple precision metal film resistors with different resistance values. Each resistor is connected in series with an N-channel MOSFET. The gate of the MOSFET is connected to the GPIO pin of the microcontroller through a driver circuit. The microcontroller controls the conduction and cutoff of the MOSFET by outputting high and low level signals, thereby combining different resistors to adjust the load resistance value and ultimately change the load current.
[0033] The preset load sequence configuration file is stored in a dedicated partition of non-volatile memory. The file uses a structured format and includes parameters such as a list of load current levels, the duration of each level, the switching order, and the allowable current deviation range. During module initialization, the microcontroller loads the configuration parameters into its internal cache via a file read interface. The cache uses a circular queue structure to ensure the sequential and continuous reading of parameters. After loading is complete, the microcontroller initializes the load sequence generator, setting the current load level as the initial level. The initial level is typically the lowest load current level to avoid instantaneous impact on the battery from high load current.
[0034] The graded adjustment of the load current employs closed-loop control logic. The microcontroller first estimates the required load resistance combination based on the target current value corresponding to the current load level and the current battery voltage. Then, it outputs a control signal to drive the corresponding MOSFET to conduct, forming a load loop. Simultaneously, a high-precision current sensor, such as an ACS712, is connected in series in the load loop. The current sensor acquires the actual load current value in real time, converts it into a voltage signal, and transmits it to the analog-to-digital converter (ADC). The ADC converts the voltage signal into a digital value and feeds it back to the microcontroller. The microcontroller compares the actual current value with the target current value. If the deviation exceeds the allowable deviation range in the configuration file, it recalculates the load resistance combination and adjusts the MOSFET's conduction state until the deviation between the actual current value and the target current value is controlled within the allowable range. After adjustment, the microcontroller reads the time data from the device's internal RTC module, records the adjustment time point of the current load level with millisecond accuracy, and stores it in association with the current load current parameters.
[0035] The voltage transient response waveform data is acquired using a high-speed sampling mode. Immediately after the load current adjustment is complete, the microcontroller sends a high-speed sampling command to the analog-to-digital converter (ADC), increasing the sampling frequency to 1kHz-10kHz. The specific frequency is determined based on the battery voltage response speed, ensuring the complete process of voltage change and stabilization is captured. During sampling, the ADC transmits the sampled data in real-time to a dedicated buffer in RAM via a DMA channel. The buffer employs a double-buffering mechanism: one buffer for data acquisition and another for data processing, preventing data loss. The sampling duration is set based on the voltage stabilization time under the previous load level, typically 1.5 times the stabilization time, ensuring coverage of the entire voltage transient response process.
[0036] The analysis of voltage waveform stability characteristic parameters is performed by the data processing unit. The unit reads temporarily stored waveform data from a double buffer, first filtering high-frequency noise using a moving average algorithm, and then extracting three core parameters: voltage stability value, fluctuation amplitude, and fluctuation frequency. The voltage stability value is the average voltage value over a period after the waveform stabilizes; the stable period selects the last 10% of the waveform's sampled data. The fluctuation amplitude is the difference between the maximum and minimum voltage values during the stable period. The fluctuation frequency is the ratio of the number of voltage fluctuation cycles to the time during the stable period, calculated by counting the number of zero-crossing points of the waveform. These parameters, calculated by the data processing algorithm, are stored in the feature parameter buffer as input data for the subsequent feature extraction module.
[0037] The dynamic adjustment of the load sequence execution time interval is based on the voltage waveform settling time. After obtaining the settling time of the current load level, the microcontroller compares it with a preset interval reference value. If the settling time is greater than 1.2 times the interval reference value, the interval for the next load switch is extended by the difference between the settling time and the interval reference value. If the settling time is less than 0.8 times the interval reference value, the interval for the next load switch is shortened by the difference between the interval reference value and the settling time. If the settling time is within the range of 0.8-1.2 times the interval reference value, the interval remains unchanged. The interval reference value is preset according to the battery type. For example, for dry cell batteries, the reference value is set to 500 milliseconds. The adjusted interval time is updated through the microcontroller's internal timer to ensure that the voltage has been sufficiently stabilized before the next load switch.
[0038] The load current and voltage response mapping table is established using a two-dimensional data table structure. The row index of the data table is the load adjustment timestamp, and the column fields include the target load current value, actual load current value, stable voltage value, fluctuation amplitude, fluctuation frequency, and stabilization time. After the microcontroller completes adjustment and stability analysis for each load level, it writes the corresponding parameters row by row into the data table. The data table is stored in non-volatile memory using a circular overwrite mechanism; when the storage capacity reaches its limit, the oldest historical data is overwritten. Simultaneously, the data table supports index lookup, with the target load current value as the index key, facilitating quick lookup of the corresponding voltage response parameters by the subsequent power calculation module.
[0039] The generation of a complete data record for the load regulation process begins after the entire load sequence has been executed. The microcontroller integrates the load sequence configuration parameters, control commands for each load level, real-time monitoring data, and stability analysis results in chronological order to form a structured data file. The file header contains metadata such as the detection time, device number, battery model, and personnel identification. The file body arranges the parameters in timestamp order, and the data is in CSV format for easy data export and analysis. After the file is generated, it is stored to a specified storage path via the file system interface, and a file checksum is generated. The checksum is calculated using the CRC32 algorithm to verify file integrity and prevent errors during data transmission or storage.
[0040] In another preferred embodiment of the present invention, the specific process of extracting multi-dimensional feature parameters of the battery in the feature extraction module is as follows: The battery dynamic response mode is constructed using the output data from the dynamic load regulation module as input, and is completed through data processing and feature parsing. First, data acquisition and synchronization are performed. The feature extraction module accesses the non-volatile storage area of the dynamic load regulation module via the data bus, reading the load sequence data and corresponding voltage sample values. The load sequence data includes the target current value, actual current value, and regulation timestamp for each load level. The voltage sample values include transient and stable voltage data for each timestamp. The module uses a timestamp synchronization algorithm to align the two sets of data along the time dimension, ensuring a one-to-one match between load and voltage data. During synchronization, data verification is used to remove missing or duplicate timestamps, ensuring data validity.
[0041] The module then plots a load-voltage coordinate system trajectory. The horizontal axis represents the load current in amperes, and the vertical axis represents the battery voltage in volts. The module uses synchronized load-voltage data pairs as discrete sampling points and employs a linear interpolation algorithm to fill in the gaps between adjacent sampling points, forming a continuous trajectory curve. The interpolation step size is dynamically adjusted based on the sampling point density; a larger step size improves efficiency when sampling points are dense, and a smaller step size ensures a smooth trajectory when sampling points are sparse. The plotted trajectory curve is stored in the graphics buffer.
[0042] The load change phase segmentation uses a dynamic threshold combined with a sliding window algorithm, with the sliding window size covering 3-5 consecutive load adjustment cycles. The module analyzes the load current change rate through the window. When the change rate remains stable within a preset threshold, it is determined to be in the same phase. When it exceeds the threshold and continues for a set duration, it is determined to enter a new phase, dividing the load into a constant current phase, an increasing phase, and a decreasing phase. The start and end points of each phase are marked by the moment when the load change rate threshold is exceeded.
[0043] The average rate of change of voltage in each stage is calculated based on all voltage samples within the stage. First, the voltage values at the start and end of the stage are extracted and the difference is calculated. Then, the start and end timestamps are read to calculate the duration. Finally, all sample values within the stage are processed by a weighted average algorithm, and higher weights are given to sample values closer to the middle of the stage to obtain the corrected average rate of change, which is then stored in the stage feature table.
[0044] Voltage inflection point marking is achieved by comparing the average rate of change of adjacent stages. The difference in the rate of change between adjacent stages is calculated, and when the absolute value of the difference exceeds a preset threshold, the transition time point between the two stages is defined as the inflection point. The load and voltage values at the inflection point are extracted by associating timestamps to form a two-dimensional coordinate system. The curvature value of the inflection point is calculated using the three-point numerical differentiation method. Adjacent sampling points before and after the inflection point are selected to form a local curve segment, and the curvature value obtained by the algorithm reflects the degree of trajectory curvature.
[0045] Trajectory morphology analysis between adjacent turning points requires first connecting two points to form a baseline straight line, calculating the perpendicular distance from the trajectory sampling points to the baseline straight line, and statistically analyzing the positive / negative and absolute values of the distances. When the distances to most sampling points are positive and the absolute values are stable, it is determined to be a convex curve; when they are negative and stable, it is a concave curve; when the absolute value of the distance approaches zero, it is a linear trajectory. The trajectory morphology type and deviation statistics constitute the morphological characteristic items.
[0046] The feature descriptor adopts a structured format, containing parameters such as the number of stages, the average rate of change of duration of each stage, the coordinates and curvature values of inflection points, and the trajectory morphology type. The module checks whether the parameters are missing or contain outliers using a parameter integrity verification algorithm. If an outlier is found, the module returns to the dynamic load adjustment module to retrieve the data. After successful verification, the feature descriptor is stored in the feature database.
[0047] The specific process of constructing the dynamic response mode of the battery under load changes is as follows: First, calculate the attenuation rate of voltage as the load changes. Focus on the load increasing stage to extract the load-voltage sampling pair of that stage. Calculate the ratio of the voltage difference between adjacent sampling points to the load difference to obtain the instantaneous attenuation rate. Then, smooth the data using a moving average algorithm to obtain the average attenuation rate and the maximum attenuation rate, which are stored in the feature set.
[0048] The analysis of voltage decay trajectory morphology features begins with fluctuation amplitude and stability. Fluctuation amplitude is the difference between the maximum and minimum voltage sample values within a stage, while stability is calculated using the standard deviation of the voltage sample values. Together with the trajectory morphology type, these two factors constitute the morphological feature group.
[0049] The key point extraction of trajectory curvature changes covers turning points and curvature extrema. In addition to the marked turning points, the module traverses all sampling points of the trajectory, calculates the curvature value of each point using the five-point numerical differentiation method, identifies the maximum and minimum curvature points as extrema points through the extremum detection algorithm, extracts the two-dimensional coordinates of all key points and labels their types, and establishes a list of key point coordinates.
[0050] The calculation of slope change between adjacent key points requires selecting adjacent key points in ascending order of load, calculating the slope of the line connecting the two points respectively, and the difference between the latter slope and the former slope is the slope change. All changes are arranged in order to form a slope change characteristic sequence.
[0051] The module integrates average and maximum attenuation rates, standard deviation of fluctuation amplitude, trajectory morphology type, key point coordinate list, and slope change feature sequence to construct a set of feature parameters for the dynamic response mode. A min-max normalization algorithm is used to eliminate the influence of dimensions, and the value range of each parameter is determined based on the battery's rated parameters, mapping the parameters to the [0,1] interval. Finally, data verification ensures that the normalized parameters are within a reasonable range; after successful verification, multi-dimensional feature parameters are output to the power calculation module.
[0052] In another preferred embodiment of the present invention, the specific process of calculating the remaining battery power using the load sequence reconstruction algorithm in the power calculation module is as follows: The battery capacity calculation uses the multi-dimensional feature parameters output by the feature extraction module as the core input, and the first step is to perform multi-level pattern matching. The pre-stored battery feature library adopts a hierarchical architecture, including a base layer, a feature layer, and a morphology layer. The base layer stores static parameters such as battery model, rated voltage, and rated capacity; the feature layer stores feature parameters such as decay rate and slope change under different battery capacity states; and the morphology layer stores the corresponding load-voltage trajectory morphology data. After reading the multi-dimensional feature parameters through the data bus, the module first matches the battery model in the base layer to filter out the sample set of the same model; then, in the feature layer, it calculates the Euclidean distance between the input parameters and the sample features, retaining candidate samples with a distance less than a threshold; finally, in the morphology layer, it compares the trajectory curvature distribution to further narrow down the sample range, completing the multi-level screening.
[0053] The virtual load scenario generation relies on a load sequence reconstruction algorithm. The algorithm outputs a virtual load intensity sequence and duration parameters, which are then converted into a scenario configuration file by the module. This configuration file specifies the virtual load's startup timing and current level switching logic. Based on this, the module controls the virtual load simulation unit to construct a current output environment equivalent to the actual usage scenario. Simultaneously, the module calls the dynamic response model of the same battery model from the feature library, inputs the virtual load parameters, and generates predicted voltage response values under the virtual scenario through linear fitting and interpolation. These predicted values are sorted by timestamp to form a prediction curve, which is then stored in a temporary calculation buffer.
[0054] The similarity comparison between predicted and actual sampled values employs a dynamic time warping algorithm, which eliminates the influence of minor time-dimensional shifts. The module aligns the predicted curve with the actual sampled curves of candidate samples in the feature library, calculates the voltage difference between corresponding sampling points on the two curves, and obtains a quantized similarity value by summing the squares of these differences. A smaller quantized value indicates higher similarity. The module sorts the samples in ascending order of quantized values and selects the top N samples to construct a reference set. The value of N is dynamically adjusted by the sample density of the feature library to ensure the representativeness of the reference set.
[0055] The load-capacity mapping calculation is based on a reference set, extracting the load current, voltage response, and corresponding remaining capacity data for each sample in the set to establish a three-dimensional mapping model. The module inputs the currently detected actual load current and voltage values into the model, and through table lookup and interpolation, obtains a preliminary calculation result for the remaining capacity. Simultaneously, the module accesses the device's historical testing database, reads the battery's past 3-5 testing records, extracts capacity degradation trend data, and generates a degradation coefficient. The preliminary calculation result is multiplied by the degradation coefficient to correct the result; the corrected capacity value is retained to two decimal places to ensure accuracy.
[0056] The feature library sample usage record update is performed after the power consumption calculation is completed. The module locates the storage address of each sample in the reference set in the feature library, accumulates its usage count field, and updates the most recent usage timestamp. For samples whose usage count reaches a preset threshold, the module marks them as high-frequency samples, optimizes their storage index in the feature library, and improves subsequent matching efficiency. For samples that have not been used for a long time, if the feature library storage capacity is insufficient, they are cleaned up in the order of timestamp from earliest to latest to ensure dynamic optimization of the feature library.
[0057] The specific process of the load sequence reconstruction algorithm is as follows: The system reads load sequence data output from the dynamic load regulation module via a data interface, including target current values, actual current values, and switching timestamps for each load level. Statistical analysis algorithms are used to calculate load intensity distribution characteristics, statistically analyzing the duration percentage of each current level and the frequency of peak current occurrences, generating a distribution histogram. Simultaneously, switching time interval data is extracted, and the mean, variance, and extreme values of the intervals are calculated to establish a statistical model of the time intervals. The distribution characteristics and the statistical model together constitute a feature profile of the current load sequence.
[0058] The virtual load intensity sequence generation is based on feature profiling. The algorithm maintains the same current level distribution and peak current value as the current load, only randomly adjusting the order of occurrence of each level to avoid sequence homogenization. A random perturbation factor is introduced during the generation process, with the perturbation amplitude controlled within a preset proportion of the current load level, ensuring that the virtual sequence is both equivalent to the actual load and covers more potential usage scenarios. The sequence length is set according to the actual load sequence length, typically 1.2-1.5 times the actual length, ensuring sufficient data volume.
[0059] The virtual load duration is set based on a time interval statistical model, using the average interval calculated by the model as the base duration, and dynamically adjusted in conjunction with the virtual load intensity level. The duration of high-current loads is shortened by 0.8 times the average, while the duration of low-current loads is extended by 1.2 times the average, simulating the characteristics of high loads being short-duration and low loads being long-duration in actual use. The adjusted duration corresponds one-to-one with the virtual load level, forming a complete virtual load timing scheme.
[0060] The expected voltage response curve calculation utilizes dynamic response parameters output by the feature extraction module, including voltage decay rate and trajectory curvature. The algorithm calculates voltage changes segment by segment under each load level according to a virtual load timing scheme: the upper limit of the decay rate is used to calculate the voltage drop in the high load segment, while the lower limit is used in the low load segment. The curve curvature parameter is then used to correct the curve's bending trend. Finally, a smooth interpolation algorithm connects the voltage data from each segment to form a continuous expected voltage response curve.
[0061] Curve shape matching employs a shape distance algorithm to calculate the shape difference between the expected curve and the actual curves in the feature library. Difference quantification is achieved by comparing the number of inflection points, their positions, and the trend of slope changes. A high matching degree is determined when the deviation in the number of inflection points is less than 1, the position deviation is less than a preset threshold, and the slope change trend is consistent. The module sorts the curves in descending order of matching degree, selects the actual curve with the highest matching degree as a reference benchmark, extracts the load-capacity correlation data corresponding to this benchmark, and reconstructs the load-capacity mapping relationship suitable for the current battery using a linear regression algorithm, providing a basis for capacity calculation.
[0062] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.
Claims
1. A battery remaining capacity detection system based on a portable electronic device, characterized in that, include: The mode trigger module is used to automatically trigger the battery detection mode after the device is powered on, while recording the device status data at the trigger time and saving the current working parameters. The signal parallel module is used to extend the input signal source of the analog-to-digital converter from the internal sensor signal to the external battery voltage signal, and establish a voltage sampling path; The dynamic load regulation module is used to control the load circuit to generate load currents of different intensities. It collects multiple sets of voltage sampling values under load conditions through the analog-to-digital converter module to obtain the voltage performance data of the battery under different operating conditions. The feature extraction module is used to construct the battery dynamic response mode based on multiple sets of voltage sampling values, analyze the voltage decay characteristics during load changes, and extract multi-dimensional feature parameters of the battery. The power calculation module is used to perform pattern matching between multi-dimensional feature parameters and a pre-stored battery feature library, and calculate the remaining battery power through a load sequence reconstruction algorithm. The results display module is used to simultaneously display the remaining battery power and load characteristic curves on the device's display screen.
2. The battery remaining capacity detection system based on a portable electronic device according to claim 1, characterized in that, The specific process by which the battery detection mode is automatically triggered after the device is powered on, as described in the mode triggering module, is as follows: The device performs a power-on self-test process, initializes the battery detection function during the self-test, records the power-on timestamp and initial device status parameters, monitors the device runtime and sets a timed detection cycle. When the preset time threshold is reached, the battery detection process is automatically started, the current device operating parameters are saved to the specified storage area, and the configuration parameters required for battery detection are loaded.
3. The battery remaining capacity detection system based on a portable electronic device according to claim 1, characterized in that, In the parallel signal module, the specific process of extending the input signal source from the internal sensor signal to the external battery voltage signal is as follows: Configure multiple input channels for the analog-to-digital converter, synchronously maintain the path connection between internal sensor signals and external battery voltage signals, set independent sampling timing for each signal channel, allocate a dedicated data buffer area to store multi-channel sampling data, establish a cross-checking mechanism between signal channels, monitor the signal quality indicators of each channel in real time, and maintain the stable operation of the parallel signal path.
4. The battery remaining capacity detection system based on a portable electronic device according to claim 1, characterized in that, The specific process by which the dynamic load adjustment module obtains battery voltage performance data under different operating conditions is as follows: The load resistance network is controlled according to the preset load sequence configuration file. The intensity level of the load current is adjusted in stages and the adjustment time point is recorded. Voltage transient response waveform data under each load level is collected, the stability characteristic parameters of the voltage waveform are analyzed, the execution time interval of the load sequence is dynamically adjusted, a mapping relationship table between load current and voltage response is established, and a complete data record of the load regulation process is generated.
5. A battery remaining capacity detection system based on a portable electronic device according to claim 1, characterized in that, The specific process of extracting multi-dimensional feature parameters of the battery in the feature extraction module is as follows: Based on multiple sets of voltage sampling values, a dynamic response mode of the battery under load changes is constructed. The distribution trajectory of voltage sampling points in the load-voltage coordinate system is plotted, the voltage decay rate with load changes is calculated, the morphological characteristics of the voltage decay trajectory are analyzed, the coordinates of key points of trajectory curvature change are extracted, the slope change between adjacent key points is calculated, a set of feature parameters of the dynamic response mode is constructed, the set of feature parameters is normalized, and multi-dimensional feature parameters are output.
6. A battery remaining capacity detection system based on a portable electronic device according to claim 5, characterized in that, The specific process of constructing the dynamic response mode of the battery under load changes is as follows: Acquire load sequence data and corresponding voltage sampling values, plot continuous trajectory curves in the load-voltage coordinate system, divide the load change process into multiple stages, calculate the average rate of change of voltage in each stage, mark the voltage inflection points at stage transitions, calculate the curvature value at the inflection points, analyze the trajectory morphology between adjacent inflection points, construct a feature descriptor for the trajectory morphology, and verify the integrity of the feature descriptor.
7. The battery remaining capacity detection system based on a portable electronic device according to claim 1, characterized in that, In the power calculation module, the specific process of calculating the remaining battery power using the load sequence reconstruction algorithm is as follows: Multi-dimensional feature parameters are matched with a pre-stored battery feature library at multiple levels. A virtual load scenario is generated based on a load sequence reconstruction algorithm. The predicted voltage response value under the virtual load scenario is calculated. The similarity between the predicted value and the actual sampled value in the feature library is compared. The feature library sample with the highest similarity is selected to construct a reference set. The power value under the current state is calculated through the load-power mapping relationship. The calculation result is corrected by combining the battery degradation characteristics in historical detection data. The sample usage record in the feature library is updated.
8. A battery remaining capacity detection system based on a portable electronic device according to claim 7, characterized in that, The specific process of the load sequence reconstruction algorithm is as follows: Analyze the load intensity distribution characteristics of the current load sequence, extract the load switching time interval statistics, generate a virtual load intensity sequence based on the load intensity distribution characteristics, set the virtual load duration according to the load switching time interval, calculate the expected voltage response curve under the virtual load sequence, perform morphological matching between the expected voltage response curve and the actual curve in the feature library, select the actual curve with the highest morphological matching degree as the reference benchmark, and reconstruct the load-power mapping relationship based on the reference benchmark.