A concentration behavior management method and system based on energy integration and dynamic anti-shake
By using energy integration and dynamic anti-shake methods, the problem of erroneous triggering due to environmental vibration in human-computer interaction of attention management applications was solved, achieving a stable interactive closed loop with low misjudgment rate and low energy consumption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING UNIV OF INFORMATION SCI & TECH
- Filing Date
- 2026-05-07
- Publication Date
- 2026-07-24
AI Technical Summary
Existing attention management applications are susceptible to environmental vibrations during human-computer interaction, leading to false triggering. Furthermore, these devices consume a lot of power and have insufficient anti-interference capabilities and fault tolerance.
By employing energy integration and dynamic stabilization methods, and through sensor data sliding window and acceleration component analysis, active pickup and environmental vibration are distinguished. Combined with underlying resource scheduling to optimize device energy consumption, a stable and immersive physical motion interaction closed loop is constructed.
Significantly reduce the false interruption rate, optimize terminal power consumption, improve anti-interference capability and fault tolerance, and build a stable and immersive interactive closed loop.
Smart Images

Figure CN122152481B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of human-computer interaction and application status management technology for mobile terminals, and in particular to a method and system for managing focused behavior based on energy points and dynamic image stabilization. Background Technology
[0002] Existing attention management applications generally suffer from certain technical limitations in human-computer interaction and attention maintenance. Traditional pure software UI interaction solutions mainly rely on users clicking buttons on the screen to control the timer, which lacks the psychological constraint of physical action. More importantly, when users are operating the screen, they are easily distracted by other visual elements within the device (such as social media push notifications), disrupting their original state of focus.
[0003] To avoid visual interference, some applications have introduced a gravity-sensing physical trigger mechanism based on flipping the phone screen downwards. However, in actual operation, this mechanism faces two prominent underlying technical flaws: First, the sensor's anti-interference capability is extremely weak. Real physical environments often contain various minute vibrations, causing hardware sensors to generate a large amount of high-frequency fluctuations (white noise). Existing technologies typically rely directly on instantaneous gravity or gyroscope data for state determination, and the lack of fault tolerance mechanisms makes them extremely sensitive to environmental noise, easily triggering false interruptions of the focus timer. Second, there is an inherent contradiction between process persistence and device power consumption. In Linux kernel-based operating systems (such as Android), if an application allows the device to turn off the screen, the underlying memory management mechanism (such as the OOM Killer) can easily reclaim or put the background listening process to sleep. Forcing the screen to remain on to maintain process activity will cause a surge in overall power consumption, severely impacting the device's battery life.
[0004] Therefore, when using gravity sensors to control focus, it is very easy to be falsely triggered by environmental vibrations. The anti-interference ability and fault tolerance of existing focus management applications still need to be further improved. Summary of the Invention
[0005] To address the issue that gravity-sensor-controlled focused states are easily triggered by environmental vibrations, this invention proposes a focused behavior control method and system based on energy integration and dynamic anti-shake. Through a dynamic anti-shake judgment model and system resource scheduling, it distinguishes between active pickup and environmental vibration, reduces the false interruption rate, optimizes device energy consumption, and constructs a stable and immersive physical action interaction closed loop.
[0006] This invention adopts the following technical solution: a method for managing focused behavior based on energy integration and dynamic image stabilization, comprising the following steps:
[0007] Step S1, Sensing and Window Maintenance: Acquire the attitude sensing data of the mobile terminal in real time, maintain a sliding window data queue containing samples of multiple consecutive frames in memory, and extract the acceleration component in the first direction perpendicular to the screen plane.
[0008] Step S2, Baseline Calibration and Startup: When the first directional acceleration component in the sliding window data queue meets the first preset attitude condition, the focus control state is started; and in the initial stage of the focus control state, the noise floor calibration is performed. By extracting the sensor data within the preset time window, the environmental noise floor baseline is calculated, and the anti-shake interruption threshold is dynamically generated.
[0009] Step S3, Energy Integral Anti-shake: During the maintenance of the focused control state, the weighted energy integral of the current sensor data deviating from the reference attitude is calculated in real time;
[0010] Step S4, State Determination and Fault Tolerance: If the weighted energy integral calculated in real time is lower than the anti-shake interruption threshold, the system determines it as environmental noise, continues to maintain the focused control state, and updates the environmental noise baseline through a sliding window;
[0011] If the weighted energy integral reaches or exceeds the anti-shake interruption threshold, it is determined that the physical posture has undergone a substantial change, triggering an effective interruption of the focus control state.
[0012] As a preferred embodiment, the first directional acceleration component is the Z-axis acceleration component;
[0013] The first preset attitude condition is: the Z-axis acceleration components of multiple consecutive frames within the sliding window are all within the set negative gravitational acceleration reference value range, indicating that the mobile terminal is in a static state with the screen placed on its side.
[0014] As a preferred embodiment, step S2, which involves extracting sensor data within a preset time window to calculate the environmental noise baseline, specifically includes:
[0015] Extract the first directional acceleration component set for the T sampling periods before entering the focus control state, and calculate the variance of the set; use the variance as the environmental noise baseline characterizing the micro-vibration intensity of the current physical environment.
[0016] As a preferred embodiment, in step S3, a time decay model is used to calculate the weighted energy integral of the current sensing data deviating from the reference attitude:
[0017] ;
[0018] in, The weighted energy integral at the current sampling time. This is the weighted energy integral from the previous sampling time. The set time decay factor, The first direction acceleration component extracted at the current moment. This is the set baseline attitude reference value.
[0019] Furthermore, in step S2, after initiating the focus management state, the underlying process keep-alive and energy consumption control steps are also included, as follows:
[0020] Call the underlying interface of the mobile terminal operating system to request wake lock or screen always-on permission, so that the current application process maintains the foreground active priority in the process scheduling of the operating system and avoids being put to sleep or forcibly reclaimed by the underlying memory management mechanism.
[0021] Simultaneously take over the screen display hardware interface, force the screen display brightness parameters to be lowered to the preset minimum threshold or render a pure black mask layer to enter a low-power pseudo-always-on state.
[0022] As a preferred embodiment, step S4, after triggering an effective interruption of the focus control state, further includes:
[0023] Release wake lock or screen always-on permission, restore the operating system's default process scheduling policy and the mobile terminal's original screen brightness;
[0024] The system invokes the physical vibration motor module of the mobile terminal to output physical vibration feedback at a preset frequency and generates a focused data analysis report.
[0025] The present invention also provides: a focus behavior control system based on energy integration and dynamic stabilization, for implementing the aforementioned method, comprising:
[0026] The sensing sampling and window maintenance module is used to acquire attitude sensing data, maintain the sliding window data queue, and extract the first direction acceleration component.
[0027] The state activation module is used to activate the focus control state when the acceleration component in the first direction meets the first preset attitude condition.
[0028] The dynamic baseline and threshold calculation module is used to calculate the environmental noise baseline and generate the anti-shake interruption threshold.
[0029] The energy integral anti-shake module is used to calculate the weighted energy integral of the current sensor data deviating from the baseline attitude in real time during focused control.
[0030] The interruption determination module is used to compare the weighted energy integral with the anti-shake interruption threshold, and to determine that the focus state is interrupted when the integral exceeds the limit.
[0031] Furthermore, the system of the present invention also includes a low-level resource management module, which is used to call the low-level interface to apply for a wake-up lock or screen always-on permission after starting the focus management state in order to keep the process alive, while lowering the screen brightness to the lowest threshold to enter a low-power pseudo-screen-off state.
[0032] Furthermore, the system of the present invention also includes an interruption settlement module, which is used to release process keep-alive permissions, restore screen brightness, output physical vibration feedback and generate a focus data analysis report after the focus state is effectively interrupted.
[0033] The present invention also provides: a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the aforementioned method for controlling focused behavior.
[0034] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:
[0035] 1. This invention focuses on behavior control methods. By constructing a dynamic anti-shake judgment model and combining it with the underlying system resource scheduling, it can accurately distinguish between the user's "active picking behavior" and "minor environmental vibrations". It can significantly reduce the false interruption rate and optimize the high power consumption of the terminal while constructing a stable and immersive physical action interaction closed loop.
[0036] 2. After determining that the system has entered a focused posture, the system of the present invention actively takes over the underlying brightness control and executes process keep-alive. While visually simulating the "screen off" effect to isolate interference, it avoids the risk of background processes being forcibly killed by the system, effectively reducing the power consumption of the whole machine.
[0037] 3. The method of this invention significantly improves the system's anti-interference capability and fault tolerance. By introducing an abnormal state calculation mechanism, it effectively filters high-frequency white noise such as desktop vibration. Simulation test data shows that, compared with the traditional instantaneous determination scheme, the misjudgment interruption rate of this scheme in complex physical environments can be significantly reduced from over 15% to below 1%. Attached Figure Description
[0038] Figure 1 This is a flowchart of the behavior control method of the present invention;
[0039] Figure 2 This is a state machine transition diagram for the dynamic debounce logic of this invention. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the application will be further described in detail below with reference to the accompanying drawings. The described embodiments are only a part of the embodiments involved in this invention. All non-innovative embodiments based on these embodiments by other researchers in the art are within the protection scope of this invention. Furthermore, the step numbers in the embodiments of this invention are only set for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0041] Example 1:
[0042] A method for managing focused behavior based on posture awareness and dynamic stabilization is proposed, the process of which is as follows: Figure 1 As shown, the implementation steps are as follows:
[0043] Step S1, Sensing and Window Maintenance: Acquire the attitude sensing data of the mobile terminal in real time, maintain a sliding window data queue containing samples from multiple consecutive frames in memory, and extract the acceleration component in the first direction perpendicular to the screen plane.
[0044] Step S2, Baseline Calibration and Startup: When the above acceleration components meet the preset snap-in conditions, the system enters the noise floor calibration stage. The ambient noise floor baseline is calculated by extracting sensor data within a preset time window, and the anti-shake interruption threshold is dynamically generated accordingly.
[0045] Step S3, Energy Integral Anti-shake: During the period of focused control, the weighted energy integral of the current sensor data deviating from the baseline attitude is calculated in real time.
[0046] Step S4, State Determination and Fault Tolerance:
[0047] If the weighted energy integral calculated in real time is lower than the anti-shake interruption threshold, the system determines it as environmental noise, continues to maintain the focused control state, and updates the noise baseline through a sliding window;
[0048] If the weighted energy integral reaches or exceeds the threshold, it is determined that the physical posture has undergone a substantial change, triggering an effective interruption of the focus control state, releasing the process keep-alive permission, restoring screen brightness and providing vibration feedback.
[0049] In this embodiment, the state machine transition determination process of the dynamic anti-shake logic is as follows: Figure 2 As shown, the details are as follows:
[0050] State 0, Idle: The initial state of the system. When the tilt angle of the terminal screen exceeds the preset range and continuous sampling meets the reference snapping posture, the state machine transitions to state 1.
[0051] State 1, Focused Control State, or simply Focused State: The system calls the underlying interface to maintain process activity and lowers the screen brightness, while calculating the current ambient noise baseline to generate a dynamic anti-shake threshold.
[0052] State 2, Energy Integral Anti-jitter State (Tolerance): The system periodically calculates the weighted energy integral that deviates from the reference attitude. If the integral does not reach the dynamic threshold, it is determined to be environmental white noise, and the state machine maintains state 1 and updates the noise floor (transition branch A); if the deviation energy continues to accumulate and causes the integral to exceed the limit, it is determined to be a valid physical interruption action, and the state machine transitions to state 3 (transition branch B).
[0053] State 3, Interrupted settlement state: The system releases the process's keep-alive permission, restores the screen to normal brightness, triggers physical vibration feedback, then flows back to state 0, and settles and outputs a focused data analysis report.
[0054] Example 2
[0055] A focus behavior control system based on energy integration and dynamic stabilization is proposed, including:
[0056] The sensing sampling and window maintenance module is used to acquire attitude sensing data, maintain the sliding window data queue, and extract the first direction acceleration component.
[0057] The state activation module is used to activate the focus control state when the acceleration component in the first direction meets the first preset attitude condition.
[0058] The dynamic baseline and threshold calculation module is used to calculate the environmental noise baseline and generate the anti-shake interruption threshold.
[0059] The energy integral anti-shake module is used to calculate the weighted energy integral of the current sensor data deviating from the baseline attitude in real time during focused control.
[0060] The interruption determination module is used to compare the weighted energy integral with the anti-shake interruption threshold, and to determine that the focus state is interrupted when the integral exceeds the limit.
[0061] In practical applications, the method of this embodiment is implemented by relying on mobile development frameworks (such as WeChat Mini Program API) to call relevant sensor interfaces (such as wx.onAccelerometerChange).
[0062] First, initiate the logic judgment: obtain the acceleration component perpendicular to the screen plane. .
[0063] The system continuously monitors the orientation of the device's center of gravity in three-dimensional space. When the angle between the screen and the horizontal plane exceeds a preset range, and It manifests as a clearly negative value (e.g.) (Indicates the screen is facing down), the system determines the posture meets the requirements and enters the focus control mode.
[0064] Then, dynamic image stabilization and weighted energy integration are performed.
[0065] To address micro-vibration interference in complex physical environments, this embodiment designs a jitter stabilization mechanism that integrates sliding window and weighted energy integration, specifically including:
[0066] (1) At the initial stage of startup, environmental noise level calibration is performed.
[0067] Before system extraction Calculate the variance of the Z-axis acceleration components for each sampling period. This variance represents the baseline of micro-vibration intensity in the current environment. Based on this baseline and a base threshold, the system dynamically generates a de-jitter interruption threshold.
[0068] (2) During the focus maintenance period, the energy integral of the sensor data deviating from the reference attitude is calculated in real time using a time decay model. The calculation formula is as follows:
[0069] ;
[0070] in, The energy integral at the current moment. The time decay factor, For the current acceleration, This serves as the baseline attitude reference value. The algorithm model effectively amplifies low-frequency "active pick-up" actions and filters high-frequency vibration clutter. Only when the energy integral... The system only throws a focus interrupt event when the dynamically generated debouncing interrupt threshold is exceeded.
[0071] Next, underlying resource linkage control and process scheduling are performed. In order to balance process continuity and low power consumption in long-term focused scenarios, the system performs underlying resource linkage after entering the focused state.
[0072] On the one hand, process keep-alive is implemented. The system calls specific interfaces of the mobile terminal operating system (such as the native Wakelock mechanism) to request screen-always-on permission from the kernel, so that the application process maintains the highest foreground priority in the process scheduling tree, avoiding the forceful killing and cleanup by system hibernation and underlying memory management mechanisms, and ensuring the absolute continuity of sensor sampling.
[0073] On the other hand, it achieves extremely low-power "pseudo-always-on" rendering. While obtaining the permission to keep the screen always on, the system takes over the control of screen brightness, lowering the backlight parameters to the lowest hardware threshold. This state isolates visual interference while minimizing the power consumption of the screen components. Combined with the aforementioned anti-shake logic, it effectively optimizes the device's battery life.
[0074] Furthermore, the focus behavior control method and system described in this invention can be perfectly applied to time management applications such as the "Pomodoro Technique" to build an immersive focus management closed loop.
[0075] The specific implementation steps are as follows:
[0076] Step 1, Service Launch: The user sets a focus goal on the device (e.g., 25 minutes). The user places the device screen face down, and after the system determines the posture, it enters the noise floor calibration stage. After collecting environmental variance data for about 5 seconds, the Pomodoro timer countdown officially begins.
[0077] Step 2, Focus on Maintaining Focus: During the countdown, the system performs a low-power "pseudo-screen-off" and process-keeping operation. If the environment experiences everyday vibrations (such as tapping on the desktop or typing on the keyboard), the weighted energy score is precisely intercepted by the anti-shake threshold, and the APP interface maintains the countdown without issuing any interruption warnings, fully protecting the user's "flow" state.
[0078] Step 3, Transaction Settlement:
[0079] Effective interruption: If the user actively picks up the terminal midway, the weighted energy score instantly exceeds the threshold. The APP immediately ends the current Pomodoro session, releases the underlying keep-alive restrictions, calls the physical motor to perform long vibration feedback (such as 500ms), and pops up a "Focus Failure" notification on the interface.
[0080] Normal completion: If the terminal does not trigger any substantial interruption within the set Pomodoro time, after the countdown ends, the system will automatically turn on the screen, play a prompt sound, and generate a personalized visualization report that includes ambient noise data and focus duration.
[0081] As can be seen, the focused behavior control method and system of this invention significantly improve the system's anti-interference capability and fault tolerance. By introducing an abnormal state calculation mechanism, the system effectively filters high-frequency white noise such as desktop vibration. Simulation test data shows that, compared with the traditional instantaneous judgment scheme, the misjudgment interruption rate of the present invention in complex physical environments can be significantly reduced from more than 15% to less than 1%.
[0082] Furthermore, this invention balances an immersive experience with energy efficiency optimization. Once the system determines that a focused state has been entered, it proactively takes over the underlying brightness control and executes process keep-alive. This visually simulates a "screen-off" effect to isolate distractions while avoiding the risk of background processes being forcibly terminated by the system, effectively reducing overall power consumption.
[0083] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for managing focused behavior based on energy integration and dynamic image stabilization, characterized in that, Includes the following steps: Step S1: Acquire the attitude sensing data of the mobile terminal in real time, maintain a sliding window data queue containing continuous multi-frame sampling in memory, and extract the first direction acceleration component perpendicular to the screen plane. Step S2: When the first directional acceleration component in the sliding window data queue satisfies the first preset attitude condition, the focus control state is activated; In the initial stage of focused control, noise floor calibration is performed. By extracting sensor data within a preset time window, the environmental noise floor baseline is calculated, and the anti-shake interruption threshold is dynamically generated. Step S3: During the maintenance of the focused control state, calculate the weighted energy integral of the current sensor data deviating from the reference attitude in real time; Step S4: If the weighted energy integral calculated in real time is lower than the anti-shake interruption threshold, the system determines it as environmental noise, continues to maintain the focus control state, and updates the environmental noise baseline through a sliding window. If the weighted energy integral reaches or exceeds the anti-shake interruption threshold, it is determined that the physical posture has undergone a substantial change, triggering an effective interruption of the focus control state. In step S2, the environmental noise baseline is calculated by extracting sensor data within a preset time window, specifically including: Extract the set of first-direction acceleration components for T sampling periods before entering the focus control state, and calculate the variance of the set; use the variance as the environmental noise baseline characterizing the micro-vibration intensity of the current physical environment; In step S3, a time decay model is used to calculate the weighted energy integral of the current sensing data deviating from the reference attitude: ; in, The weighted energy integral at the current sampling time. This is the weighted energy integral from the previous sampling time. The set time decay factor, The first direction acceleration component extracted at the current moment. The set baseline attitude reference value; Step S4, after triggering a valid interruption of the focus control state, also includes: Release wake lock or screen always-on permission, restore the operating system's default process scheduling policy and the mobile terminal's original screen brightness; The system invokes the physical vibration motor module of the mobile terminal to output physical vibration feedback at a preset frequency and generates a focused data analysis report.
2. The focus behavior control method according to claim 1, characterized in that, The first directional acceleration component is the Z-axis acceleration component; The first preset attitude condition is: the Z-axis acceleration components of multiple consecutive frames within the sliding window are all within the set negative gravitational acceleration reference value range, indicating that the mobile terminal is in a static state with the screen placed on its side.
3. The method for controlling focused behavior according to claim 1, characterized in that, In step S2, after initiating the focus management state, the underlying process keep-alive and energy consumption control steps are also included, as follows: Call the underlying interface of the mobile terminal operating system to request wake lock or screen always-on permission, so that the current application process maintains the foreground active priority in the process scheduling of the operating system and avoids being put to sleep or forcibly reclaimed by the underlying memory management mechanism. Simultaneously take over the screen display hardware interface, force the screen display brightness parameters to be lowered to the preset minimum threshold or render a pure black mask layer to enter a low-power pseudo-always-on state.
4. A focus behavior control system based on energy integration and dynamic stabilization, used to implement the method according to any one of claims 1 to 3, characterized in that, include: The sensing sampling and window maintenance module is used to acquire attitude sensing data, maintain the sliding window data queue, and extract the first direction acceleration component. The state activation module is used to activate the focus control state when the acceleration component in the first direction meets the first preset attitude condition. The dynamic baseline and threshold calculation module is used to calculate the environmental noise baseline and generate the anti-shake interruption threshold. The energy integral anti-shake module is used to calculate the weighted energy integral of the current sensor data deviating from the baseline attitude in real time during focused control. The interruption determination module is used to compare the weighted energy integral with the anti-shake interruption threshold, and to determine that the focus state is interrupted when the integral exceeds the limit.
5. The focus behavior control system according to claim 4, characterized in that, It also includes an underlying resource management module, which, after starting the focused management state, calls the underlying interface to request a wake-up lock or screen-on permission to keep the process alive, while lowering the screen brightness to the minimum threshold to enter a low-power pseudo-always-on state.
6. The focus behavior control system according to claim 4, characterized in that, It also includes an interruption settlement module, which is used to release process keep-alive permissions, restore screen brightness, output physical vibration feedback and generate focus data analysis reports after a focus state is effectively interrupted.
7. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the focus behavior control method according to any one of claims 1 to 3.