A self-adaptive charging control method, system and storage medium for a wireless device
By establishing a charging management context when a wireless device accesses the device and using a timed scheduling and classification model to determine the disconnection and restoration of the charging link, the problem of unreasonable power consumption and resource allocation in the charging management of wireless devices is solved, and reliable charging control under low power conditions is achieved.
Patent Information
- Application Number
- CN202611681610.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-28
- Publication Date
- 2026-11-27
AI Technical Summary
Existing wireless device charging management suffers from problems such as energy consumption and battery aging due to continuous power supply, excessive power consumption, unreasonable allocation of charging resources, and insufficient automation. In particular, it is difficult to achieve reliable charging status monitoring and control when electronic devices are in low power consumption or sleep mode.
By establishing a charging management context when a wireless device accesses the system, acquiring status information in low-power or sleep mode using timed scheduling, and outputting disconnection and recovery probabilities using a classification model, the system combines extended status data to determine the disconnection and recovery of the charging link, thus forming a management closed loop and reducing unnecessary continuous power supply.
It enables continuous monitoring of wireless device charging status in a low-power state, reducing power consumption and battery aging risks, improving the reliability and automation of charging control, and reducing system wake-up times and power consumption.
Smart Images

Figure CN123184342A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power management technology for electronic devices, and in particular to an adaptive charging control method, system, and storage medium for wireless devices. Background Technology
[0002] With the widespread application of wireless charging technology in wireless devices such as styluses, wireless keyboards, wireless mice, headphones, and wearable devices, establishing charging connections between electronic devices and wireless devices via magnetic attraction or wireless induction has become common. After such wireless devices are connected to electronic devices, the electronic devices typically provide continuous wireless charging power and obtain information such as the wireless device's location status and battery level through system power management services or charging management chips.
[0003] In existing technologies, charging management for wireless devices often employs a continuous power supply approach: as long as the wireless device is in place or connected, the charging link remains active until the device is removed or the user manually disables the charging function. This approach has the following problems: First, maintaining the charging connection after the wireless device is fully charged causes unnecessary power consumption and keeps the device's battery in a fully charged state for extended periods, accelerating battery aging; second, continuously occupying communication links and charging resources is detrimental to the overall power consumption control of electronic devices; third, users need to manually disconnect or disable the charging function, which is inconvenient and makes seamless automated management difficult.
[0004] To reduce energy consumption from continuous power supply, some solutions use a fixed-period polling method to detect the battery level of wireless devices and disconnect the charging link after detecting a full charge. However, fixed-period polling makes it difficult to balance low power consumption and timeliness: too short a polling interval increases the number of system wake-ups and power consumption, while too long a polling interval may miss full charge status; especially after electronic devices enter a low-power state or sleep state, ordinary timed tasks may be delayed, resulting in the charging connection remaining open for a long time after a full charge. At the same time, judging a full charge based solely on a single threshold of battery level is easily affected by factors such as battery level reporting fluctuations, trickle charging, and temperature changes, posing a risk of misjudgment; disconnecting when the battery level briefly reaches the threshold but is not actually fully charged, or disconnecting prematurely when the battery level shows full charge but the charging current is still high, will affect charging reliability.
[0005] Furthermore, existing solutions do not adequately consider recovery control after the charging link is disconnected: if charging is resumed solely based on a fixed power threshold after a wireless device is disconnected, frequent disconnections and reconnections of the charging link may be triggered due to small fluctuations in power level, resulting in repeated on / off cycles; if recovery relies entirely on manual user operation, the level of automation is insufficient. For electronic devices that support simultaneous access from multiple wireless devices, each device has different charging needs, remaining power, and charging status. Simply executing charging and disconnection according to the access order or a uniform strategy can easily lead to unreasonable allocation of charging resources; multiple wireless devices maintaining their own timed detection tasks will also increase the number of system wake-ups, further exacerbating the power consumption problem.
[0006] Therefore, how to continuously monitor the charging status of wireless devices with low system overhead in low power or sleep states of electronic devices, how to combine extended status data at key nodes to make more reliable disconnection determinations, and how to achieve reasonable restoration of the charging link with low power consumption after disconnection have become urgent technical problems to be solved in adaptive charging control of wireless devices. Summary of the Invention
[0007] In order to solve the above-mentioned technical problems, the present invention provides an adaptive charging control method, system and storage medium for wireless devices.
[0008] The technical solution of this invention is implemented as follows:
[0009] This invention provides an adaptive charging control method for wireless devices, comprising:
[0010] S1. In response to a wireless device access event, establish a charging management context for the accessed wireless device;
[0011] S2. When the disconnection condition is not met, the status information of the wireless device is obtained according to the detection interval through a timed scheduling that can be executed in the low power state or sleep state of the electronic device.
[0012] S3. In response to meeting the preset extension determination trigger condition, acquire the extension status data of the wireless device, and use a classification model to output the disconnection probability and recovery probability of the extension status data;
[0013] If the extended determination trigger condition is not met, the disconnection probability and the recovery probability are set to preset default values;
[0014] S4. Based on the status information and the disconnection probability, determine whether the disconnection condition is met;
[0015] S5. When the disconnection condition is met, perform the disconnection operation of the charging link and put the wireless device into a low power recovery monitoring state.
[0016] S6. In the low-power recovery monitoring state, acquire the feedback data after disconnection;
[0017] The charging link of the wireless device is restored when the recovery conditions are met, or when the recovery probability and the feedback data after disconnection meet the recovery threshold.
[0018] In one embodiment, during S1, when the electronic device is connected to two or more wireless devices simultaneously, a charging management context is maintained for each connected wireless device.
[0019] The charging management context, charging status, and next detection time are persistently stored, and the charging management status is restored after the system wakes up from hibernation or restarts.
[0020] In one embodiment, in step S2, the status information includes at least one of an in-place status, a power level, and a charging status;
[0021] The detection interval is determined based on the status information: a longer detection interval is used when the difference between the power value and the disconnection threshold is large, and a shorter detection interval is used when the difference is small.
[0022] Extend the detection interval when the electronic device is in sleep or low power mode;
[0023] In the low-power recovery monitoring state, a longer detection interval than in the low-power monitoring state is used, or the detection is triggered by an event by a wireless device.
[0024] The timed scheduling refers to a system timed task that can be executed while the electronic device is in sleep mode;
[0025] The wireless device access event includes a magnetic connection event or a wireless charging in-place event;
[0026] The wireless device includes a stylus or wearable device;
[0027] The detection tasks for two or more wireless devices targeting the same electronic device are merged into a single timed task to reduce the number of system wake-ups.
[0028] The system counts at least one of the following: charging time, number of disconnections, and number of recoveries of the wireless device, and adjusts the detection interval based on the statistical results.
[0029] In one embodiment, in step S2, the status information is obtained through a unified power attribute interface;
[0030] The wireless device access event is obtained from system input events or reported by the power management service;
[0031] If reading the unified power attribute interface fails, a retry will be performed, and after a timeout, the process will fall back to the default detection interval.
[0032] In one embodiment, in S3, the preset extended determination triggering condition includes abnormal power changes or minor current fluctuations.
[0033] Under continuous power supply, the in-situ status data and power change data of wireless devices are acquired, and support vector machine is used for feature extraction to obtain multi-dimensional state features and first state confidence.
[0034] If the multidimensional state features and the first state confidence level meet the preset sleep trigger threshold, then the minute current fluctuation data and real-time impedance change data in the sleep state are obtained.
[0035] Random forest is used to classify the small current fluctuation data and the real-time impedance change data to obtain the link disconnection probability and the link recovery probability.
[0036] In one embodiment, in step S4, when the disconnection probability is greater than a preset disconnection threshold, it is determined that the disconnection condition is met.
[0037] When the disconnection probability is not greater than the preset disconnection threshold, the status information is used to determine whether the disconnection condition is met.
[0038] In one embodiment, in step S5, the disconnection condition includes at least one of the following: the power level reaches a preset threshold, the charging current is lower than a preset current threshold, and the power change rate is lower than a preset change rate.
[0039] Meeting the disconnection condition includes meeting the disconnection condition within a consecutive preset number of detection cycles, where the preset number is an integer greater than or equal to 2;
[0040] If the condition is not met, the system returns to the monitoring state and uses a hysteresis threshold lower than the preset threshold as the entry condition for the next disconnection confirmation.
[0041] When performing the disconnect charging link operation, the communication link between the wireless device and the electronic device is maintained, and the disconnection timestamp and disconnection ambient temperature data are recorded;
[0042] When disconnecting the charging link fails, a retry will be performed, and the charging link will be maintained and an alarm message will be output after a preset number of consecutive failures.
[0043] The preset threshold can be dynamically configured based on at least one of the following: battery protection mode, user settings, device temperature, and historical usage behavior. The preset threshold includes a 100% full charge threshold or a battery protection upper limit below 100%.
[0044] When the electronic device is connected to two or more wireless devices at the same time, the charging resources of the two or more wireless devices are arbitrated according to a preset arbitration strategy. One of the following methods is adopted: time-sharing charging, parallel charging, or serial charging. Charging operation is performed on the wireless devices that are not disconnected, and the charging link is disconnected on the wireless devices that meet the disconnection conditions.
[0045] In one embodiment, in step S6, the recovery condition includes at least one of the following: the battery level is below a recovery threshold, the wireless device is in use, the wireless device is reconnected, and a user request.
[0046] When restoring the charging link of the wireless device, the communication link between the wireless device and the electronic device is restored first, and then the charging link is restored.
[0047] When the electronic device is connected to two or more wireless devices at the same time, the charging link of each wireless device is restored according to a preset arbitration strategy.
[0048] The recovery threshold can be dynamically configured based on at least one of the following: battery protection mode, user settings, device temperature, and historical usage behavior.
[0049] The recovery probability and the feedback data after disconnection satisfying the recovery threshold include: collecting real-time position offset data and electromagnetic induction feedback data after disconnection, and using a decision tree algorithm to perform logical operations on the real-time position offset data and the electromagnetic induction feedback data to obtain a dynamic wake-up evaluation value and a second state confidence level.
[0050] If the product of the dynamic wake-up evaluation value, the second state confidence level, and the recovery probability exceeds a preset recovery threshold, then the recovery threshold is determined to be met.
[0051] To address the aforementioned technical problems, the present invention also provides an adaptive charging control system for wireless devices, comprising:
[0052] The event acquisition module is used to respond to wireless device access events and establish a charging management context for the accessed wireless devices.
[0053] The status acquisition module is used to acquire the status information of the wireless device according to the detection interval by means of a timed schedule that can be executed in the low power state or sleep state of the electronic device when the disconnection condition is not met.
[0054] The precision determination module is used to acquire the extended status data of the wireless device in response to the satisfaction of a preset extended determination trigger condition, and to output the disconnection probability and recovery probability of the extended status data using a classification model; when the extended determination trigger condition is not satisfied, the disconnection probability and the recovery probability are determined to preset default values.
[0055] The fusion decision module is used to determine whether the disconnection condition is met based on the status information and the disconnection probability.
[0056] The disconnection execution module is used to perform a disconnection operation on the charging link when the disconnection condition is met, and to put the wireless device into a low-power recovery monitoring state.
[0057] The recovery module is used to acquire feedback data after disconnection in the low power recovery monitoring state, and restore the charging link of the wireless device when the recovery conditions are met, or when the recovery probability and the feedback data after disconnection meet the recovery threshold.
[0058] The system is configured to perform an adaptive charging control method for wireless devices as described in any of the preceding claims.
[0059] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements an adaptive charging control method for wireless devices as described above.
[0060] Compared with the prior art, the present invention has the following advantages:
[0061] 1. This invention establishes a charging management context when a wireless device connects, and acquires status information at detection intervals through timed scheduling that can be executed in the low-power or sleep state of the electronic device when the disconnection condition is not met. When the extended determination trigger condition is met, extended status data is acquired, and a classification model is used to output the disconnection probability and recovery probability. Based on this, the state information is combined to determine and execute the disconnection of the charging link operation, so that the wireless device enters a low-power recovery monitoring state. This solves the problem of power consumption and battery aging caused by the continuous power supply after the wireless device is fully charged. At the same time, the access, monitoring, disconnection and recovery of the wireless device form a management closed loop around the same charging management context, reducing unnecessary continuous power supply.
[0062] 2. By adopting a timed scheduling that can be executed in the low power state or sleep state of electronic devices, the status information of wireless devices is obtained according to the detection interval, which solves the problem that ordinary timed tasks are easily delayed after the electronic devices are in sleep state and do not turn on for a long time after being fully charged; at the same time, when the extended judgment trigger condition is not met, the disconnection probability and recovery probability are set to preset default values, so that the judgment chain is not interrupted when the extended judgment is not triggered, which takes into account the continuous monitoring capability in the sleep state and the control of system overhead.
[0063] 3. By acquiring extended status data when the preset extended determination trigger conditions are met, and using a classification model to output the disconnection probability and recovery probability of the extended status data, and then determining whether the disconnection condition is met based on the status information and disconnection probability, the problem of misjudgment caused by relying solely on a single power threshold to determine full charge is easily affected by power reporting jitter, trickle charging, and temperature changes. At the same time, it enables the disconnection determination to combine real-time status with the probability output by the classification model, improving the adaptability to different charging stages and different wireless devices.
[0064] 4. By enabling the wireless device to enter a low-power recovery monitoring state after the charging link is disconnected, and acquiring feedback data after disconnection in this state, the charging link is restored when the recovery conditions are met, or when the recovery probability and the feedback data after disconnection meet the recovery threshold. This solves the problems of insufficient recovery control after disconnection, frequent on / off switching due to power fluctuations, or reliance on manual operation by the user. At the same time, it reduces the system overhead of the recovery monitoring phase and improves the rationality of charging link recovery control. Attached Figure Description
[0065] Figure 1 This is a flowchart of an adaptive charging control method for wireless devices, as described in Example 1.
[0066] Figure 2 This is a schematic diagram illustrating the switching between charging monitoring and recovery monitoring states in Example 1;
[0067] Figure 3 This is a flowchart of the fine determination and fusion determination process in Example 1;
[0068] Figure 4 This is a framework diagram of an adaptive charging control system for wireless devices, as shown in Example 2. Detailed Implementation
[0069] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0070] Example 1
[0071] like Figure 1-3 As shown, this embodiment provides an adaptive charging control method for wireless devices, which is applied to electronic devices that can establish a charging connection with wirelessly rechargeable devices.
[0072] The electronic device can be a tablet computer, mobile phone, laptop computer, vehicle terminal, smart home control terminal, etc.; the wireless device can be a stylus, wireless keyboard, wireless mouse, touchpad, earphone, wearable device, etc. that supports magnetic charging or wireless charging.
[0073] This embodiment uses a tablet computer as the electronic device and a magnetic stylus as the wireless device for illustration, but the present invention is not limited thereto.
[0074] The specific method is as follows:
[0075] S1. In response to a wireless device access event, establish a charging management context for the accessed wireless device.
[0076] Among them, wireless device access events are used to characterize the establishment or existence of a charging connection relationship between wireless devices and electronic devices;
[0077] The wireless device access event includes at least one of the following: magnetic connection event, wireless charging in place event, and input device connection event. For example, when a stylus is magnetically attached to the side of a tablet computer, the tablet computer's Hall sensor, magnetic sensor, wireless charging chip, or input subsystem generates an access event.
[0078] The tablet's power management service or system input service reports the access event to the charging management service, which then responds to the access event by establishing a charging management context for the currently accessed stylus.
[0079] The charging management context is used to record the charging management status of the same wireless device, including but not limited to:
[0080] The device must contain at least one of the following information: wireless device identifier, access time, current charging status, last detection time, next detection time, current detection interval, last battery level, last disconnection probability, last recovery probability, number of disconnections, number of recoverys, and whether it is in a low-power recovery monitoring state. To facilitate multi-device management, when an electronic device is connected to two or more wireless devices simultaneously, a charging management context is maintained for each connected wireless device, and each charging management context is distinguished from the other by the wireless device identifier.
[0081] In one embodiment, the charging management context, charging status, and next detection time are persistently stored, for example, in the non-volatile storage area of the electronic device or the persistent partition of system attributes. When the electronic device wakes up from hibernation or restarts, the charging management service reads the persistently stored charging management context, charging status, and next detection time to restore the charging management status, thereby avoiding repeated disconnections or missed detections due to hibernation wake-up or restart.
[0082] S2. When the disconnection condition is not met, the status information of the wireless device is obtained according to the detection interval through a timed scheduling that can be executed in the low power state or sleep state of the electronic device.
[0083] The disconnection condition is used to characterize whether the charging link needs to be disconnected for the wireless device. If the disconnection condition is not met, the charging management service does not perform the disconnection operation, but instead periodically obtains the status information of the wireless device at the detection interval through timed scheduling to continuously monitor the charging-related status of the wireless device.
[0084] The timed scheduling refers to system timed tasks that can be executed in the low-power state or sleep state of electronic devices. For example, in the Android system, at least one of the following can be used: AlarmManager's setExactAndAllowWhileIdle timer, a timed task that can be executed in Doze mode, a JobScheduler task, or a WorkManager task. Taking AlarmManager as an example, the charging management service registers a timed broadcast receiver and sets the trigger time through setExactAndAllowWhileIdle, so that the electronic device can still wake up and perform status detection when the trigger time arrives after entering the Doze or sleep state. Compared with ordinary timed tasks, this method can reduce the situation where timed tasks are delayed in the sleep state.
[0085] The status information includes at least one of the following: in-place status, battery level, and charging status. The in-place status indicates whether the wireless device is still connected to the electronic device or in a charging in-place relationship. The battery level indicates the remaining battery power of the wireless device. The charging status indicates whether the wireless device is currently in a charging, discharging, fully charged, or not charging state. The status information can be obtained through a unified power attribute interface, which is used to abstract system power attribute nodes and / or manufacturer-defined nodes, so that the charging management service does not have to adapt the node reading logic separately for each type of wireless device.
[0086] In one embodiment, status information is obtained through the Androidpower_supply subsystem, and at least one of the CAPACITY, STATUS, PRESENT, ONLINE, and TEMP attributes is read.
[0087] And / or read custom nodes, such as at least one of / sys / class / power_supply / battery / wireless_uisc, / sys / class / stylus / battery_capacity, and / sys / class / power_supply / battery / wireless_exit. Here, wireless_uisc can be used to enable or disable wireless charging, battery_capacity can be used to represent a battery level from 0 to 100%, and wireless_exit can be used to indicate a disconnected or connected state. To enable system services to read and write to these nodes, configure the corresponding permission rules in the device's SELinux file, granting the charging management service permission to read and write to the corresponding nodes.
[0088] The wireless device access event can be obtained from system input events or power management services. For example, it can be obtained by intercepting pen connection or disconnection events through PhoneWindowManager's interceptKeyBeforeQueueing, or by being reported by the input subsystem, wireless charging chip, or power management service.
[0089] In one embodiment, when reading the unified power attribute interface fails, a retry is performed, and after a timeout, the process falls back to the default detection interval. For example, if the reading still fails after three consecutive retries, the next detection interval is set to the default value to avoid monitoring interruption due to a single reading failure.
[0090] The detection interval can be determined based on status information, specifically including: a longer detection interval when the difference between the battery level and the disconnection threshold is large, and a shorter detection interval when the difference is small; extending the detection interval when the electronic device is in sleep mode or low battery mode; shortening the detection interval when the temperature exceeds a preset temperature threshold or the charging rate is abnormal; using a longer detection interval than the incomplete charge monitoring state in low power recovery monitoring state, or being triggered by a wireless device usage event. For example, when the battery level is 60% and the disconnection threshold is 100%, the difference is large, so a 10-minute detection interval can be used; when the battery level is 95%, the difference is small, so a 2-minute detection interval can be used; after the electronic device enters sleep mode, the interval can be extended to 15 minutes; when entering low power recovery monitoring state after disconnection, a 30-minute detection interval can be used, and detection can be triggered in advance when a wireless device is detected to be in use.
[0091] To reduce the number of system wake-ups, when there are two or more wireless devices on the same electronic device, the detection tasks for the two or more wireless devices on the same electronic device are merged into a single timed task. For example, when the next detection time of multiple wireless devices is close, the earliest next detection time is taken as the trigger time of the unified timed task. After triggering, the status information of each wireless device is read sequentially or in parallel, avoiding the need to register a timed task for each wireless device separately.
[0092] In one embodiment, at least one of the charging time, disconnection count, and recovery count of the wireless device is counted, and the detection interval is adjusted based on the statistical results. For example, when the number of disconnections of the same wireless device exceeds a preset number within a preset period, the detection interval is extended; when the number of recovery counts is frequent, the detection interval in the low-power recovery monitoring state is extended.
[0093] Step S3: In response to the satisfaction of a preset extension determination trigger condition, acquire the extension status data of the wireless device, and output the disconnection probability and recovery probability of the extension status data using a classification model; if the extension determination trigger condition is not satisfied, determine the disconnection probability and the recovery probability as preset default values.
[0094] The extended decision trigger condition is used to indicate whether the classification model needs to be activated for extended decision-making.
[0095] The extended determination triggering conditions include abnormal power changes or minor current fluctuations. Abnormal power changes include, for example, power value jumps exceeding a preset range between adjacent detection cycles, power value remaining unchanged for a long time, and power value reaching near the disconnection threshold. Minor current fluctuations include, for example, charging current being lower than a preset current threshold and fluctuation range exceeding a preset range.
[0096] When the extension determination trigger condition is met, the extension status data of the wireless device is acquired. The extension status data includes, but is not limited to:
[0097] At least one of the following: wireless device in-situ status data under continuous power supply, power change data, minute current fluctuation data under sleep state, and real-time impedance change data.
[0098] In one embodiment, the acquisition and classification processing of extended state data includes:
[0099] Under continuous power supply, the in-situ status data and power change data of wireless devices are acquired, and support vector machine is used for feature extraction to obtain multi-dimensional state features and first state confidence.
[0100] If the multidimensional state features and the first state confidence level meet the preset sleep trigger threshold, then the minute current fluctuation data and real-time impedance change data in the sleep state are obtained.
[0101] Random forest is used to classify the small current fluctuation data and the real-time impedance change data to obtain the link disconnection probability and the link recovery probability.
[0102] Among them, the support vector machine is used to extract features from the feature vectors constructed from the in-situ state data and the power change data, and output multi-dimensional state features and first state confidence.
[0103] The first state confidence is used to characterize the degree of confidence that the wireless device is in a stable charging or near-fully charged state under the current feature combination. The support vector machine takes in-situ state data, power change data, etc. as input as feature vectors and outputs the first state confidence. When the first state confidence meets the sleep trigger threshold, it indicates that the wireless device may enter a static or sleep state. At this time, small current fluctuation data and real-time impedance change data are further collected to capture subtle charging changes that are not easily detected under continuous power supply.
[0104] Random forest takes small current fluctuation data and real-time impedance change data as input and outputs link disconnection probability and link recovery probability. The link disconnection probability is used to characterize the probability that it is appropriate to disconnect the charging link in the current state.
[0105] Link recovery probability is used to characterize the probability that a charging link is suitable for restoration after a disconnection. The probability output of a random forest can be obtained by averaging the proportion of positive classes in each decision tree leaf node.
[0106] If the extended judgment trigger condition is not met, the classification model inference is not started, and the disconnection probability and recovery probability are set to preset default values. In this embodiment, the preset default value is 0, that is, the default value of the disconnection probability is 0 and the default value of the recovery probability is 0. If the extended judgment trigger condition is met, but the confidence of the first state does not reach the dormant trigger threshold, the random forest is not started, and the disconnection probability and recovery probability are also set to 0.
[0107] Let the disconnection threshold in the disconnection determination phase be... ,and If the value is greater than 0, then the default value satisfies: =0< Therefore, the disconnection determination phase will not be disconnected due to the probability branch triggered by the default value, and can only enter the state information fallback determination.
[0108] Let the recovery threshold in the recovery determination phase be... ,and >0, Dynamic wake-up evaluation value ∈[0,1], second-state confidence If ∈[0,1], then the default value satisfies: · · =0< ;
[0109] Therefore, the recovery determination phase will not trigger the probability branch recovery due to the default value, but can only enter the recovery condition determination. The default value is mathematically excluded from the probability triggering path, which neither blocks the fallback determination of state information and recovery conditions, nor causes false disconnection or false recovery.
[0110] Upon disconnection, the charging management service saves the recovery probability obtained from the most recent extended determination to the charging management context; if the most recent extended determination was not triggered and the probability is the default value of 0, then 0 is saved. After entering the low-power recovery monitoring state, if the extended determination is triggered again and the recovery probability is updated, the updated value is used; if it is not updated, the value saved when disconnected is used.
[0111] S4. Based on the status information and the disconnection probability, determine whether the disconnection condition is met.
[0112] In this step, let the disconnection probability of the k-th detection period be... The disconnection threshold is The status information determination result is If ∈{0,1}, then the decision result is broken. It can be represented as: ,in =1 indicates that the status information meets the disconnection condition. =0 indicates that the condition is not met. In this embodiment, the condition is directly disconnected when the probability is high; when the probability is low, the condition is not rejected based on probability, but is determined by the state information to avoid missing the condition due to the conservative classification model.
[0113] when When =0, it will inevitably enter Branches, with the same safety as default values.
[0114] Status information determination result One implementation is as follows: when the power level reaches a preset threshold, the charging current is lower than a preset current threshold, the power change rate is lower than a preset change rate, and the above conditions are met for N consecutive detection cycles, =1; otherwise =0, where N is an integer greater than or equal to 2.
[0115] S5. When the disconnection condition is met, perform the disconnection operation of the charging link and put the wireless device into the low power recovery monitoring state.
[0116] The disconnection condition includes at least one of the following: the power level reaches a preset threshold, the charging current is lower than a preset current threshold, and the power change rate is lower than a preset change rate.
[0117] The preset threshold includes a 100% full charge threshold or a battery protection upper limit below 100%. For example, the preset threshold can be set to 100%, or it can be set to 80% or 90% as the battery protection upper limit. The preset threshold can be dynamically configured according to at least one of the following: battery protection mode, user settings, device temperature, and historical usage behavior.
[0118] To avoid accidental disconnection due to battery fluctuations, the disconnection condition is met if the disconnection condition is met for a preset number of consecutive detection cycles. The preset number is an integer greater than or equal to 2. For example, the disconnection condition is determined to be met only if the battery level reaches a preset threshold and the charging current is lower than a preset current threshold for three consecutive detection cycles.
[0119] If the condition is not met, the system returns to the monitoring state and uses a hysteresis threshold lower than the preset threshold as the entry condition for the next disconnection confirmation. For example, if the preset threshold is 100%, the hysteresis threshold can be set to 95%. That is, the battery level must first drop to below 95% and then rise back to around 100% before re-entering the disconnection confirmation process, thus avoiding repeated determinations around 100%.
[0120] When performing the disconnect charging link operation, the communication link between the wireless device and the electronic device is maintained. That is, the charging link is disconnected, not the communication link, so that the wireless device can still communicate with the electronic device through pairing, pressure sensing, buttons, etc. At the same time, the disconnection timestamp and the disconnection ambient temperature data are recorded for subsequent statistics and recovery judgment reference. When the disconnection charging link operation fails, it is retried, and after the consecutive failures reach a preset number, the charging link is maintained and an alarm message is output.
[0121] When an electronic device is connected to two or more wireless devices at the same time, the charging resources of the two or more wireless devices are arbitrated according to a preset arbitration strategy.
[0122] The preset arbitration strategy includes arbitration based on at least one of the following: wireless device priority, remaining battery power, charging rate, temperature, and user usage status. For example, low battery power is prioritized for charging, stylus is prioritized for charging over earphones, and wireless devices with excessively high temperatures are temporarily suspended from charging.
[0123] After arbitration, one of the following methods is used: time-sharing charging, parallel charging, or serial charging. Charging operations are performed on wireless devices that are not disconnected, and charging link disconnection operations are performed on wireless devices that meet the disconnection conditions.
[0124] S6. In the low-power recovery monitoring state, obtain the feedback data after disconnection; when the recovery conditions are met, or when the recovery probability and the feedback data after disconnection meet the recovery threshold, restore the charging link of the wireless device.
[0125] After disconnection, the wireless device enters a low-power recovery monitoring state. In this state, the charging management service periodically switches from the charging monitoring detection interval to the recovery monitoring detection interval, which is longer than the charging monitoring detection interval. Each time the recovery monitoring timer is triggered, it acquires the feedback data after disconnection and determines whether the recovery conditions are met, or whether the recovery probability and the feedback data after disconnection meet the recovery threshold. If the charging link is restored, the charging management context returns to the charging monitoring state; if not, the low-power recovery monitoring state is maintained and the next recovery monitoring is scheduled.
[0126] The feedback data after disconnection includes at least one of real-time position offset data and electromagnetic induction feedback data; the position offset data is used to characterize whether the position of the wireless device relative to the electronic device has changed, such as whether the stylus has been picked up, moved, or re-attached; the electromagnetic induction feedback data is used to characterize changes in electromagnetic induction near the wireless charging coil, such as whether a new metal object has approached or whether the wireless device has returned to its original position.
[0127] The recovery conditions include at least one of the following: the battery level is below the recovery threshold, the wireless device is in use, the wireless device is reconnected, and a user request.
[0128] The recovery threshold can be dynamically configured based on at least one of the following: battery protection mode, user settings, device temperature, and historical usage behavior. For example, the recovery threshold can be set to 80%, resuming charging when the wireless device's battery level is below 80%; or resuming charging after detecting that the wireless device has been picked up and used; or resuming charging when the user actively requests charging. The recovery conditions and the recovery threshold below are parallel considerations; meeting any one of them is sufficient for recovery.
[0129] In one embodiment, the recovery probability and the feedback data after disconnection satisfying the recovery threshold include:
[0130] Real-time position offset data and electromagnetic induction feedback data after disconnection are collected. The decision tree algorithm is used to perform logical operations on the real-time position offset data and electromagnetic induction feedback data to obtain dynamic wake-up evaluation value and second state confidence.
[0131] If the product of the dynamic wake-up evaluation value, the second state confidence level, and the recovery probability exceeds a preset recovery threshold, then the recovery threshold is determined to be met. The dynamic wake-up evaluation value is used to characterize whether it is suitable to wake up the charging link at present, and the second state confidence level is used to characterize the credibility of the decision tree output result.
[0132] The decision tree input consists of features constructed from position offset data and electromagnetic induction feedback data, and the output consists of dynamic wake-up evaluation value and second state confidence.
[0133] In the recovery determination process, let the recovery condition determination result be: ∈{0,1}, the recovery probability is The dynamic wake-up evaluation value is The confidence level of the second state is The recovery threshold is Then restore the judgment result. It can be represented as:
[0134] The three-component product is the fusion decision formula in step S6:
[0135] = · · ;
[0136] , , ∈[0,1], therefore ∈[0,1], and Having the same dimensions facilitates comparison; this product formula aligns with the safety of the default value in step S3 above: when When =0, =0< This will not trigger an accidental recovery.
[0137] When restoring the charging link of a wireless device, the communication link between the wireless device and the electronic device is restored first, and then the charging link is restored. When an electronic device is connected to two or more wireless devices at the same time, the charging link of each wireless device is restored according to a preset arbitration strategy to avoid charging resource conflicts caused by multiple wireless devices being restored at the same time.
[0138] In this embodiment, the charging management context maintains two main states: charging monitoring state and low power recovery monitoring state.
[0139] During the charging monitoring state, if the electronic device does not disconnect the charging link from the current wireless device, the charging management service obtains status information according to the charging monitoring detection interval through timed scheduling that can be performed in low power or sleep mode, and performs extended judgment and fusion judgment. If the fusion judgment does not meet the disconnection condition, the charging monitoring state is maintained and the next detection is scheduled. If the fusion judgment meets the disconnection condition, the disconnection execution is initiated, and then the low power recovery monitoring state is entered.
[0140] In the low-power recovery monitoring state, the charging management service will periodically switch from the charging monitoring detection interval to the recovery monitoring detection interval, which is longer than the charging monitoring detection interval. Each time the recovery monitoring is triggered, the feedback data after disconnection is obtained to determine whether the recovery conditions are met, or whether the recovery probability and the feedback data after disconnection meet the recovery threshold. If the charging link is restored, the system returns to the charging monitoring state; if not, the low-power recovery monitoring state is maintained and the next recovery monitoring is scheduled.
[0141] In the low-power recovery monitoring state, if the extended judgment trigger condition is met, the extended judgment can be executed again to update the recovery probability, and the updated recovery probability will be stored in the charging management context for use in the recovery judgment; if it is not triggered, the recovery judgment will use the recovery probability saved when disconnected, and if there is no valid saved value, the preset default value of 0 will be used.
[0142] Therefore, the timing scheduling in the charging monitoring state and the recovery monitoring scheduling in the low power recovery monitoring state are scheduling in different states, and there is no contradiction between them.
[0143] Example 2
[0144] like Figure 4 As shown, this embodiment provides an adaptive charging control system for wireless devices, used to execute an adaptive charging control method for wireless devices, deployed on the system service layer of a tablet computer; it includes an event acquisition module, a status acquisition module, a precision judgment module, a fusion decision module, a disconnection execution module, and a recovery module. Data is exchanged between the modules through a charging management context and a system service interface.
[0145] The event acquisition module listens for magnetic attraction events, wireless charging presence events, or input device connection events reported by the input subsystem and power management service. Upon receiving an access event, the event acquisition module reads the wireless device identifier and writes the device identifier, access time, initial charging status, current detection interval, and next detection time into the charging management context.
[0146] When the tablet is connected to both a stylus and a wireless keyboard, the event acquisition module establishes a context for each device based on its identifier and writes each context to the persistent partition of system properties. After the system restarts, the event acquisition module reads the context back from the partition and restores the charging management status of each device to avoid repeated disconnections or missed detections.
[0147] The status acquisition module reads the next detection time from the charging management context and registers a timed task through AlarmManager's setExactAndAllowWhileIdle, so that the detection can still be performed after the trigger time arrives even when the tablet is in Doze or sleep mode. When triggered, the status acquisition module reads the on-state, power value and charging status through the unified power attribute interface, and writes the reading results back to the context for use by the precision judgment module and the fusion decision module.
[0148] Retry when reading fails. After three consecutive failures, the next detection interval is set to the default value of 5 minutes. In multi-device scenarios, the status acquisition module takes the earliest time among the next detection times of each device as the unified timer trigger time. After triggering, the status of each device is read in sequence, and the next detection time is calculated separately to reduce the number of system wake-ups. The status acquisition module also determines the detection interval according to the difference between the battery level and the disconnection threshold, and extends it when the tablet is in sleep mode and shortens it when the temperature or charging rate is abnormal.
[0149] The precision decision module reads the state information from the context and determines whether the extended decision trigger condition is met. If the condition is met, the precision decision module collects extended state data and first calls the support vector machine to output the first state confidence score.
[0150] When the confidence level is below 0.8, the disconnection probability and recovery probability are set to 0 and written back to the context;
[0151] When the confidence level reaches 0.8, collect small current fluctuation data and real-time impedance data, call the random forest to output the disconnection probability and recovery probability, and write it back to the context;
[0152] When no extended decision is triggered, the fine decision module directly sets the disconnection probability and recovery probability to the default value of 0 and writes them back to the context. The probabilities output by the fine decision module are used by the fusion decision module and the recovery module.
[0153] The fusion decision module reads the status information and disconnection probability from the context, and determines whether the disconnection condition is met according to a probability-first, status-last-line logic. When the disconnection probability is greater than 0.8, the fusion decision module directly determines that the disconnection condition is met; when it is not greater than 0.8, it determines the condition based on the continuous satisfaction of the power value, charging current, and power change rate. Disconnection is determined only if the condition is met for three consecutive detection cycles; otherwise, the count is reset to zero. The fusion decision module sends the determination result to the disconnection execution module.
[0154] After receiving the determination result that the disconnection condition is met, the disconnection execution module writes the disconnection value to the wireless_exit node, causing the wireless charging chip to stop supplying power to the stylus while maintaining the communication link, recording the disconnection timestamp and ambient temperature, and saving the recovery probability obtained from the most recent extended determination to the context. If the write fails, it will retry twice.
[0155] If three consecutive failures occur, the charging link is maintained and an alarm is output to the upper layer. When there are multiple devices, the disconnection execution module arbitrates according to priority, remaining power, charging rate, temperature, and user status, and adopts time-sharing charging, parallel charging, or serial charging methods. It continues to charge devices that have not been disconnected, and disconnects devices that meet the disconnection conditions.
[0156] The recovery module operates in low-power recovery monitoring mode, reads the recovery probability from the context, and triggers a recovery detection every 30 minutes or when the stylus is used.
[0157] The recovery module first determines if any of the following recovery conditions are met: the battery level is below the recovery threshold, the stylus is being used, the stylus is being reconnected, or the user actively requests charging; if any of these conditions are met, the system will restore the battery directly.
[0158] If none of the conditions are met, the recovery module calls the decision tree to perform logical operations on the position offset data and electromagnetic induction feedback data to obtain the dynamic wake-up evaluation value and the second state confidence. The recovery probability, the dynamic wake-up evaluation value, and the second state confidence are multiplied together. When the product exceeds 0.6, the charging link is restored.
[0159] During recovery, the communication link is restored first, followed by the charging link; when multiple devices are involved, they are restored sequentially according to arbitration priority. After recovery, the recovery module switches the context state back to charging monitoring and sets the next detection time according to the normal detection interval.
[0160] Example 3
[0161] This embodiment provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the aforementioned adaptive charging control method for wireless devices.
[0162] The computer-readable storage medium includes, but is not limited to: read-only memory, random access memory, flash memory, hard disk, optical disk, USB flash drive, portable hard disk, etc.; the computer program can be read and executed by the processor of the electronic device.
[0163] The specific embodiments of the invention have been described in detail above, but these are merely examples. The invention is not limited to the specific embodiments described above. Those skilled in the art should understand that the embodiments and descriptions in the specification are only illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.
Claims
1. An adaptive charging control method for wireless devices, characterized in that, include: S1. In response to a wireless device access event, establish a charging management context for the accessed wireless device; S2. When the disconnection condition is not met, the status information of the wireless device is obtained according to the detection interval through a timed scheduling that can be executed in the low power state or sleep state of the electronic device. S3. In response to meeting the preset extension determination trigger condition, acquire the extension status data of the wireless device, and use a classification model to output the disconnection probability and recovery probability of the extension status data; If the extended determination trigger condition is not met, the disconnection probability and the recovery probability are set to preset default values; S4. Based on the status information and the disconnection probability, determine whether the disconnection condition is met; S5. When the disconnection condition is met, perform the disconnection operation of the charging link and put the wireless device into a low power recovery monitoring state. S6. In the low-power recovery monitoring state, acquire the feedback data after disconnection; The charging link of the wireless device is restored when the recovery conditions are met, or when the recovery probability and the feedback data after disconnection meet the recovery threshold.
2. The method according to claim 1, characterized in that, In step S1, when the electronic device connects to two or more wireless devices at the same time, a charging management context is maintained for each connected wireless device. The charging management context, charging status, and next detection time are persistently stored, and the charging management status is restored after the system wakes up from hibernation or restarts.
3. The method according to claim 1, characterized in that, In step S2, the status information includes at least one of the following: in-position status, power level, and charging status. The detection interval is determined based on the status information: a longer detection interval is used when the difference between the power value and the disconnection threshold is large, and a shorter detection interval is used when the difference is small. Extend the detection interval when the electronic device is in sleep or low power mode; In the low-power recovery monitoring state, a longer detection interval than in the low-power monitoring state is used, or the detection is triggered by an event by a wireless device. The timed scheduling refers to a system timed task that can be executed while the electronic device is in sleep mode; The wireless device access event includes a magnetic connection event or a wireless charging in-place event; The wireless device includes a stylus or wearable device; The detection tasks for two or more wireless devices targeting the same electronic device are merged into a single timed task to reduce the number of system wake-ups. The system counts at least one of the following: charging time, number of disconnections, and number of recoveries of the wireless device, and adjusts the detection interval based on the statistical results.
4. The method according to claim 1, characterized in that, In step S2, the status information is obtained through a unified power attribute interface; The wireless device access event is obtained from system input events or reported by the power management service; If reading the unified power attribute interface fails, a retry will be performed, and after a timeout, the process will fall back to the default detection interval.
5. The method according to claim 1, characterized in that, In S3, the preset extended determination triggering conditions include abnormal power changes or minor current fluctuations. Under continuous power supply, the in-situ status data and power change data of wireless devices are acquired, and support vector machine is used for feature extraction to obtain multi-dimensional state features and first state confidence. If the multidimensional state features and the first state confidence level meet the preset sleep trigger threshold, then the minute current fluctuation data and real-time impedance change data in the sleep state are obtained. Random forest is used to classify the small current fluctuation data and the real-time impedance change data to obtain the link disconnection probability and the link recovery probability.
6. The method according to claim 1, characterized in that, In step S4, when the disconnection probability is greater than the preset disconnection threshold, it is determined that the disconnection condition is met. When the disconnection probability is not greater than the preset disconnection threshold, the status information is used to determine whether the disconnection condition is met.
7. The method according to claim 1, characterized in that, In S5, the disconnection condition includes at least one of the following: the power level reaches a preset threshold, the charging current is lower than a preset current threshold, and the power change rate is lower than a preset change rate. Meeting the disconnection condition includes meeting the disconnection condition within a consecutive preset number of detection cycles. If the condition is not met, the system returns to the monitoring state and uses a hysteresis threshold lower than the preset threshold as the entry condition for the next disconnection confirmation. When performing the disconnect charging link operation, the communication link between the wireless device and the electronic device is maintained, and the disconnection timestamp and disconnection ambient temperature data are recorded; If the operation to disconnect the charging link fails, it will be retried, and the charging link will be maintained and an alarm message will be output after a preset number of consecutive failures. The preset threshold can be dynamically configured based on at least one of the following: battery protection mode, user settings, device temperature, and historical usage behavior. When the electronic device is connected to two or more wireless devices at the same time, the charging resources of the two or more wireless devices are arbitrated according to a preset arbitration strategy. One of the following methods is adopted: time-sharing charging, parallel charging, or serial charging. Charging operation is performed on the wireless devices that are not disconnected, and the charging link is disconnected on the wireless devices that meet the disconnection conditions.
8. The method according to claim 1, characterized in that, In S6, the recovery conditions include at least one of the following: the battery level is below the recovery threshold, the wireless device is in use, the wireless device is reconnected, and a user request. When restoring the charging link of the wireless device, the communication link between the wireless device and the electronic device is restored first, and then the charging link is restored. When the electronic device is connected to two or more wireless devices at the same time, the charging link of each wireless device is restored according to a preset arbitration strategy. The recovery threshold can be dynamically configured based on at least one of the following: battery protection mode, user settings, device temperature, and historical usage behavior. The recovery probability and the feedback data after disconnection satisfying the recovery threshold include: collecting real-time position offset data and electromagnetic induction feedback data after disconnection, and using a decision tree algorithm to perform logical operations on the real-time position offset data and the electromagnetic induction feedback data to obtain a dynamic wake-up evaluation value and a second state confidence level. If the product of the dynamic wake-up evaluation value, the second state confidence level, and the recovery probability exceeds a preset recovery threshold, then the recovery threshold is determined to be met.
9. An adaptive charging control system for wireless devices, characterized in that, include: The event acquisition module is used to respond to wireless device access events and establish a charging management context for the accessed wireless devices. The status acquisition module is used to acquire the status information of the wireless device according to the detection interval by means of a timed schedule that can be executed in the low power state or sleep state of the electronic device when the disconnection condition is not met. The precision determination module is used to obtain the extended status data of the wireless device in response to the satisfaction of the preset extended determination trigger condition, and to output the disconnection probability and recovery probability of the extended status data using a classification model; If the extended determination trigger condition is not met, the disconnection probability and the recovery probability are set to preset default values; The fusion decision module is used to determine whether the disconnection condition is met based on the status information and the disconnection probability. The disconnection execution module is used to perform a disconnection operation on the charging link when the disconnection condition is met, and to put the wireless device into a low-power recovery monitoring state. The recovery module is used to acquire feedback data after disconnection in the low power recovery monitoring state, and restore the charging link of the wireless device when the recovery conditions are met, or when the recovery probability and the feedback data after disconnection meet the recovery threshold. The system is configured to perform the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 8.
