Intelligent mobile power supply control method, mobile power supply, storage medium and program product

By establishing a time-series correlation table of port power consumption changes in the power bank, predicting and reserving power, the problem of power instability and uneven current distribution in traditional power banks when charging multiple devices is solved, realizing intelligent power management and improving charging efficiency and device safety.

CN121566705APending Publication Date: 2026-02-24SHENZHEN RUIQITE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511682338.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-17
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Traditional power banks suffer from low charging efficiency and excessive heat generation during charging. They also struggle to intelligently adjust their charging based on the actual needs of the devices. Furthermore, uneven current distribution when charging multiple devices negatively impacts user experience and device safety.

Method used

By acquiring the instantaneous power consumption values ​​of each output port of the power bank in real time, a time-series correlation of port power consumption changes is established. Based on the time-series correlation table, the response ports that may be affected are identified, and power is reserved before the expected power consumption change time. A correlation reliability mechanism is introduced to dynamically adjust the prediction accuracy and release the power to be allocated to ensure that high reliability predictions are given priority.

Benefits of technology

It improves the stability and reliability of power supply during multi-device charging, avoids insufficient power or output voltage drop, optimizes power distribution accuracy and system stability, and enhances the adaptability of the power bank in complex load environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121566705A_ABST
    Figure CN121566705A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent mobile power supply control method, a mobile power supply, a storage medium and a program product, and the method comprises the steps: building port power consumption change time sequence association; obtaining a response port identifier having time sequence association with the trigger port, and calculating an expected power consumption change moment of the response port; marking the estimated power consumption value as a to-be-distributed state; converting the estimated power consumption value in the to-be-allocated state into an allocated state, and updating the corresponding association credibility in the time sequence association table; if the response port does not have the power consumption change at the expected power consumption change moment, recovering the estimated power consumption value in the to-be-allocated state to available power, and reducing the corresponding association credibility in the time sequence association table; and when the available power is smaller than a preset residual threshold value, recovering the estimated power consumption values in the to-be-allocated state to the available power according to the association credibility from low to high until the available power is greater than the preset residual threshold value. The method and the device are used for improving the power supply reliability in the charging process of multi-device use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of mobile power control, and particularly relates to an intelligent mobile power control method, mobile power supply, storage medium and program product. Background Technology

[0002] With the popularization of smart devices and the continuous growth of power consumption demands, power banks have become an indispensable electronic product in modern life. However, traditional power banks generally suffer from low charging efficiency, serious heat generation, and difficulty in intelligently adjusting according to the actual needs of the device being charged. This results in long charging times and shortened battery life. At the same time, uneven current distribution is likely to occur when multiple devices are charging at the same time, affecting the user experience and device safety.

[0003] In related technologies, an adaptive charging technology based on load detection can be adopted. This technology integrates a current detection circuit and a microcontroller inside the power bank to monitor the current demand and voltage characteristics of connected devices in real time. It automatically adjusts the output voltage and current based on the detected load parameters. When a fast charging protocol device is detected, it can automatically switch to the corresponding fast charging mode. At the same time, it monitors the battery temperature through a temperature sensor and automatically reduces the charging power when the temperature is too high, thereby improving charging efficiency and enhancing safety.

[0004] In daily use, power banks usually need to power multiple devices simultaneously. The power consumption of these devices during charging will dynamically adjust according to their own operating conditions. Although related technologies can detect the power changes of these devices, their optimization strategies are designed based on the assumption that the power consumption of the devices is relatively stable. When faced with the complex situation of frequent power changes of multiple devices, it is difficult to continuously adjust the output parameters of each port according to the detected power changes. Furthermore, frequent parameter adjustments may cause temporary instability in power supply, thereby reducing the reliability of power supply during the charging of multiple devices. Summary of the Invention

[0005] This application provides an intelligent mobile power supply control method, a mobile power supply, a storage medium, and a program product to improve the reliability of power supply during the charging process of multiple devices.

[0006] In the first aspect, this application provides an intelligent mobile power supply control method, which acquires the instantaneous power consumption value of each output port of the mobile power supply in real time, and records a timestamp when the instantaneous power consumption value changes; Based on the instantaneous power consumption value and the corresponding timestamp, a time-series correlation of port power consumption change is established. The time-series correlation of port power consumption change includes the trigger port, the response port, the time delay interval, and the correlation confidence. The correlation confidence characterizes the historical frequency of power consumption change of the trigger port causing power consumption change of the response port within the time delay interval. If the power consumption change value of the trigger port exceeds the preset threshold, the response port identifier that has a time correlation with the trigger port is obtained based on the timing association table, and the expected power consumption change time of the response port is calculated according to the corresponding time delay interval. Before the expected power consumption change, reserve the estimated power consumption value of the response port from the available power of the power bank and mark the estimated power consumption value as pending allocation. When the power consumption of the response port changes at the expected power consumption change time, the estimated power consumption value in the pending state is changed to the allocated state, and the corresponding association confidence in the timing association table is updated. If the power consumption of the response port does not change at the expected power consumption change time, the estimated power consumption value in the pending allocation state will be restored to the available power, and the corresponding association confidence in the timing association table will be reduced. When the available power is less than the preset remaining threshold, the estimated power consumption value in the pending allocation state is restored to the available power in order of association confidence from low to high, until the available power is greater than the preset remaining threshold.

[0007] By adopting the above technical solution, when the power consumption change of the trigger port exceeds a preset threshold, the system identifies the potentially affected response ports based on a time-series correlation table established from historical data, calculates the expected power consumption change time, and deducts the corresponding estimated power consumption value from the available power before that time arrives. This predictive power allocation mechanism avoids the power shortage or output voltage drop problems that traditional power banks encounter when there is a sudden surge in power demand, and improves the power supply stability when multiple ports are working simultaneously. By introducing a correlation reliability mechanism, the system can dynamically adjust the prediction accuracy. When the prediction is accurate, the reliability is increased and the reservation strategy is maintained; when the prediction is inaccurate, the reliability is reduced and the reserved power is released, achieving adaptive intelligent power management. When available power is scarce, the system releases the power to be allocated in order of reliability from low to high, ensuring that high-reliability predictions are prioritized, maximizing overall power utilization efficiency, improving the adaptability of the power bank in complex load environments, and thus improving the reliability of power supply during multi-device charging.

[0008] In conjunction with some embodiments of the first aspect, in some embodiments, reserving the estimated power consumption value of the response port from the available power of the power bank specifically includes: Obtain the power consumption change records of the response port that are time-related to the trigger port in the historical records; Based on the power consumption change records, extract the correspondence between the current power consumption change value of the trigger port and the power consumption change value of the response port; The estimated power consumption value is the sum of the product of the current power consumption change value and the historical power consumption change ratio of the trigger port and the power consumption change value of the response port.

[0009] By employing the above technical solution, power consumption change records with time-series correlation are extracted from historical data. The correspondence between the current power consumption change value of the trigger port and historical data is analyzed, and the estimated power consumption value is calculated by combining the historical power consumption change ratio coefficient. This method is more accurate than a simple fixed reservation method. By multiplying the current power consumption change value of the trigger port by the historical ratio coefficient and adding the historical power consumption change value of the response port, the obtained estimated value reflects both the impact of the current change and the change characteristics of the response port itself, avoiding power waste caused by excessive reservation. This transforms empirical power management into data-driven management, improving the power allocation accuracy and system stability of the power bank in scenarios with multiple devices charging concurrently.

[0010] In conjunction with some embodiments of the first aspect, in some embodiments, after using the sum of the product of the current power consumption change value of the trigger port and the historical power consumption change ratio coefficient and the power consumption change value of the response port as the estimated power consumption value, the method further includes: Determine whether the available power of the power bank is greater than the estimated power consumption value; If so, the estimated power consumption value is deducted from the available power, and the estimated power consumption value is marked as pending allocation. If not, release the estimated power consumption values ​​in the pending allocation state in order of association confidence from low to high, until the available power is greater than the estimated power consumption value, and delete the timing associations corresponding to the released estimated power consumption values ​​in the pending allocation state from the timing association table.

[0011] By adopting the above technical solution, after calculating the estimated power consumption, the system first determines whether the currently available power is sufficient to support the reserved demand. If sufficient, it reserves the power directly; otherwise, it activates an intelligent release mechanism. This release mechanism releases the reserved power in order of increasing reliability, ensuring that high-reliability predicted demands are prioritized when power resources are scarce. This tiered release strategy avoids system crashes or random interruptions due to insufficient power, guaranteeing the power supply continuity of critical equipment. This method transforms passive power allocation into proactive intelligent management, enhancing the adaptability and service quality of the power bank in complex and variable load environments.

[0012] In conjunction with some embodiments of the first aspect, in some embodiments, after restoring the estimated power consumption value in the pending allocation state to the available power, the method further includes: Count the number of power consumption changes at the trigger port within a preset time period; Calculate the variance of the power consumption change value of the trigger port within a preset time period; If the number of power consumption changes is greater than the first preset threshold and the variance is less than the preset variance threshold, the power consumption change value of the trigger port is accumulated and recorded until the accumulated power consumption change value exceeds the preset threshold. Then, the step of obtaining the response port identifier that has a time association with the trigger port based on the timing association table is executed. If the number of power consumption changes is greater than the first preset threshold and the variance is not less than the preset variance threshold, then the power consumption change value of the trigger port will be divided into a power consumption increase group or a power consumption decrease group according to whether the power consumption increases or decreases. The maximum value in the power increase group or the maximum value in the power decrease group is used as the power change value of the trigger port, and then the step of obtaining the response port identifier that has a timing association with the trigger port is executed based on the timing association table.

[0013] By employing the above technical solution, and by statistically analyzing the number of power consumption changes within a preset time period and calculating the variance of the change values, different types of power consumption change patterns can be identified. When frequent but relatively stable power consumption fluctuations are detected, the system adopts an accumulation recording strategy to avoid resource waste and system instability caused by frequent predictions triggered by minor changes. When the number of changes is frequent but the variance is large, the system groups the power consumption changes according to the direction of increase or decrease and takes the maximum value, filtering out noise interference. This allows the system to distinguish between normal operating fluctuations of the device and actual power demand changes, avoiding unnecessary reservations caused by false triggers. By setting a variance threshold, the system can automatically identify the stability characteristics of power consumption changes, using an accumulation strategy for stable small changes and a peak strategy for unstable large changes, achieving differentiated processing for different operating modes. This method reduces system overhead caused by frequent fine-tuning, improves the signal-to-noise ratio of power prediction, and enables the power bank to respond more accurately to truly meaningful power consumption changes, reducing the system's computational burden and response latency while improving prediction accuracy.

[0014] In conjunction with some embodiments of the first aspect, in some embodiments, after using the maximum value in the power consumption increase group or the maximum value in the power consumption decrease group as the power consumption change value of the trigger port, the method further includes: The number of times the trigger port switches from the power consumption increase group to the power consumption decrease group or from the power consumption decrease group to the power consumption increase group within a preset time period is counted. When the number of switching times exceeds the preset switching threshold, the power consumption increase group and the power consumption decrease group will be divided into multiple time periods in chronological order; Calculate the average value of the power consumption change for each time period; The maximum absolute value of the difference between the average values ​​of adjacent time periods is used as the power consumption change value of the trigger port.

[0015] By adopting the above technical solution, when the trigger port frequently switches between increasing and decreasing power consumption within a preset time period, the traditional method of simply taking the maximum value can lead to overly sensitive prediction results and misjudgments. By counting the number of switching and comparing it with a preset switching threshold, it is possible to identify situations where the device is in an unstable operating state. After detecting high-frequency switching, the entire time period is divided into multiple sub-time periods in chronological order, and the average value of the power consumption change value in each time period is calculated. This processing method can smooth out the impact of short-term fluctuations. It improves the system's anti-interference capability against noise, enabling the power bank to make more accurate and stable power pre-allocation decisions in complex and changing usage environments, thereby improving overall power management efficiency and user experience.

[0016] In conjunction with some embodiments of the first aspect, in some embodiments, after restoring the estimated power consumption value in the pending allocation state to the available power, the method further includes: Calculate the minimum historical power consumption change interval for each output port; If the minimum value is less than the preset time threshold, the standard deviation of the historical power consumption change amplitude of the corresponding output port is calculated. When the standard deviation is less than the preset amplitude threshold, the historical power consumption change records of the output port are grouped, and adjacent power consumption changes with a time interval less than the preset time threshold are divided into the same group. The power consumption change values ​​within the same group are summed to obtain the group power consumption change value; Use the group power consumption change value as the trigger port power consumption change value; Calculate the average rate of change of power consumption within the same group based on the time distribution of power consumption changes within the same group. The preset threshold is adjusted based on the average rate of change.

[0017] By employing the above technical solution, when the minimum historical power consumption change interval of a certain output port is detected to be less than a preset time threshold, it indicates that the port exhibits high-frequency power consumption change behavior. Further calculation of the standard deviation of the historical power consumption change amplitude of this port reveals that when the standard deviation is less than a preset amplitude threshold, it indicates that although the changes are frequent, the amplitude is relatively stable. This situation typically corresponds to the device's gradual power consumption adjustment process. By grouping adjacent power consumption changes with time intervals less than the preset time threshold into the same group, a series of related power consumption changes occurring within a short period can be identified, avoiding the misinterpretation of these changes, which essentially belong to the same power consumption adjustment process, as multiple independent events. Accumulating the power consumption change values ​​within the same group yields the group power consumption change value, reflecting the actual power consumption demand variation of the device, improving the accuracy of power prediction and allocation, reducing unnecessary power reservations, and enhancing the overall utilization efficiency of the power bank.

[0018] In conjunction with some embodiments of the first aspect, in some embodiments, adjusting a preset threshold based on the average rate of change specifically includes: When the average rate of change is greater than the first rate threshold, the adjustment coefficient is set to the first preset value. When the average rate of change is greater than the second rate threshold but not greater than the first rate threshold, the adjustment coefficient is set to the second preset value. When the average rate of change is not greater than the second rate threshold, the adjustment coefficient is set to the third preset value; the first preset value is greater than the second preset value, and the second preset value is greater than the third preset value. Multiply the preset threshold by the adjustment coefficient to obtain the adjusted preset threshold.

[0019] By adopting the above technical solution, when the average rate of change is greater than the first rate threshold, it indicates that the device power consumption changes extremely rapidly. In this case, a larger first preset value is set as the adjustment coefficient, increasing the adjusted preset threshold and avoiding oversensitivity to rapid but potentially short-lived power consumption fluctuations. When the average rate of change is between the second and first rate thresholds, the device power consumption changes at a moderate rate, and a moderate second preset value is used for adjustment to balance responsiveness and stability. When the average rate of change is not greater than the second rate threshold, the device power consumption changes relatively slowly, and a smaller third preset value is used, enabling the system to respond promptly to even small power consumption changes. This hierarchical adjustment strategy, by multiplying the preset threshold by the corresponding adjustment coefficient, achieves adaptation to devices with different rate characteristics, improves the adaptability of the power prediction system to various types of devices, reduces prediction deviations caused by differences in device characteristics, optimizes the allocation efficiency of power resources, and enhances the overall performance of the power bank in multi-device mixed usage scenarios.

[0020] In a second aspect, embodiments of this application provide a portable power bank, which includes: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the portable power bank to perform the method described in the first aspect and any possible implementation thereof.

[0021] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a power bank, cause the power bank to perform the method described in the first aspect and any possible implementation thereof.

[0022] Fourthly, embodiments of this application provide a computer program product that, when running on a power bank, causes the power bank to execute the method described in any possible implementation of the first aspect.

[0023] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. This application provides an intelligent mobile power supply control method. When the power consumption change of the trigger port exceeds a preset threshold, the system identifies the potentially affected response ports based on a time-series correlation table established from historical data, calculates the expected power consumption change time, and deducts the corresponding estimated power consumption value from the available power before that time arrives. This predictive power allocation mechanism avoids the power shortage or output voltage drop problems that traditional mobile power supplies encounter when there is a sudden high power demand, and improves the power supply stability when multiple ports are working simultaneously. By introducing a correlation reliability mechanism, the system can dynamically adjust the prediction accuracy. When the prediction is accurate, the reliability is increased and the reservation strategy is maintained; when the prediction is incorrect, the reliability is reduced and the reserved power is released, realizing adaptive intelligent power management. When available power is scarce, the system releases the power to be allocated in order of reliability from low to high, ensuring that high-reliability predictions are given priority, maximizing the overall power utilization efficiency, improving the adaptability of the mobile power supply in complex load environments, and thus improving the reliability of power supply during multi-device charging.

[0024] 2. This application provides an intelligent mobile power bank control method. By statistically analyzing the number of power consumption changes within a preset time period and calculating the variance of the change values, it can identify different types of power consumption change patterns. When frequent but relatively stable power consumption fluctuations are detected, the system adopts an accumulation recording strategy to avoid resource waste and system instability caused by frequent predictions triggered by minor changes. When the number of changes is frequent but the variance is large, the system groups the power consumption changes according to the direction of increase or decrease and takes the maximum value, filtering out noise interference. This allows the system to distinguish between normal operating fluctuations of the device and actual power demand changes, avoiding unnecessary reservations caused by false triggers. By setting a variance threshold, the system can automatically identify the stability characteristics of power consumption changes. For stable small changes, an accumulation strategy is used; for unstable large changes, a peak strategy is used, achieving differentiated processing for different operating modes. This method reduces system overhead caused by frequent fine-tuning, improves the signal-to-noise ratio of power prediction, and enables the mobile power bank to respond more accurately to truly meaningful power consumption changes, reducing the system's computational burden and response latency while improving prediction accuracy.

[0025] 3. This application provides an intelligent mobile power bank control method. When the minimum historical power consumption change interval of a certain output port is detected to be less than a preset time threshold, it indicates that the port exhibits high-frequency power consumption change behavior. Further calculation of the standard deviation of the historical power consumption change amplitude of the port reveals that when the standard deviation is less than a preset amplitude threshold, it indicates that although the changes are frequent, the amplitude is relatively stable. This situation typically corresponds to the device's gradual power consumption adjustment process. By grouping adjacent power consumption changes with time intervals less than the preset time threshold into the same group, a series of related power consumption changes occurring within a short period can be identified, avoiding the misinterpretation of these changes, which essentially belong to the same power consumption adjustment process, as multiple independent events. Accumulating the power consumption change values ​​within the same group yields the group power consumption change value, reflecting the actual power consumption demand variation of the device, improving the accuracy of power prediction and allocation, reducing unnecessary power reservations, and enhancing the overall utilization efficiency of the mobile power bank. Attached Figure Description

[0026] Figure 1 This is a flowchart illustrating a smart mobile power supply control method in an embodiment of this application.

[0027] Figure 2 This is a flowchart illustrating an intelligent identification and processing method for high-frequency power consumption variation scenarios in an embodiment of this application.

[0028] Figure 3 This is a schematic diagram of the physical device structure for controlling a mobile power supply using an intelligent mobile power supply, as provided in an embodiment of this application. Detailed Implementation

[0029] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.

[0030] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0031] The following example is used in conjunction with Figure 1The present application describes a smart mobile power supply control method in its embodiments: Please see Figure 1 This is a flowchart illustrating an intelligent mobile power supply control method in an embodiment of this application.

[0032] S101. Real-time acquisition of instantaneous power consumption values ​​of each output port of the power bank, and recording timestamps when instantaneous power consumption values ​​change; Instantaneous power consumption refers to the actual power consumption of each output port of the power bank at a specific moment, usually measured in watts (W). This value reflects the current power demand of the devices connected to each port. The power bank of this application integrates a TFT touch screen display, which can display the instantaneous power consumption value of each port in real time. Users can view detailed power consumption history curves through touch operation. A timestamp is a precise record of the moment when the instantaneous power consumption value changes, generally using millisecond or microsecond-level time accuracy, used to mark the specific time point when the power consumption change event occurs. The frequency of real-time acquisition can be set according to actual application needs, such as sampling once every 10 milliseconds, 50 milliseconds, or 100 milliseconds, which is not limited here. The criterion for judging a change in power consumption value can be set to an absolute value change exceeding a certain threshold, such as 0.1W, 0.5W, or 1W, or it can be set to a relative change exceeding a certain percentage, such as 5%, 10%, or 20%, which is not limited here.

[0033] The specific methods for implementing this step include: The first technical solution uses a current-voltage sampling method. High-precision current sampling resistors and voltage sampling circuits are configured at each output port. Current and voltage data are acquired in real time via an analog-to-digital converter (ADC), and the instantaneous power consumption value P=U×I is calculated by the microcontroller. When the calculated power consumption value changes compared to the previously recorded value, the system automatically obtains the current system clock as a timestamp for recording, and simultaneously emits a slight alert sound through an integrated flat speaker to inform the user of the change in power consumption. The second technical solution uses a dedicated power metering chip method. A dedicated power metering chip, such as Texas Instruments' INA226 or Maxim's MAX34409, is integrated into each output port. These chips integrate current sampling, voltage sampling, and power calculation functions, and can directly output the instantaneous power consumption value. The microcontroller periodically reads the data from the power metering chips at each port via an I2C or SPI interface, and when a change in power consumption is detected, it obtains a precise timestamp through a real-time clock (RTC) module or system timer for recording.

[0034] S102. Based on the instantaneous power consumption value and the corresponding timestamp, establish a timing correlation of port power consumption changes; Based on instantaneous power consumption values ​​and corresponding timestamps, a timing correlation of port power consumption changes is established. This correlation includes the trigger port, the response port, the time delay interval, and the correlation confidence level. The correlation confidence level characterizes the historical frequency of power consumption changes at the response port triggered by power consumption changes at the trigger port within the time delay interval. During the establishment of the timing correlation, the TFT display of the power bank dynamically displays the relationships between the ports, forming an intuitive power consumption correlation network diagram to help users understand the mutual influence between devices.

[0035] The specific methods for implementing this step include: The first technical solution employs a sliding window correlation analysis method, setting a time window (e.g., 5 seconds or 10 seconds) to analyze the temporal relationships of power consumption change events at each port. When a power consumption change is detected at port A, the system begins monitoring the power consumption changes of other ports within a subsequent specific time range (e.g., 100 milliseconds to 2 seconds). If a power consumption change also occurs at port B within this time range, a temporal correlation event from A to B is recorded, and the specific time delay is calculated. The system uses its built-in GPU graphics processing unit to render the correlation animation in real time, displaying the process of power consumption propagation from the trigger port to the response port as flowing light on the display screen. By accumulating multiple observations, the frequency of each correlation is statistically analyzed, and the correlation confidence is calculated as: (Number of occurrences of the correlation / Total number of power consumption changes at port A).

[0036] The second technical solution employs machine learning clustering analysis to construct time-series feature vectors from historical power consumption change data. Each vector contains the timing and magnitude of power consumption changes at each port. The system utilizes the computing power of the ARM architecture main control chip to cluster these feature vectors using clustering algorithms such as K-means or DBSCAN, identifying combinations of power consumption changes with similar timing patterns. During the analysis, data from environmental sensors (temperature, humidity) are also considered, as environmental factors may affect the device's power consumption patterns. For each clustering result, the internal timing relationships are analyzed, extracting trigger port, response port, and time delay information, and calculating the correlation confidence level based on the cluster density.

[0037] S103. If it is determined that the power consumption change value of the trigger port exceeds the preset threshold, the response port identifier that has a timing association with the trigger port is obtained based on the timing association table, and the expected power consumption change time of the response port is calculated according to the corresponding time delay interval. The preset threshold refers to the power consumption change threshold value that triggers the timing correlation prediction mechanism. Setting this threshold requires comprehensive consideration of the total power capacity of the power bank, the number of ports, and typical load characteristics. The power consumption change value can be an absolute change (e.g., an increase of 5W or a decrease of 3W) or a relative change rate (e.g., an increase of 50% or a decrease of 30%), and is not limited here. The timing correlation table is the data structure established in step S102, storing the timing dependencies between ports. The response port identifier refers to the unique identifier of other ports that have a timing correlation with the currently triggered port; it can be a port number, port name, or other unique identifier, and is not limited here. The calculation of the expected power consumption change time is based on the time delay interval, usually taking the median of the delay interval or calculating the expected value based on the distribution characteristics of historical data.

[0038] The specific methods for implementing this step include: The first technical solution employs a hash table fast retrieval method, organizing the timing association table into a hash table structure with the trigger port identifier as the key. When a port power consumption change exceeds a preset threshold, the system not only searches the hash table for all timing association records corresponding to that port, but also prominently marks the trigger port on the TFT display screen and provides an animated preview of the response port that will be affected. For each association record, the response port identifier and time delay interval [t_min, t_max] are extracted. The expected power consumption change time is calculated as: T_expected = T_current + (t_min + t_max) / 2, where T_current is the current time. The second technical solution employs a priority queue prediction method, maintaining a priority queue sorted by expected trigger time. When the trigger port power consumption change exceeds the threshold, all association records for that port in the timing association table are traversed. For each response port, the most likely trigger time is calculated based on the probability distribution of historical time delay data (such as normal or Poisson distribution), and the (response port identifier, expected time) pair is inserted into the priority queue for subsequent chronological processing.

[0039] Determining whether the power consumption change exceeds a preset threshold is a simple comparison operation that can be achieved through direct numerical comparison. If the current power consumption change is greater than the preset threshold, subsequent correlation queries and prediction calculations are triggered; otherwise, power consumption changes continue to be monitored.

[0040] S104. Before the expected power consumption change, reserve the estimated power consumption value of the response port from the available power of the power bank, and mark the estimated power consumption value as pending allocation. Before the anticipated power consumption change, the estimated power consumption value for the response port is reserved from the available power of the power bank. This estimated power consumption value is marked as pending allocation. Specifically, power consumption change records of the response port that are time-sequentially related to the trigger port are obtained from historical records. Based on these records, the correspondence between the current power consumption change value of the trigger port and the power consumption change value of the response port is extracted. The sum of the product of the current power consumption change value of the trigger port and the historical power consumption change ratio coefficient, and the power consumption change value of the response port, is used as the estimated power consumption value. Simultaneously, the display screen updates the power allocation map in real time, using different colors to distinguish allocated power, pending power, and available power, allowing users to clearly understand the current power status.

[0041] Furthermore, after using the product of the current power consumption change value and the historical power consumption change ratio coefficient of the trigger port and the sum of the power consumption change value of the response port as the estimated power consumption value, the method further includes: determining whether the available power of the power bank is greater than the estimated power consumption value; if so, deducting the estimated power consumption value from the available power and marking the estimated power consumption value as pending allocation; if not, releasing the estimated power consumption values ​​in the pending allocation state in order of association confidence from low to high, until the available power is greater than the estimated power consumption value, and deleting the timing association corresponding to the released estimated power consumption values ​​in the pending allocation state from the timing association table.

[0042] Available power refers to the remaining power capacity that the power bank can currently provide to each output port. It is equal to the total output power of the power bank minus the sum of the current actual power consumption of each port. Estimated power consumption is a prediction of the power demand that the response port will generate, derived from historical data analysis. The pending allocation status is a power reservation marker, indicating that this portion of power has been deducted from the available power but has not yet been actually allocated to a specific port. The calculation method for estimated power consumption includes: first, obtaining the power consumption change records of the response port that are temporally correlated with the trigger port in historical records; these records contain the correspondence between the power consumption changes of the trigger port and the response port; then, based on these records, extracting and analyzing the numerical relationship pattern between the two; finally, adding the product of the current power consumption change value of the trigger port and the historical power consumption change ratio coefficient to the base power consumption value of the response port to obtain the estimated power consumption value. The historical power consumption change ratio coefficient can be calculated using linear regression, least squares method, or other statistical methods, and is not limited here.

[0043] The specific methods for implementing this step include: The first technical solution employs a dynamic power pool management method, establishing a power pool data structure containing four components: total power, allocated power, power to be allocated, and available power. When power needs to be reserved, the system first checks if the available power is sufficient. If sufficient, the estimated power consumption value is transferred from the available power to the power pool to be allocated, and a reservation record is created, containing information such as the response port identifier, estimated power consumption value, reservation time, and expected release time. The second technical solution employs a power budget allocation method, maintaining a power budget account for each port, containing attributes such as current power consumption, reserved power consumption, and maximum allowed power consumption. When power needs to be reserved, the system first checks if the available power is sufficient. If the user is negotiating power sharing with other devices via the "tap-to-share" function, the system will also consider the available power of the sharing device, achieving collaborative power management among multiple devices. If local power is insufficient but the sharing device has surplus power, a power sharing protocol can be established via NFC or Wi-Fi to temporarily borrow the other party's power resources.

[0044] The process also includes a mechanism for handling insufficient power: it determines whether the available power of the power bank is greater than the estimated power consumption value, which is a simple numerical comparison operation. If the available power is sufficient, the reservation operation is performed normally; if the available power is insufficient, other estimated power consumption values ​​in the pending allocation state are released in ascending order of association confidence until the available power meets the current reservation requirement. The release operation includes restoring the pending power to the available power pool and deleting the corresponding low-confidence time-series associations from the association table to reduce subsequent invalid predictions.

[0045] S105. When the power consumption of the response port changes at the expected power consumption change time, the estimated power consumption value in the pending state is converted to the allocated state, and the corresponding association confidence in the timing association table is updated. The expected power consumption change time is the time point calculated in step S103. At this time, the system monitors whether the power consumption of the response port has actually changed. When the prediction is accurate, the system not only updates the association confidence level but also plays a pleasant confirmation sound effect through a planar speaker and displays a successful prediction animation on the screen, providing positive feedback to the user. The determination of power consumption change can be based on an absolute threshold or a relative threshold, consistent with the determination criteria in step S101. The allocated state indicates that the reserved power has been actually allocated to the port for use and is no longer within the available power range. The update of association confidence level adopts a reinforcement learning approach, increasing the confidence level when the prediction is accurate and strengthening the weight of the time-series association. The specific magnitude of the confidence level update can be a fixed increment (e.g., increasing by 0.05 each time) or an adaptive increment (dynamically adjusted according to the prediction accuracy), which is not limited here.

[0046] The specific methods for implementing this step include: The first technical solution uses a state machine transition method, maintaining a state machine for each power reservation record, including three states: pending allocation, allocated, and released. When the expected time arrives, the system checks the actual power consumption change of the response port. If an increase in power consumption is detected and the increase is within the estimated range, a state transition is triggered, changing the reservation record from the pending allocation state to the allocated state, and simultaneously updating the corresponding value in the power pool. The correlation confidence update formula is: New confidence = Old confidence × (1 - Learning rate) + 1 × Learning rate, where the learning rate is typically set between 0.1 and 0.3. The second technical solution uses an event-driven verification method, setting a time window (e.g., 50 milliseconds before and after) before and after the expected time, continuously monitoring the power consumption change event of the response port within this window. Once a power consumption change matching the expectation is detected, a power state transition is immediately executed, and the deviation between the actual change time and the expected time is recorded. The confidence increment is dynamically adjusted based on the magnitude of the time deviation; the smaller the deviation, the greater the increase in confidence.

[0047] Detecting whether the power consumption of the response port has changed is a simple monitoring operation, which can be determined by comparing the current power consumption value with the historical power consumption value. If a change occurs, a state transition and confidence update are performed; if no change occurs, the process proceeds to step S106.

[0048] S106. If the power consumption of the response port does not change at the expected power consumption change time, the estimated power consumption value in the pending allocation state will be restored to the available power, and the corresponding association confidence in the timing association table will be reduced. This step handles prediction failures, where a power change at the trigger port does not trigger a chain reaction at the response port. Restoring the estimated power to usable power means releasing previously reserved power so it can be used by other ports. The decrease in correlation confidence reflects the unreliability of the timing correlation, helping the system reduce its reliance on it in subsequent predictions. The magnitude of the confidence reduction can be symmetrical to the increase in step S105, or a more aggressive reduction strategy can be used to quickly eliminate unreliable correlations; this is not limited here. A certain tolerance range can be set for determining the expected power change time, such as 100 milliseconds before and after; any time within this range is considered an expected time. This is not limited here. When a prediction fails, the system displays a prediction bias analysis on the screen to help the user understand why the prediction error occurred. Simultaneously, if the user has activated learning mode, the system will ask the user about their current usage through voice prompts, collecting feedback to improve the prediction algorithm.

[0049] The specific methods for implementing this step include: The first technical solution employs an automatic timeout release method. A timeout timer is reserved for each power allocation, with the trigger time set to the expected power consumption change time plus a tolerance period. When the timer triggers, the system checks whether the corresponding response port has experienced a power consumption change. If not, the system analyzes possible reasons: whether changes in ambient temperature affected the device's operating status, whether the user manually adjusted charging parameters via the touchscreen, or whether a new charging request was sent by a Bluetooth-connected device. This additional information is recorded to optimize subsequent prediction models. Simultaneously, the associated confidence level is updated: new confidence level = old confidence level × attenuation coefficient, typically set between 0.8 and 0.95. The second technical solution employs an active polling verification method. The system maintains a verification queue sorted by expected time. At each expected time, the system actively queries the power consumption status of the corresponding response port. If it confirms that no expected power consumption change has occurred, a power recovery operation is immediately performed, and the confidence level is updated via a lookup table. Credibility updates can use a piecewise function, which reduces the confidence level by different amounts depending on the current confidence level range. For example, it can reduce the confidence level by 0.1 for high confidence level (greater than 0.8), by 0.05 for medium confidence level (0.5-0.8), and by 0.02 for low confidence level (less than 0.5).

[0050] A potential technical challenge during power restoration is the potential for oscillations in system power management caused by frequent power reservation and release operations. To address this, a power smoothing buffer mechanism can be introduced. Specifically, a small-capacity power buffer (e.g., 5% of total power) is established to absorb frequent power allocation changes. When an estimated power consumption value needs to be restored, it is first placed in the buffer. Only when the accumulated power in the buffer exceeds a certain threshold or after a certain time interval is reached is the power in the buffer merged into the main available power pool in batches. This reduces the update frequency of the power pool and improves system stability.

[0051] S107. When the available power is less than the preset remaining threshold, the estimated power consumption value in the pending allocation state is restored to the available power in order of association confidence from low to high, until the available power is greater than the preset remaining threshold.

[0052] The preset remaining threshold is the minimum available power requirement to ensure the basic functions and safe operation of the power bank. Setting this threshold needs to consider the power conversion efficiency, heat dissipation requirements, and the ability to handle sudden power demands. It is typically set to 10% to 20% of the total output power, but the specific value can be adjusted according to the actual application scenario and is not limited here. Releasing power in order of increasing reliability reflects the principle of prioritizing high-reliability predictions, ensuring that more likely power demands are met first. When the system enters a power shortage state, it not only executes the automatic release strategy but also alerts the user in multiple ways. The display switches to power-saving mode, showing only key information; the flat speaker emits a warning sound; and if the user's phone is connected via Bluetooth, a power warning notification is pushed. Simultaneously, the system generates a specific rhythmic vibration through a vibration motor, allowing the user to perceive the power shortage even without looking at the screen. This mechanism activates when the power bank's power resources are scarce, sacrificing low-reliability predictions to ensure the overall stability of the system.

[0053] The specific methods for implementing this step include: The first technical solution employs a priority queue release method. The system maintains a queue of power records to be allocated, sorted by their associated reliability, with the record having the lowest reliability at the front of the queue. When performing a release operation, if the system detects that the user is performing an important operation (such as transmitting critical data via NFC), it will temporarily protect the power reservation of the relevant ports and prioritize releasing other lower-priority reserved power. This intelligent release strategy ensures the continuity of the user experience. When the available power is detected to be lower than a preset remaining threshold, the power to be allocated is released one by one starting from the front of the queue. After each record is released, the available power is recalculated until the available power recovers to above the threshold or the queue is empty. The release operation includes steps such as adding the estimated power consumption value back to the available power, deleting reserved records, and selectively reducing the reliability of the corresponding timing association. The second technical solution employs a tiered release strategy, dividing all power to be allocated into multiple levels according to reliability (e.g., below 0.3, 0.3-0.6, 0.6-0.8, above 0.8). The system prioritizes releasing all reserved power at the lowest level; if this is still insufficient, it continues to release the next lowest level, and so on. This method reduces the number of release operations and improves processing efficiency. Furthermore, when the power bank detects that the user is in a specific scenario (such as an airport or hospital) via GPS positioning, the system automatically adjusts its power management strategy to prioritize the charging needs of critical devices, demonstrating its scenario-based intelligent power allocation capabilities.

[0054] A potential technical problem during emergency power release is the mis-release of reserved power that is about to be used, leading to insufficient power supply when the actual power demand arrives. To address this issue, a comprehensive evaluation mechanism incorporating time factors can be introduced. Specifically, when determining the release order, not only the correlation confidence level but also the proximity of the expected usage time is considered. The comprehensive priority is calculated as: Correlation Confidence Level × Time Weighting Coefficient, where the time weighting coefficient = 1 / (1 + e^(-k × Remaining Time)), and k is an adjustment parameter. In this way, even power reserves with low confidence levels that are about to be used can be protected to some extent, while reserves with low confidence levels and distant usage times are released first.

[0055] In the above embodiments, when the power consumption change of the trigger port exceeds a preset threshold, the system identifies the potentially affected response ports based on a time-series correlation table established from historical data, calculates the expected power consumption change time, and deducts the corresponding estimated power consumption value from the available power before that time arrives. This predictive power allocation mechanism avoids the power shortage or output voltage drop problems that traditional power banks encounter when there is a sudden surge in power demand, and improves the power supply stability when multiple ports are working simultaneously. By introducing a correlation reliability mechanism, the system can dynamically adjust the prediction accuracy. When the prediction is accurate, the reliability is increased and the reservation strategy is maintained; when the prediction is incorrect, the reliability is reduced and the reserved power is released, achieving adaptive intelligent power management. When available power is scarce, the system releases the allocated power in order of reliability from low to high, ensuring that high-reliability predictions are prioritized, maximizing overall power utilization efficiency, and improving the adaptability of the power bank in complex load environments, thereby improving the reliability of power supply during multi-device charging.

[0056] In the first embodiment described above, the power bank solves the power supply stability problem when multiple ports are operating simultaneously by establishing a timing correlation of port power consumption changes and performing predictive power allocation based on estimated power consumption values. However, in practical applications, some connected devices may experience high-frequency, small-amplitude power consumption changes. If these continuous, minute changes are mistakenly identified by the system as multiple independent triggering events, it will lead to a decrease in the accuracy of power prediction and a waste of resources. To further optimize the system's ability to handle such complex power consumption change patterns and improve the accuracy and efficiency of power management, the second embodiment below will focus on introducing an intelligent aggregation processing method for high-frequency, small-amplitude power consumption changes, specifically: Calculate the minimum historical power consumption change interval for each output port; If the minimum value is less than the preset time threshold, the standard deviation of the historical power consumption change amplitude of the corresponding output port is calculated. When the standard deviation is less than the preset amplitude threshold, the historical power consumption change records of the output port are grouped, and adjacent power consumption changes with a time interval less than the preset time threshold are divided into the same group. The power consumption change values ​​within the same group are summed to obtain the group power consumption change value; Use the group power consumption change value as the trigger port power consumption change value; Calculate the average rate of change of power consumption within the same group based on the time distribution of power consumption changes within the same group. When the average rate of change is greater than the first rate threshold, the adjustment coefficient is set to the first preset value. When the average rate of change is greater than the second rate threshold but not greater than the first rate threshold, the adjustment coefficient is set to the second preset value. When the average rate of change is not greater than the second rate threshold, the adjustment coefficient is set to the third preset value; the first preset value is greater than the second preset value, and the second preset value is greater than the third preset value. Multiply the preset threshold by the adjustment coefficient to obtain the adjusted preset threshold.

[0057] First, the minimum historical power consumption change interval for each output port is calculated. This minimum value reflects the highest frequency of power consumption changes at the port. If the minimum value is less than a preset time threshold (e.g., 100 milliseconds or 200 milliseconds), the standard deviation of the historical power consumption change amplitude for the corresponding output port is further calculated to assess the stability of the power consumption change amplitude. When the standard deviation is less than a preset amplitude threshold (e.g., 0.5W or 1W), it indicates that although the port's power consumption changes frequently, the amplitude is relatively stable. The system then groups the historical power consumption change records for this port, classifying adjacent power consumption changes with time intervals less than the preset time threshold into the same group. The power consumption change values ​​within the same group are summed to obtain the group power consumption change value, which reflects the total change in a complete power consumption adjustment process. The system uses the group power consumption change value as the power consumption change value for triggering the port for subsequent time-series correlation analysis. Based on the time distribution of power consumption changes within the same group, the average rate of change of group power consumption is calculated. This rate is equal to the group power consumption change value divided by the time difference between the first and last power consumption changes within the group. Based on the magnitude of the average rate of change, the system dynamically adjusts the preset thresholds: when the average rate of change is greater than the first rate threshold, the adjustment coefficient is set to the first preset value; when the average rate of change is greater than the second rate threshold but not greater than the first rate threshold, the adjustment coefficient is set to the second preset value; when the average rate of change is not greater than the second rate threshold, the adjustment coefficient is set to the third preset value. The first preset value is greater than the second preset value, and the second preset value is greater than the third preset value; for example, they can be set to 1.5, 1.2, and 1.0 respectively. Finally, the original preset threshold is multiplied by the adjustment coefficient to obtain the adjusted preset threshold, which is used to determine whether to trigger the power reservation mechanism. The specific values ​​of the preset time threshold, preset amplitude threshold, rate threshold, and adjustment coefficient can be adjusted according to the actual application scenario and equipment characteristics, and are not limited here.

[0058] The specific implementation methods of this embodiment include: The first technical solution employs a state machine aggregation method, maintaining an aggregation state machine for each port, including three states: idle, aggregation in progress, and aggregation complete. When the detected power consumption change interval is less than a preset time threshold, the state machine transitions from idle to aggregation in progress, starting to accumulate power consumption change values. During aggregation, new power consumption changes are continuously monitored. If the interval between the previous change and the current change is still less than the threshold, accumulation continues; if the interval exceeds the threshold, aggregation ends, and the group power consumption change value and average change rate are calculated. An adjustment coefficient is determined by looking up the rate in a table, and the preset threshold is updated. The second technical solution employs a time window aggregation method, setting a fixed-length time window (e.g., 500 milliseconds) to statistically analyze all power consumption change events within the window. At the end of the window, the time distribution of power consumption changes within the window is checked. If adjacent change intervals are all less than the preset time threshold and the amplitude standard deviation meets the condition, all changes within the window are aggregated into a group. The average change rate is calculated using linear fitting or weighted averaging methods, and an adjustment coefficient is determined based on a preset piecewise function.

[0059] A potential technical challenge during aggregation processing is the significant differences in power consumption patterns among different types of devices, meaning fixed aggregation parameters may not be suitable for all scenarios. To address this, an adaptive parameter learning mechanism can be introduced. Specifically, the system records the power consumption characteristics of each port at different times, including the distribution of frequency, amplitude, and duration. Typical power consumption patterns for each port are identified using K-means clustering or Gaussian mixture models, and a dedicated set of aggregation parameters is set for each pattern. In actual operation, the system matches the most similar pattern based on the current power consumption characteristics and dynamically selects the corresponding preset time threshold, preset amplitude threshold, and rate threshold, thereby improving the accuracy and adaptability of the aggregation processing.

[0060] In the above embodiments, when the minimum historical power consumption change interval of a certain output port is detected to be less than a preset time threshold, it indicates that the port exhibits high-frequency power consumption change behavior. Further calculation of the standard deviation of the historical power consumption change amplitude of the port reveals that when the standard deviation is less than a preset amplitude threshold, it indicates that although the changes are frequent, the amplitude is relatively stable. This situation typically corresponds to the device's gradual power consumption adjustment process. By grouping adjacent power consumption changes with time intervals less than the preset time threshold into the same group, a series of related power consumption changes occurring within a short period can be identified, avoiding the misinterpretation of these changes, which essentially belong to the same power consumption adjustment process, as multiple independent events. Accumulating the power consumption change values ​​within the same group yields the group power consumption change value, reflecting the actual power consumption demand variation of the device, improving the accuracy of power prediction and allocation, reducing unnecessary power reservations, and enhancing the overall utilization efficiency of the power bank.

[0061] Furthermore, in practical applications, some devices may exhibit high-frequency power consumption fluctuations. Examples include the dynamic CPU frequency adjustment in smartphones running multimedia applications and the burst power management mechanisms in laptops. Handling these rapidly changing power consumption patterns in a conventional manner can lead to excessive false triggers or invalid predictions. To better identify and handle these complex power consumption patterns and avoid affecting the accuracy of the power management system's judgments due to frequent small fluctuations, further optimization of the triggering conditions and the calculation methods for power consumption changes is needed. The following section combines... Figure 2 The present application describes an intelligent identification and processing method for high-frequency power consumption variation scenarios: Please see Figure 2 This is a flowchart illustrating an intelligent identification and processing method for high-frequency power consumption variation scenarios in an embodiment of this application.

[0062] S201. Count the number of power consumption changes of the trigger port within a preset time period; A trigger port refers to the port on a smart power bank that can detect changes in power consumption and trigger corresponding control actions; it is typically an output or input port. The number of power consumption changes refers to the total number of times the power consumption value at the trigger port changes within a preset time period, including both increases and decreases in power consumption. The preset time period is a time window set according to the actual application scenario; it can be in the range of seconds, minutes, or hours. The specific value can be set according to the power bank's usage characteristics and control precision requirements, and is not limited here. The criterion for judging a power consumption change can be either the change in power consumption value relative to the previous moment exceeding a certain threshold, or the absolute change in power consumption value exceeding a certain fixed value; this is not limited here either.

[0063] In practical implementation, the first technical solution uses a timer interrupt for power consumption sampling and counting. The system sets a timer with a fixed frequency, for example, triggering an interrupt every 100 milliseconds. The interrupt service routine reads the current power consumption value of the trigger port and compares it with the previously sampled power consumption value. If the absolute value of the difference between the two sampled values ​​is greater than a preset power consumption change threshold, the power consumption change count counter is incremented by 1. Simultaneously, a time window buffer is maintained to record all power consumption sampled values ​​and the number of changes within a preset duration. The second technical solution uses an event-driven approach for power consumption change detection. A power consumption detection comparator is set in the hardware circuit. When the power consumption change at the trigger port exceeds a preset threshold, the comparator output level flips, triggering an external interrupt on the microcontroller. In the interrupt service routine, the timestamp of the power consumption change event is recorded, and the power consumption change count counter is updated. By maintaining a circular buffer to store the most recent power consumption change events within a preset duration, the number of power consumption changes can be counted in real time.

[0064] A potential technical problem encountered during this step is false counting due to noise interference in the power consumption sampling process. To address this, digital filtering can be added before power consumption change detection. Specifically, median or mean filtering can be applied to multiple continuously acquired power consumption samples to remove instantaneous noise spikes before power consumption change judgment. Simultaneously, a duration threshold for power consumption changes can be set; only when the power consumption change persists for more than this time threshold is it considered a valid power consumption change, thus avoiding false counting caused by instantaneous interference.

[0065] S202. Calculate the variance of the power consumption change value of the trigger port within a preset time period; The power consumption change value refers to the power consumption difference between two adjacent sampling times at the trigger port, which can be positive (power consumption increases) or negative (power consumption decreases). Variance is an important indicator in statistics for measuring the dispersion of data. It is obtained by calculating the average of the sum of squared deviations of all power consumption change values ​​from their mean. The larger the variance value, the greater the fluctuation of the power consumption change value and the more irregular the power consumption change pattern; the smaller the variance value, the more concentrated the power consumption change value and the more stable the power consumption change pattern. The preset duration is consistent with the preset duration in step S201 to ensure data synchronization, and is not limited here.

[0066] In practical implementation, the first technical solution uses the standard variance calculation formula for real-time calculation. First, an array of power consumption change values ​​is created to store all power consumption change values ​​within a preset time period. Then, the arithmetic mean of these power consumption change values ​​is calculated, which is the sum of all power consumption change values ​​divided by the number of power consumption changes. Next, the array of power consumption change values ​​is traversed, and the square of the difference between each power consumption change value and the average is calculated and summed. Finally, the sum of squares is divided by the number of power consumption changes to obtain the variance value. The second technical solution uses an incremental variance calculation method, suitable for real-time systems. Three variables are maintained: the cumulative sum of power consumption change values, the cumulative sum of the squares of power consumption change values, and the number of power consumption changes. Whenever a new power consumption change value is generated, these three variables are updated. The variance can be quickly calculated using the formula: Variance = (Sum of Squares / Number of Changes) - (Cumulative Sum / Number of Changes)². This method avoids storing all historical data, saving memory space.

[0067] A potential technical issue when performing this step is that the calculated variance may not be statistically significant when the number of power consumption changes is small. To address this, a minimum sample size threshold can be set. Variance calculation is only performed when the number of power consumption changes within a preset time period exceeds this threshold. If the number of power consumption changes is less than the minimum sample size threshold, the preset time period can be extended or a default variance value can be used for subsequent judgments to ensure stable system operation.

[0068] S203. If the number of power consumption changes is greater than the first preset threshold and the variance is less than the preset variance threshold, then the power consumption change value of the trigger port is accumulated and recorded until the accumulated value of the power consumption change value exceeds the preset threshold. Then, the step of obtaining the response port identifier that has a time association with the trigger port based on the timing association table is executed. The first preset threshold is a threshold used to determine the frequency of power consumption changes, typically set based on the power bank's usage scenario and control sensitivity requirements. The preset variance threshold is the upper limit of the variance used to determine the stability of power consumption changes. When the number of power consumption changes exceeds the first preset threshold and the variance is less than the preset variance threshold, it indicates that the trigger port experiences frequent but relatively consistent power consumption changes. In this case, a single power consumption change may not be sufficient to trigger a control action, requiring multiple cumulative changes. Cumulative recording involves algebraically summing each power consumption change value; positive values ​​indicate increased power consumption, and negative values ​​indicate decreased power consumption. The cumulative value reflects the overall trend of power consumption changes over a period of time. The preset threshold is the trigger threshold for the cumulative value; when the absolute value of the cumulative value exceeds this threshold, the power consumption change is considered to have reached a level requiring a response. The timing association table is a pre-established data structure recording the timing relationships between different ports. The response port identifier is a unique identifier for other ports that have a timing relationship with the trigger port.

[0069] In practical implementation, the first technical solution uses an accumulator to accumulate power consumption changes. An accumulator variable is set, initially set to 0. Whenever a power consumption change is detected and a condition is met, the change is added to the accumulator variable. Two preset thresholds are set, one positive and one negative, to correspond to power consumption increases and decreases, respectively. When the accumulated value is greater than the positive threshold, it indicates that power consumption has increased to the point where a response is needed; when the accumulated value is less than the negative threshold, it indicates that power consumption has decreased to the point where a response is needed. The second technical solution uses a sliding window accumulation method. A fixed-size circular buffer is maintained to store the N most recent power consumption changes. Each time a new power consumption change value is generated, it is added to the buffer, while the oldest value is removed. The accumulated value is the sum of all values ​​in the buffer. This method avoids the accumulated value from growing indefinitely and better reflects recent power consumption trends.

[0070] S204. If the number of power consumption changes is greater than the first preset threshold and the variance is not less than the preset variance threshold, the power consumption change value of the trigger port will be divided into a power consumption increase group or a power consumption decrease group according to whether the power consumption increases or decreases. When the number of power consumption changes exceeds a first preset threshold and the variance is not less than a preset variance threshold, it indicates that the power consumption change pattern of the trigger port is complex, involving both power consumption increases and decreases, with varying magnitudes. The power consumption increase group refers to the set of data where all power consumption change values ​​are positive, representing an increase in power consumption compared to the previous moment. The power consumption decrease group refers to the set of data where all power consumption change values ​​are negative, representing a decrease in power consumption compared to the previous moment. By grouping the power consumption change values, the characteristics of power consumption increases and decreases can be analyzed separately, providing a more accurate basis for subsequent control decisions. The grouping criterion is the positive or negative nature of the power consumption change value; positive values ​​are assigned to the power consumption increase group, negative values ​​to the power consumption decrease group, and zero values ​​can be assigned to any group or ignored based on actual needs; no restrictions are imposed here.

[0071] In practical implementation, the first technical solution uses a doubly linked list structure to store data for the power increase group and the power decrease group respectively. Two linked lists are created to store positive and negative power change values, respectively. Whenever a new power change value is generated, it is inserted into the corresponding linked list according to its positive or negative sign. In addition to storing the power change value, the linked list nodes can also store additional information such as timestamps, which facilitates subsequent timing analysis. The second technical solution uses a dynamic array approach to implement grouped storage. Two dynamic arrays are pre-allocated to store data for the power increase group and the power decrease group respectively. When a new power change value is generated, it is added to the corresponding array according to its sign. The dynamic arrays can automatically adjust their size according to the amount of data, ensuring storage efficiency while avoiding memory waste.

[0072] S205. Take the maximum value in the power consumption increase group or the maximum value in the power consumption decrease group as the power consumption change value of the trigger port, and then execute the step of obtaining the response port identifier that has a timing association with the trigger port based on the timing association table.

[0073] The maximum value in either the power increase group or the power decrease group is used as the power change value of the trigger port. Afterward, the number of times the trigger port switches from the power increase group to the power decrease group or vice versa within a preset time period is counted. When the number of switches exceeds a preset switching threshold, the power increase group and the power decrease group are divided into multiple time periods in chronological order. The average power change value within each time period is calculated. The maximum absolute value of the difference between the average values ​​of adjacent time periods is used as the power change value of the trigger port. Finally, the step of obtaining the response port identifier that has a time-series association with the trigger port based on the timing association table is executed.

[0074] The maximum value in the power increase group represents the maximum increase in power consumption at the trigger port within a preset time period, reflecting the peak characteristics of the power increase. The maximum value in the power decrease group refers to the largest negative number in the group, representing the maximum decrease in power consumption. Selecting the maximum value as the representative power consumption change value can capture the extreme cases of power consumption change, which is of great significance for application scenarios that require rapid response to large power consumption changes. In some cases, it may be necessary to consider both the maximum values ​​of power increase and decrease, or one of them may be selected according to actual application requirements; this is not limited here. After determining the representative power consumption change value, the response port that has a timing relationship with the trigger port is found based on the pre-established timing association table, providing a basis for subsequent power consumption control.

[0075] In practical implementation, the first technical solution is to find the maximum value by traversing and comparing. The power consumption increase group is traversed, and the largest positive value is found by comparing each value; the power consumption decrease group is traversed, and the largest negative value is found by comparing each value. Then, according to a preset selection strategy, it is determined which maximum value to use as the power consumption change value for the trigger port. The selection strategy can be: prioritizing the larger absolute value, or selecting the maximum value of the corresponding group based on the current working state of the power bank (charging / discharging). The second technical solution is to maintain the maximum value using a heap structure. A maximum heap is maintained for the power consumption increase group, and a minimum heap (storing negative values) is maintained for the power consumption decrease group. Whenever a new power consumption change value is added to the corresponding group, the corresponding heap structure is updated. This allows the maximum value of each group to be obtained in O(1) time complexity, improving the real-time performance of the system.

[0076] A potential technical issue when performing this step is that, with frequent switching of power consumption change modes, simply using the maximum value may not accurately reflect the overall characteristics of power consumption changes. To address this, after obtaining the maximum value, the switching characteristics of power consumption changes can be further analyzed. Specifically, the number of times the trigger port switches from the power consumption increase group to the power consumption decrease group or vice versa within a preset time period is counted. When the number of switches exceeds a preset switching threshold, the power consumption increase group and the power consumption decrease group are divided into multiple time periods in chronological order. The average power consumption change value within each time period is calculated, and the maximum absolute value of the difference between the average values ​​of adjacent time periods is taken as the power consumption change value of the trigger port, thus more accurately reflecting the dynamic characteristics of power consumption changes.

[0077] In the above embodiments, when the minimum historical power consumption change interval of a certain output port is detected to be less than a preset time threshold, it indicates that the port exhibits high-frequency power consumption change behavior. Further calculation of the standard deviation of the historical power consumption change amplitude of the port reveals that when the standard deviation is less than a preset amplitude threshold, it indicates that although the changes are frequent, the amplitude is relatively stable. This situation typically corresponds to the device's gradual power consumption adjustment process. By grouping adjacent power consumption changes with time intervals less than the preset time threshold into the same group, a series of related power consumption changes occurring within a short period can be identified, avoiding the misinterpretation of these changes, which essentially belong to the same power consumption adjustment process, as multiple independent events. Accumulating the power consumption change values ​​within the same group yields the group power consumption change value, reflecting the actual power consumption demand variation of the device, improving the accuracy of power prediction and allocation, reducing unnecessary power reservations, and enhancing the overall utilization efficiency of the power bank.

[0078] The mobile power bank in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference]. Figure 3 This is a schematic diagram of the physical structure of a mobile power supply provided in an embodiment of this application.

[0079] It should be noted that, Figure 3 The structure of the power bank shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0080] like Figure 3 As shown, the power bank includes a Central Processing Unit (CPU) 301, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on a program stored in Read-Only Memory (ROM) 302 or a program loaded from storage portion 308 into Random Access Memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the power bank. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An Input / Output (I / O) interface 305 is also connected to the bus 304.

[0081] The following components are connected to I / O interface 305: input section 306 including a camera, infrared sensor, etc.; output section 307 including a liquid crystal display (LCD) and speakers, etc.; storage section 308 including a hard disk, etc.; and communication section 309 including a network interface card such as a LAN (Local Area Network) card and a modem, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.

[0082] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the various functions defined in the present invention.

[0083] It should be noted that the computer-readable medium shown in the embodiments of the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electric, magnetic, optical, electromagnetic, infrared, or semiconductor power supply, device, or apparatus, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. The transmitted data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof.

[0084] 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 the present invention. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains 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 a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may 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.

[0085] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the portable power bank described in the above embodiments; or it may exist independently and not assembled into the portable power bank. The storage medium carries one or more computer programs that, when executed by a processor of a portable power bank, cause the portable power bank to implement the methods provided in the above embodiments.

[0086] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0087] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

[0088] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0089] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for controlling an intelligent mobile power supply, characterized in that, include: The instantaneous power consumption value of each output port of the power bank is acquired in real time, and a timestamp is recorded when the instantaneous power consumption value changes; Based on the instantaneous power consumption value and the corresponding timestamp, a time-series correlation of port power consumption change is established. The time-series correlation of port power consumption change includes trigger port, response port, time delay interval and correlation confidence. The correlation confidence characterizes the historical frequency proportion of the power consumption change of the trigger port causing the power consumption change of the response port within the time delay interval. If the power consumption change value of the trigger port exceeds a preset threshold, the response port identifier that has a time-series association with the trigger port is obtained based on the timing association table, and the expected power consumption change time of the response port is calculated according to the corresponding time delay interval. Before the expected power consumption change time, the estimated power consumption value of the response port is reserved from the available power of the power bank, and the estimated power consumption value is marked as pending allocation. When the power consumption of the response port changes at the expected power consumption change time, the estimated power consumption value in the pending state is converted to the allocated state, and the corresponding association confidence in the timing association table is updated. If the response port does not experience a power change at the expected power change time, the estimated power value in the pending allocation state will be restored to the available power, and the corresponding association confidence in the timing association table will be reduced. When the available power is less than the preset remaining threshold, the estimated power consumption value of the power in the pending allocation state is restored to the available power in order of association confidence from low to high, until the available power is greater than the preset remaining threshold.

2. The method according to claim 1, characterized in that, The step of reserving the estimated power consumption value of the response port from the available power of the power bank specifically includes: Obtain the power consumption change records of the response port that are time-related to the trigger port in the historical records; Based on the power consumption change records, the correspondence between the current power consumption change value of the trigger port and the power consumption change value of the response port is extracted; The estimated power consumption value is the sum of the product of the current power consumption change value and the historical power consumption change ratio of the trigger port and the power consumption change value of the response port.

3. The method according to claim 2, characterized in that, After taking the sum of the product of the current power consumption change value and the historical power consumption change ratio of the trigger port and the power consumption change value of the response port as the estimated power consumption value, the method further includes: Determine whether the available power of the power bank is greater than the estimated power consumption value; If so, the estimated power consumption value is deducted from the available power, and the estimated power consumption value is marked as pending allocation. If not, the estimated power consumption values ​​in the pending allocation state are released in order of increasing association confidence until the available power is greater than the estimated power consumption value, and the timing associations corresponding to the released estimated power consumption values ​​in the pending allocation state are deleted from the timing association table.

4. The method according to claim 1, characterized in that, After restoring the estimated power consumption value in the pending allocation state to the available power, the method further includes: The number of power consumption changes at the trigger port within a preset time period is counted. Calculate the variance of the power consumption change value of the trigger port within the preset time period; If the number of power consumption changes is greater than a first preset threshold and the variance is less than a preset variance threshold, then the power consumption change value of the trigger port is accumulated and recorded until the accumulated value of the power consumption change value exceeds the preset threshold, and then the step of obtaining the response port identifier that has a time association with the trigger port based on the time association table is executed. If the number of power consumption changes is greater than the first preset threshold and the variance is not less than the preset variance threshold, then the power consumption change value of the trigger port is divided into a power consumption increase group or a power consumption decrease group according to whether the power consumption increases or decreases. The maximum value in the power consumption increase group or the maximum value in the power consumption decrease group is used as the power consumption change value of the trigger port, and then the step of obtaining the response port identifier that has a timing association with the trigger port based on the timing association table is executed.

5. The method according to claim 4, characterized in that, After setting the maximum value in the power consumption increase group or the maximum value in the power consumption decrease group as the power consumption change value of the trigger port, the method further includes: The number of times the trigger port switches from the power consumption increase group to the power consumption decrease group or from the power consumption decrease group to the power consumption increase group within the preset time period is counted. When the number of switching times exceeds a preset switching threshold, the power consumption increase group and the power consumption decrease group are divided into multiple time periods in chronological order; Calculate the average value of the power consumption change within each of the aforementioned time periods; The maximum absolute value of the difference between the average values ​​of adjacent time periods is taken as the power consumption change value of the trigger port.

6. The method according to claim 1, characterized in that, After restoring the estimated power consumption value in the pending allocation state to the available power, the method further includes: The minimum value of the historical power consumption change interval for each of the output ports is calculated. If the minimum value is less than the preset time threshold, then the standard deviation of the historical power consumption change amplitude of the corresponding output port is calculated; When the standard deviation is less than the preset amplitude threshold, the historical power consumption change records of the output port are grouped, and adjacent power consumption changes with a time interval less than the preset time threshold are divided into the same group. The power consumption change values ​​within the same group are summed to obtain the group power consumption change value; The power consumption change value of the group is used as the power consumption change value of the trigger port; Based on the time distribution of power consumption changes within the same group, calculate the average rate of change of power consumption in the group. The preset threshold is adjusted based on the average rate of change.

7. The method according to claim 6, characterized in that, The step of adjusting the preset threshold according to the average rate of change specifically includes: When the average rate of change is greater than the first rate threshold, the adjustment coefficient is set to the first preset value; When the average rate of change is greater than the second rate threshold but not greater than the first rate threshold, the adjustment coefficient is set to the second preset value. When the average rate of change is not greater than the second rate threshold, the adjustment coefficient is set to a third preset value; the first preset value is greater than the second preset value, and the second preset value is greater than the third preset value; Multiply the preset threshold by the adjustment coefficient to obtain the adjusted preset threshold.

8. A portable power bank, characterized in that, The portable power bank includes: One or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the power supply to perform the method as described in any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on the power bank, the power bank performs the method as described in any one of claims 1-7.

10. A computer program product, characterized in that, When the computer program product is run on a power bank, it causes the power bank to perform the method as described in any one of claims 1-7.