A device for analyzing sleep and intelligently waking up by brain waves
By using a single-channel EEG frequency acquisition device and an intelligent wake-up decision module, the problem that existing sleep monitoring devices cannot accurately distinguish between deep sleep and REM sleep is solved, enabling intelligent wake-up and improved sleep quality in a home environment.
Patent Information
- Application Number
- CN202611572217.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-12
- Publication Date
- 2026-11-24
AI Technical Summary
Existing consumer-grade sleep monitoring devices cannot accurately distinguish between the static deep sleep stage and the REM sleep stage, and the timing of awakening is unreasonable, leading to a decline in sleep quality.
Using a single-channel EEG frequency acquisition device, combined with a signal processing module, a sleep staging algorithm module, and an intelligent wake-up decision module, the system analyzes EEG frequencies to intelligently select the optimal wake-up time and employs a gradual wake-up strategy.
It enables accurate monitoring and intelligent wake-up of sleep status in a home environment, improving sleep quality and avoiding unnecessary awakenings and startles.
Smart Images

Figure CN123148503A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sleep monitoring and wake-up technology, specifically to an intelligent sleep monitoring and wake-up device based on real-time analysis of electroencephalogram (EEG) signals. Background Technology
[0002] With societal development, people are placing increasingly higher demands on sleep quality. However, sleep problems have actually become one of the major hidden dangers affecting public health. Long-term insomnia or poor sleep quality can trigger a series of physical discomforts and may lead to obesity, diabetes, high blood pressure, and even myocardial infarction. Sleep duration and wake-up time are crucial factors affecting sleep quality. Many people struggle to manage their sleep duration, believing that longer sleep is better. However, sleep quality actually depends on the cyclical changes in the body's normal sleep patterns. Currently, almost 90% of people need to set an alarm to wake up in the morning, but traditional alarm clocks are based solely on individual schedules and do not consider the variations in sleep cycles. Different sleep cycles involve different endocrine and metabolic changes, and an inappropriate wake-up time can directly impact sleep quality, leading to problems such as fatigue and difficulty concentrating upon waking. Existing sleep monitoring technologies mainly include the following: 1. Accelerometer monitoring (such as smart bracelets and smartwatches): These devices infer sleep depth by detecting the frequency of body activity. Their main drawbacks are: they can only detect body activity and cannot directly measure brain state; they cannot accurately distinguish between the static deep sleep stage and the rapid eye movement (REM) stage; they are easily affected by environmental disturbances (such as a bed partner turning over); and the accuracy rate of sleep staging is only 60-70%. 2. Photoplethysmography (PPG) monitoring: This method indirectly infers sleep state through heart rate variability (HRV) and blood oxygen saturation. Its limitations include: it is an indirect indicator with low accuracy; heart rate is affected by various factors (body temperature, diet, emotions, etc.); and it cannot identify characteristic EEG waveforms such as sleep spindles and K-complexes. 3. Medical-grade polysomnography (PSG): This is the gold standard for sleep monitoring, using multi-channel electroencephalography (EEG), electrooculography (EOG), and electromyography (EMG). However, it has significant drawbacks: it needs to be performed in a hospital or sleep center; it requires attaching a large number of electrodes (10-20 leads), making the operation complex; it is expensive (several thousand yuan per test); and it is not suitable for daily home use. 4. Existing home-use frontal EEG sleep monitoring devices: Home-use sleep monitoring devices that use frontal EEG data collection have also appeared in the existing technology. These devices collect single-channel or multi-channel EEG signals on the forehead through a headband, automatically determine the sleep stage, and have the function of issuing a prompt sound when a light sleep stage is detected for a period of time before the wake-up time set by the user. While such devices, compared to accelerometer-based solutions, represent direct measurement in principle, their method of determining wake-up timing still has significant shortcomings: The wake-up criterion relies on a single stage threshold, issuing a prompt immediately upon detecting the user entering a light sleep stage—a passive "on-demand" response rather than comparing the suitability of wake-up at different times within the entire wake-up monitoring window and selecting the optimal one. Consequently, they cannot distinguish between moments within the same light sleep stage but with varying degrees of wake-up difficulty, such as the transition from deep sleep to light sleep versus the transition from light sleep after REM sleep. Although both are classified as light sleep, the latter offers significantly better wake-up comfort, yet existing devices do not differentiate between them. Furthermore, they fail to consider the distance from the target wake-up time, potentially triggering wake-up very early in the window, unnecessarily shortening the user's actual sleep time. The intensity of the wake-up prompt is typically a fixed value or increases sequentially, without using the user's real-time EEG status as a feedback loop. This can result in missed wake-ups due to insufficient intensity or startled awakenings due to excessive intensity. Therefore, there is an urgent need for a device that can accurately monitor sleep status in a home environment and quantitatively compare the appropriateness of wake-up at different times within a wake-up monitoring window, thereby intelligently selecting the best wake-up time. Summary of the Invention
[0003] (a) Technical problems to be solved The technical problem this invention aims to solve is that existing consumer-grade sleep monitoring devices rely on accelerometers or photoplethysmography (PPG) waves to indirectly infer sleep states, which cannot distinguish between the static deep sleep stage and the REM sleep stage, resulting in low accuracy in sleep staging; while medical-grade polysomnography is accurate, it has a large number of leads, is complex to operate, and is expensive, making it unsuitable for home use; and existing alarm clocks wake up at fixed times without considering the sleep stage at the time of wake-up, which can easily lead to forced awakening during deep sleep and create sleep inertia. (II) Technical Solution To solve the above-mentioned technical problems, the present invention adopts the following technical solution: a device for analyzing sleep by brain waves and intelligently waking up, comprising a brain wave frequency acquisition device 1, a signal processing module 2, a sleep staging algorithm module 3, an intelligent wake-up decision module 4, a data recording unit (such as a data storage device 5), a wake-up output unit 6 (such as a built-in linear vibration motor 61), a Bluetooth module 7, and a mobile APP 8. The EEG frequency acquisition device 1 includes a frontal dry electrode group 11, an input protection circuit 12, an instrumentation amplifier 13, a high-pass filter 14, a secondary amplifier 15, a low-pass filter 16, a notch filter 17, and an analog-to-digital converter 18, which are electrically connected in sequence to form a single-channel EEG signal acquisition link. Figure 6 As shown, the forehead dry electrode assembly 11 is positioned on the user's forehead (e.g., the Fpz position in the international 10-20 system), and is made of silver chloride-plated conductive rubber, conductive silicone, conductive fabric, or metal, adhering to the surface of the forehead skin. Thanks to the high input impedance characteristics of the analog front end (the input impedance of the instrumentation amplifier 13 reaches the GΩ level), the forehead dry electrode assembly 11 can operate stably within a contact impedance range of less than 200kΩ (preferably less than 100kΩ or less than 50kΩ), exhibiting a very wide adaptive tolerance to forehead skin with varying degrees of dryness. The forehead dry electrode assembly 11 outputs a differential measurement terminal and a reference terminal, both integrated on the forehead to form a self-contained integrated electrode structure that eliminates the need for external ear wiring. The input protection circuit 12 includes a 100Ω current-limiting resistor, a Schottky diode, and a 10nF filter capacitor. The instrumentation amplifier 13 uses an INA333, with a gain resistor of 1kΩ and a gain of 101. The high-pass filter 14 is a 0.5Hz second-order Sallen-Key structure used to remove DC offset and baseline drift caused by electrode polarization; the second-stage amplifier 15 is a non-inverting amplifier with a gain of 10; the low-pass filter 16 is a 35Hz fourth-order Butterworth structure used to filter out EMG artifacts; the notch filter 17 is a 50Hz double-T structure, which suppresses power frequency interference by more than 40dB. The total gain of the acquisition link is 10¹⁰ times, amplifying the 50μV-level EEG signal to approximately 50mV. The analog-to-digital converter 18 has a resolution of 16 bits and a sampling rate of 256Hz. The signal processing module 2 includes a microcontroller 21, which performs segmented feature extraction on the digitized EEG signal with a time window of 30 seconds (epoch, 7680 sampling points at a sampling rate of 256Hz). The power spectral density is calculated using the Hanning window, 2048-point FFT, and Welch method with 50% overlap. The power of the four frequency bands (Delta wave (0.5-4Hz), Theta wave (4-8Hz), Alpha wave (8-13Hz), and Beta wave (13-30Hz)) and their relative proportions to the total power are obtained by integration. Power; simultaneously, the signal is bandpass filtered at 11-16Hz and the envelope is obtained through Hilbert transform. When the envelope amplitude is greater than the mean plus 1.5 times the standard deviation and lasts for 0.5 to 3 seconds, it is determined to be a sleep spindle wave; when a biphasic wave with an amplitude greater than 75μV is detected, it is determined to be a K-composite wave; and the signal quality index is calculated in each time window. When the signal-to-noise ratio (SNR) is less than 10dB, or the proportion of saturated sampling points with amplitudes exceeding 90% of the full scale of the analog-to-digital converter exceeds the preset proportion, or the electrode contact impedance exceeds the preset impedance upper limit, it is determined to be a spurious segment and marked as an invalid window. like Figure 3 As shown, the sleep staging algorithm module 3 determines the sleep state of each time window layer by layer according to the above features using a hierarchical decision tree: First, artifact detection is performed. If the time window is determined to be an artifact segment, it is marked as an invalid window, and the staging result inherits the state of the previous valid time window and does not participate in the awakening suitability judgment; if it is not an artifact segment, it first determines whether the relative power of the Delta wave is not less than 20%. If so, it is directly determined to be deep sleep (N3); if the relative power of the Delta wave is less than 20%, it further determines whether sleep spindle waves (11-16Hz) or K-complex waves (amplitude greater than 75μV) are detected. If the condition is met, it is classified as light sleep (N2). If no spindle waves or K-complex waves are detected, it is determined whether the relative power of Alpha waves is greater than 30% or the relative power of Beta waves is greater than 20% (and no spindle waves are detected). If so, it is classified as wakefulness. If the wakefulness condition is not met, it is determined whether the relative power of Theta waves is dominant and the relative power of Delta waves is less than 10%. If so, it is classified as rapid eye movement (REM) sleep. If none of the above conditions are met, it is classified as sleep onset (N1, characterized by a transitional feature of increasing relative power of Theta waves and decreasing relative power of Alpha waves). The determination results are then subjected to temporal smoothing: smoothing is performed by majority vote over three consecutive time windows (sliding windows), and the state transition path is constrained according to physiological sleep patterns, prohibiting direct jumps between wakefulness and deep sleep. Finally, the sleep state determination result for the current time window is output. like Figure 4As shown, the intelligent wake-up decision module 4 executes intelligent wake-up decisions window by window according to the following logic within the opened wake-up monitoring window: First, it calculates the wake-up suitability score for the current time window: Score = W1 × (1- R_delta) + W2 × Proximity(t, T_target) + W3 × IsREMEnd - W4 × IsSWS, where W1 is 0.4, W2 is 0.3, W3 is 0.2, and W4 is 0.5; R_delta is the relative power of the Delta wave in this time window; Proximity(t, T_target) represents the proximity of the current time to the target wake-up time; IsREMEnd is set to 1 if the end of REM sleep is detected in this time window, otherwise it is set to 0; IsSWS is set to 1 if the time window is determined to be deep sleep, otherwise it is set to 0; secondly, it is determined whether the current time window is in the middle of REM sleep (i.e., determined to be REM sleep and no end has been detected): if it is in the middle of REM sleep, to avoid forcibly interrupting the dream and causing disorientation, the wake-up will not be triggered in this time window; thirdly, it is determined whether the suitability score of the current time window is not lower than the preset trigger threshold: if it is not lower than the preset trigger threshold and is not in the middle of REM sleep, then a differentiated triggering strategy is executed according to the stage of the wake-up monitoring window: ① in the first stage (the first two-thirds of the duration, with ample remaining time): do not trigger immediately, maintain observation and obtain the score of the next time window Score(t+1), if Score(t+1) < Score(t) indicates that the Delta wave is starting to rise and sleep is transitioning towards deep sleep. Based on this, it is confirmed that the previous moment was a local maximum peak, and wake-up is immediately triggered and a gradual wake-up strategy is adopted. If the score is still rising, the next time window is entered to continue the cycle of monitoring. ② In the second stage (the last third of the time, time is tight): as long as the suitability score of any time window is not lower than the preset trigger threshold, wake-up is triggered immediately. Finally, if the current time window does not meet the above trigger conditions (in the middle of the REM phase or the score is lower than the threshold), it is determined whether the forced cutoff time has been reached: only in mode one with rigid clock cutoff requirements, if the forced cutoff time has not been triggered by the end of the tolerance window, the forced wake-up is executed with the maximum intensity. If the cutoff time has not been reached, or in mode two or mode three without clock cutoff restrictions, the next time window is entered to continue the cycle of monitoring and evaluation. The intelligent wake-up decision module 4 provides three wake-up modes for users to select and configure via the mobile APP 8: Target wake-up time mode (Mode 1), where the user sets a target wake-up time, and the wake-up monitoring window is set to a tolerance monitoring window that floats bidirectionally around the target wake-up time, including a first time segment before the target wake-up time (e.g., the first 20 to 40 minutes, preferably 30 minutes) and a second time segment after the target wake-up time (e.g., the last 20 to 40 minutes, preferably 30 minutes). Within the window, it captures characteristics of the end of light sleep or REM sleep. If a suitable wake-up point is not found by the end of the window (e.g., delayed by 30 minutes), a forced wake-up is executed, thus avoiding mechanical wake-up caused by the target time falling precisely during deep sleep; Complete sleep cycle mode (Mode 2), where the user sets the number of physiological sleep cycles N, and the system... The system counts completed sleep cycles in real time, using the end point of each REM sleep phase as the cycle boundary. After reaching the preset Nth sleep cycle, the wake-up monitoring window is opened, and there is no mandatory cutoff time. It continues to monitor until the REM sleep phase of the Nth cycle ends or the user spontaneously enters the light sleep phase, triggering a gentle wake-up. In the minimum sleep duration guarantee mode (mode 3), the user sets a minimum expected sleep duration (such as 7 or 8 hours). After the accumulated sleep duration reaches the minimum duration, the system opens an open wake-up monitoring window, and there is no mandatory cutoff time. It continues to monitor until the user's sleep state naturally enters the light sleep phase, the sleep onset phase, or the REM sleep phase ends, triggering a gentle wake-up. This achieves natural wake-up assistance after meeting the required amount of sleep. like Figure 5 As shown, the wake-up output unit 6 preferably employs a miniature linear vibration motor 61 built into the forehead host, and executes a three-stage progressive wake-up strategy with EEG feedback closed loop after triggering wake-up: Stage 1 (0 to 30 seconds), operating in a weak intermittent mode with a low intensity of 20% for 2 seconds of vibration and a 3-second stop; Stage 2 (30 to 60 seconds), if no awakening characteristics are detected within 30 seconds of Stage 1, it automatically increases to a medium intensity of 50% and operates in an enhanced intermittent mode with 3 seconds of vibration and a 2-second stop; Stage 3 (after 60 seconds), if no awakening characteristics are detected within a cumulative 60 seconds, it enters Stage 3, operating with continuous vibration at 100% intensity and maintaining this output; during the wake-up output of each of the above stages, the signal processing module 2 monitors the relative power of Alpha waves in the EEG signal in real time: once the relative power of Alpha waves is detected to be greater than 40% and the duration reaches 10 seconds, the microcontroller 21 determines that the user is fully awake, immediately controls the wake-up output unit 6 to stop vibrating, realizes closed-loop timely braking, and avoids startling and overstimulation; subsequently, the mobile APP 8. A wake-up success message pops up and displays a one-night sleep period report. The data storage device 5 has a capacity of no less than 4MB and is used to locally store the raw EEG signals, feature values, and corresponding sleep staging results for the entire sleep cycle. The Bluetooth module 7 is bidirectionally electrically connected to the microcontroller 21 and the data storage device 5: the microcontroller 21 uploads the processed sleep staging data and wake-up events to the mobile APP 8 via the Bluetooth module 7 for graphical presentation; the user's target wake-up time, mode selection, and algorithm parameters sent by the mobile APP 8 are received by the Bluetooth module 7 and configured to be executed by the intelligent wake-up decision module 4. (III) Optional parameter range and alternative implementation methods It should be noted that the specific values mentioned above are preferred embodiments, and the implementation of this invention is not limited to the above values. Without departing from the concept of this invention, those skilled in the art can make corresponding adjustments to the above parameters based on the actual device selection, usage environment, and wearing location, all of which should fall within the protection scope of this invention. Specifically: Regarding the acquisition front end: Instrumentation amplifier 13 can be an INA333, or an AD8232, AD620, INA128, or other instrumentation amplifiers with high common-mode rejection ratio and low input bias current, with a gain selectable between 10 and 200 times. The cutoff frequency of high-pass filter 14 can be selected between 0.1 Hz and 1 Hz, and can be a second-order Sallen-Key structure, a passive RC structure, or other active filter structures. The gain of secondary amplifier 15 can be selected between 2 and 50 times. The cutoff frequency of low-pass filter 16 can be selected between 30 Hz and 45 Hz, and its order can be second to eighth, using Butterworth, Chebyshev, or Bessel responses. The center frequency of notch filter 17 depends on the local power frequency; in regions with a power frequency of 50 Hz, such as China, 50 Hz is used, and in regions with a power frequency of 60 Hz, 60 Hz is used. It can be a double-T structure, an active double-T structure, or a band-stop filter structure, or can be implemented digitally by microcontroller 21. The total gain of the acquisition link can be selected between 500 and 5000 times to match the amplitude of the EEG signal with the input range of the analog-to-digital converter 18. The resolution of the analog-to-digital converter 18 should be no less than 12 bits, and can be 12-bit, 16-bit, or 24-bit; the sampling rate can be selected between 128Hz and 512Hz to meet the Nyquist sampling requirements for EEG components within 30Hz. The analog-to-digital converter 18 can be a standalone chip, integrated into the microcontroller 21, or it can be integrated with a dedicated EEG acquisition chip such as ADS1299 or ADS1291 to achieve amplification, filtering, and analog-to-digital conversion. Regarding the electrodes: The forehead dry electrode assembly 11 is preferably located at the Fpz position of the international 10-20 system, but it can also be located at the Fp1, Fp2, AF7, AF8, or other positions on the forehead or sides of the forehead, or inside the ear canal or around the ear. The electrode material can be silver chloride-plated conductive rubber, stainless steel, conductive fabric, conductive silicone, or flexible printed electrodes. Regarding the electrode shape and contact method: The contact method and shape of the forehead dry electrode assembly 11 with the skin are not rigidly limited. Those skilled in the art can freely choose according to the actual wearing structure, material impedance, and ergonomics. For example, the electrode contact can be flat strip, flat round, elliptical, sheet-like, or dot-like, and can be directly attached, flexibly padded, elastically floating, or structurally attached to the forehead skin. Thanks to the high input impedance of the analog front end, the contact impedance of the forehead dry electrode assembly 11 can work reliably in the range of less than 200kΩ (preferably less than 100kΩ or less than 50kΩ), and has a very wide adaptive tolerance to the dryness and humidity of the skin of different people. The different electrode shapes and bonding structures described above all fall within the protection scope of this invention. The reference electrode can be embedded and integrated with the measuring electrode in the inner part of the forehead main unit (such as the same side or opposite side of the forehead, forming an integrated self-contained electrode group that does not require external wiring to the ear), or it can be set in specific situations at the A1 or A2 position behind the ear, the earlobe, or the root of the nose. Regarding signal processing and time windows: The time window (epoch) mentioned in this invention refers to a certain period of time extracted from a continuous EEG signal on the time axis. Its preset duration is preferably 30 seconds, but can also be selected between 20 and 60 seconds. The division method includes both discrete time segmentation where adjacent time windows are joined end-to-end, and sliding window division where the window slides forward with a preset sliding step size (e.g., 1 to 10 seconds). Both methods achieve the technical effect of extracting EEG features window by window and are part of the multiple time windows divided according to a preset duration as described in this invention. Power spectral density calculation can use the Welch method, with window functions such as Hanning, Hamming, or Blackman windows. The number of FFT points can be selected between 1024 and 4096, and the overlap rate can be selected between 25% and 75%. Alternatively, periodogram methods, multi-window spectral estimation methods, wavelet transform, empirical mode decomposition, and other time-frequency analysis methods can be used to extract the energy of each frequency band. The boundaries of each frequency band can be set according to the American Academy of Sleep Medicine standards: Delta wave 0.5-4Hz, Theta wave 4-8Hz, Alpha wave 8-13Hz, Beta wave 13-30Hz. Adjustments within ±1Hz are also possible, and further subdivisions such as low Alpha, high Alpha, or the addition of Gamma wave frequency bands can be made. Regarding sleep spindle detection: the preferred bandpass range is 11-16Hz, but 12-14Hz or 10-16Hz are also acceptable; the preferred envelope threshold is the mean plus 1.5 times the standard deviation, but can also be selected between the mean plus 1.2 to 2.0 times the standard deviation—the amplitude of the spindle in the forehead is lower than that in the central region, so a lower coefficient is used; if the electrode is placed in the central region, a higher coefficient can be used; the preferred duration criterion is 0.5 to 3 seconds. The preferred amplitude criterion for the K-complex is greater than 75μV, but can also be selected between 50μV and 100μV. Regarding the wake-up suitability score and windowing mechanism: the preferred weights W1, W2, W3, and W4 are 0.4, 0.3, 0.2, and 0.5, respectively. Alternatively, they can be selected between 0.3 and 0.5, 0.2 and 0.4, 0.1 and 0.3, and 0.4 and 0.6, respectively, to reflect the weighted relationship that "the lower the relative power of the Delta wave, the closer it is to the target time, and the more suitable it is for wake-up, while it is not suitable for wake-up during deep sleep." The sum of the four weights does not need to equal 1. In the target wake-up time mode, the wake-up monitoring window is set bidirectionally around the target wake-up time, including the first time segment before the target time (e.g., the first 30 minutes) and the second time segment after the target time (e.g., the last 30 minutes), forming a total tolerance monitoring window of 60 minutes such as [T_target-30min, T_target+30min]. Time proximity can be defined as a symmetrically decreasing function of the deviation between the current moment and the target wake-up moment, for example, Proximity(t, T_target) = 1 - |t - T_target| / ΔT; or it can gradually increase with time before the target moment, and be set to a higher tolerance weight as the final deadline approaches after the target moment. The technical effect of this setting is that if the user happens to be in deep slow-wave sleep (N3 stage) 30 minutes before the target moment, the system will not mechanically force a wake-up when the target moment arrives, but will allow the user to enter the second segment after the target moment, waiting for the trough of the deep sleep cycle to pass naturally and the cortex to re-enter the N2 light sleep or REM stage before performing a gentle wake-up; a forced wake-up is only performed as a final bottom-line guarantee if the user is still in deep sleep at the end of the later segment. The minimum sleep duration guarantee mode is specifically used for holidays, weekends, or scenarios where strict adherence to wake-up time is not required. Users only need to set the minimum expected sleep duration (such as 7 or 8 hours). After the required sleep duration is met, the system will start wake-up monitoring. This monitoring window does not have a manually forced cutoff time. Instead, it silently observes the natural evolution of the brain's sleep cycle until it captures the light sleep stage of the next cycle or the tendency of spontaneous micro-awakening, and then assists in waking the user. This perfectly matches the ideal physiological need for natural wake-up. Regarding progressive wake-up: the intensity of the three stages is preferably 20%, 50%, and 100%, but can also be selected between 20% to 30%, 40% to 60%, and 90% to 100%, respectively; the duration of each stage is preferably 30 seconds, but can also be selected between 15 and 60 seconds; the intermittent ratio can be adjusted or changed to continuous vibration. The wake-up criterion is preferably an Alpha wave relative power greater than 40% for 10 seconds, and the threshold can also be selected between 30% and 50%, with a duration between 5 and 15 seconds; it can also be combined with characteristics such as an increase in Beta wave relative power and an increase in body momentum for joint determination. When the wake-up output unit 6 is implemented as a vibrator, a linear vibration motor 61 is preferred, but an eccentric rotor motor or a piezoelectric vibrator can also be used; in addition to vibration, wake-up methods such as gradually brightening light and gradually increasing audio can also be used. The vibration location is preferably the temples, but can also be placed on the forehead or behind the ears. Regarding the structural form: the device is preferably in the form of an elastic fabric headband, but it can also be in the form of an eye mask, hairband, hat, or ear loops; the electronic module can be detached and installed, or it can be sewn as a whole. The data storage capacity should be no less than 4MB, and it can use SPIFlash, eMMC, or TF card. Wireless transmission can use Bluetooth, or WiFi, NFC, or a dedicated 2.4GHz protocol. Regarding signal quality indicators and artifact elimination: When users turn over at night, frown, clench their teeth, or when electrodes partially detach from the skin, the collected signals will contain motion artifacts and electromyography artifacts much larger than the EEG amplitude. The spectral characteristics of such time windows cannot reflect the true sleep depth, and calculating the arousal suitability score based on this will lead to false triggering. Therefore, signal processing module 2 calculates signal quality indicators for each time window: First, the saturation sampling point ratio, which is the proportion of sampling points in the time window whose signal amplitude exceeds a preset saturation threshold (preferably 90% of the full scale of the analog-to-digital converter) to the total number of sampling points in the time window. When this proportion exceeds a preset proportion (preferably 5% to 20%), the signal is deemed unusable; Second, the electrode contact impedance, which can be obtained by injecting a weak AC excitation into the electrode and measuring the response amplitude. When the contact impedance exceeds a preset impedance upper limit (preferably 50kΩ to 200kΩ), the electrode contact is deemed poor. A time window that meets any of the above conditions is marked as a pseudo-segment. This time window is not included in the calculation and comparison of the wake-up suitability score, nor is it used as a wake-up trigger point. The sleep staging algorithm module 3 fills in the staging result of this time window with the staging result of its adjacent time window. Regarding the wearable device: The wearable device, as referred to in this invention, is a carrier worn on the head by the user and supporting the various components of the device. Its form can be an elastic fabric headband, eye mask, hairband, hat, or ear loops. The EEG frequency acquisition device 1, signal processing module 2, sleep staging algorithm module 3, intelligent wake-up decision module 4, data recording unit, and unit for outputting wake-up stimuli or sending wake-up commands are all mounted on this wearable device, making the device an integrated wearable device that can independently complete acquisition, staging, decision-making, and wake-up without an external host. The unit for outputting wake-up stimuli or sending wake-up commands acts as a wake-up actuator (such as a vibrator 6, light-emitting device, or audio generator) when the device itself applies stimulation, and as a wake-up command output unit (such as a Bluetooth module 7) when the device only sends wake-up commands to external devices. To ensure comfort during nighttime wear, the entire device preferably adopts a lightweight implementation using a single-channel forehead dry electrode, an elastic fabric headband, and detachable electronic modules. Figure 6 In the preferred embodiment shown, the forehead dry electrode assembly 11, the internal main control processing motherboard 20 (integrating the aforementioned acquisition device 1, processing module 2, algorithm module 3, decision module 4, data storage 5, Bluetooth module 7, microcontroller 21, and built-in battery), and the wake-up output unit 6 (such as a built-in linear vibration motor 61) are all integrated and packaged in an integrated forehead host 100. This integrated forehead host 100 is fitted onto the forehead portion of the elastic fabric headband 10, forming a self-contained integrated wearing structure that eliminates the need for external wiring and external suspension components. The integrated forehead host 100 has a slightly arc-shaped flat shape that conforms to the contour of the forehead. The inner surface of the forehead patch is in contact with the scalp, and the forehead dry electrode assembly 11 is disposed on the inner surface of the forehead patch to maintain close contact with the forehead skin, making the device uniformly stressed, lightweight, and comfortable. Regarding the output form of the wake-up stimulus: The wake-up actuator referred to in this invention generally refers to any device that can output a perceptible stimulus to the user to wake them up. A vibrator 6 is preferred, but a light-emitting device can be used to wake the user with gradually brightening light, an audio generator can be used to wake the user with gradually increasing sound, or any combination of the above methods. Regardless of the output form used, the controlled logic is the same: it is initiated by the intelligent wake-up decision module 4 after determining the wake-up trigger point, and stops after detecting the user's awakening characteristics. Regarding the addition or subtraction of scoring factors: The essence of the arousal suitability score in this invention lies in comprehensively evaluating whether each time window is suitable for arousal through a weighted combination. The Delta wave relative power inverse vector and the deep sleep penalty term are two essential factors reflecting this evaluation idea; the former has a positive weight, and the latter a negative weight. Based on this, the time proximity term and the REM sleep end point term are preferred additional factors, which can be used simultaneously, selectively, or omitted in situations where a target time is not required or sleep cycle boundaries are not distinguished. In addition to the above four items, additional factors such as body momentum, heart rate, and ambient light can be added and assigned corresponding weights. Increasing or decreasing the number of factors does not change the essence of this invention. Regarding the number of electrodes and channels: Electrode 11 is preferably a dry electrode that does not require conductive paste, but a wet electrode that is used with conductive paste or conductive gel can also be used. The preferred number of acquisition channels is a single channel to simplify the structure, reduce costs, and improve wearing comfort. In cases where higher staging accuracy is required, two or more electrodes can be used to form two or more acquisition channels. The relative power of each channel is calculated separately and then weighted and fused or selected optimally. In this case, the processing flow of the device is the same as in the single-channel case. In addition to the forehead region, the electrodes can also be placed in the ear canal, around the ear, on the earlobe, or behind the ear. Using ear EEG acquisition can also obtain EEG signals containing the frequency band information required for sleep staging. Regarding the representation of spectral characteristics: The relative power mentioned above refers to the ratio of the power of a certain frequency band to the total power. As an equivalent alternative, the ratio between frequency band powers can also be used to represent the same spectral characteristic. For example, ratios such as the ratio of Delta wave power to Beta wave power, the ratio of Beta wave power to spindle wave frequency band power, and the ratio of Alpha wave power to Theta wave power can be used as the basis for judgment, or the absolute power of each frequency band can be directly used after normalization. Relative power and frequency band power ratios are mathematically convertible to each other and both can reflect the changing trend of sleep depth. Therefore, the sleep state determination and awakening suitability score calculation described in this invention can be based on either relative power or the ratio between frequency band powers. Regarding the granularity of sleep state classification: The intelligent wake-up decision of this invention only requires distinguishing whether the current state is deep sleep, which is not suitable for waking. Therefore, the granularity of sleep state classification can be selected as needed. The most complete implementation is to classify it into five stages according to the AASM standard: wakefulness, sleep onset, light sleep, deep sleep, and REM sleep; it can also be simplified to three categories: wakefulness, light sleep, and deep sleep, or only distinguish between three states: wakefulness, non-deep sleep, and deep sleep; it can also directly calculate a continuous sleep depth value based on relative power or frequency band power ratio instead of outputting discrete stage labels, and distinguish between deep sleep and non-deep sleep stages by whether this value exceeds a preset deep sleep judgment value. All of the above classification granularities can be used for the wake-up decision of this invention, the only difference being the level of detail in the sleep report presented to the user. Regarding the positive and negative representations of the deep sleep adjustment item: The adjustment item in the arousal suitability score that reflects the unsuitability for arousal during deep sleep can be written as a deep sleep penalty item with negative weighting, meaning that when the time window is determined to be deep sleep, this item takes a non-zero value and is subtracted from the total score; or equivalently, it can be written as a non-deep sleep bonus item with positive weighting, meaning that when the time window is determined to be non-deep sleep (including light sleep, sleep onset, and REM sleep), this item takes a non-zero value and is added to the total score. Since the selection of the arousal trigger point is based on the relative scores of each time window within the window, adding or subtracting the same constant to the scores of all time windows does not change the comparison result. Therefore, the arousal trigger points obtained by the above two methods are exactly the same and belong to the equivalent representation of the same technical solution. Regarding the storage location of sleep data: EEG signals and sleep state determination results during sleep can be stored in the device's internal data storage 5, which the user can access the following day via a mobile terminal; alternatively, the device can transmit the data in real-time or in segments to an external device such as a mobile terminal via Bluetooth module 7 during the data collection process, and the external device will handle the storage, while the device only retains cached data during periods of disconnection. Both methods are equally effective for the user, providing a complete sleep record and stage curve the following day. Regarding the implementation location of the filtering stage: the aforementioned 0.5Hz high-pass, 35Hz low-pass, and 50Hz notch filters can all be implemented in hardware by the analog front-end circuit, in which case the signal sent to the analog-to-digital converter 18 is already a band-limited signal; alternatively, only the necessary anti-aliasing processing can be retained in the analog front-end, while the aforementioned high-pass, low-pass, and power frequency suppression can be implemented by the signal processing module 2 using digital filtering of the digitized signal, for example, by using IIR or FIR digital filters, or by directly discarding the corresponding frequency components in the frequency domain. When the analog-to-digital converter 18 has sufficient resolution and dynamic range, the latter method can reduce the number of analog devices. The two implementation methods are equivalent in filtering effect, both belonging to filtering of the aforementioned potential signal. Regarding the representation of the sleep depth factor: The factor reflecting sleep depth in the wakefulness score can be the inverse vector of the relative power of Delta waves with a positive weight, i.e., weighted in the form of (1 − R_delta); or equivalently, the relative power of Delta waves can be directly taken with a negative weight, i.e., weighted in the form of (− R_delta). The two differ only in a constant term and do not change the relative ranking of scores for each time window within the window. Furthermore, since the relative power of Beta waves to Alpha waves increases as sleep deepens, the relative power of Beta waves or Alpha waves can be used with a positive weight as the factor, or the ratio of Delta wave power to Beta wave power can be used with a negative weight. All of these forms result in lower wakefulness scores for windows with deeper sleep and higher wakefulness scores for windows with lighter sleep, representing equivalent expressions of the same technical solution. Regarding the required number of frequency bands: A complete five-stage phase requires the simultaneous use of the relative power of four frequency bands: Delta, Theta, Alpha, and Beta. However, in a simplified implementation that only distinguishes between deep sleep and non-deep sleep, the relative power of the Delta wave alone can be used for determination. For example, if the relative power of the Delta wave reaches 20% as the criterion for determining deep sleep, then signal processing module 2 only needs to calculate the relative power of one frequency band. Therefore, the relative power calculation described in this invention can be performed on all four frequency bands, or only on one or a few frequency bands. Criteria for stopping arousal stimulation: During gradual arousal, determining whether a user is awake can be based on whether the relative power of alpha waves exceeds a preset awakening threshold; alternatively, it can be based on other EEG frequency characteristics, such as an increase in the relative power of beta waves, a simultaneous decrease in the relative power of delta and theta waves, or a sum of the relative powers of alpha and beta waves exceeding a preset value. These criteria, all based on EEG frequency characteristics, can identify an awake state before the user makes any physical movements or presses any buttons, thus allowing for timely cessation of stimulation. Regarding the addition, subtraction, and simplification of scoring factors: The aforementioned four-factor weighted arousal suitability score is a preferred implementation of this invention. The proximity factor avoids premature arousal, the REM sleep termination point discrimination item captures the natural awakening opportunity, and the deep sleep regulation item avoids sleep inertia. The combined effect of these four factors yields the optimal arousal timing. However, the core of this invention lies in quantifying and comparing the arousal suitability of each time window within the arousal monitoring window, and selecting the best among them, rather than in the number of factors. In a simplified implementation, the arousal suitability score can also consist of only one factor, for example, directly using (1 − R_delta) as the arousal suitability score, or directly using the relative power of Beta waves, the relative power of Alpha waves, or the sum of the relative powers of Alpha waves and Beta waves as the arousal suitability score. In this case, the score still increases as sleep becomes lighter and decreases as sleep becomes deeper. The device performs recursive comparisons or local maxima detection within the window based on this score, and can similarly select the moment most easily awakened from several moments of lighter sleep. Regarding real-time wake-up decision-making and offline evaluation methods: Wake-up decisions must be made in real time before the target wake-up time, and time cannot be reversed. Therefore, the intelligent wake-up decision module 4 only makes one judgment on whether to wake up at this moment or continue waiting in each time window, and the objects it can compare are the time windows that have already passed within this window. In real-time operation, the device determines the wake-up trigger point through recursive comparison, local maximum peak detection, or subsequent stage threshold triggering. In addition, as an offline evaluation and adaptive learning method, when used for post-event review analysis of the sleep quality of the night, the historical scores of all time windows within the window can be retrospectively statistically analyzed after the wake-up monitoring window ends to evaluate the deviation between the real-time wake-up decision and the theoretical global optimum, which is used for personalized adaptive iteration and optimization of the device's algorithm parameters. Regarding the phase division of the wake-up monitoring window: To balance the goals of selecting the optimal time within the window and avoiding exceeding the wake-up time, in modes with a defined cutoff time, the wake-up monitoring window can be divided into a first phase and a second phase. For example, the first two-thirds of the duration is the first phase, and the last one-third is the second phase. In the first phase, since there is ample remaining time, the device uses the aforementioned local maximum detection method, triggering wake-up only when the score has reached a peak and the peak value is not lower than a preset trigger threshold, thus avoiding premature wake-up while the score is still rising. In the second phase, since there is insufficient remaining time to wait for a better time, the device triggers wake-up as long as the score in any time window is not lower than the preset trigger threshold. If wake-up is not triggered by the final cutoff time at the end of the monitoring window, a forced wake-up is performed. In the full sleep cycle mode and the minimum sleep duration guarantee mode without a rigid cutoff clock, the system opens an open monitoring window after meeting the preset number of cycles or minimum duration, without a hard cutoff time, continuously evaluating the wake-up suitability in each time window until light sleep or REM sleep characteristics appear, at which point a gentle wake-up is triggered. In addition, since interruption during the REM period can cause dream remnants and disorientation, the device does not trigger wake-up when a certain time window is identified as a REM period and the end of the REM period has not yet been detected. Instead, it waits for the REM period to end naturally. At this time, the time window also receives a positive bonus for the end of the REM period, and the score reaches a higher level within the window. Beneficial effects Compared with the prior art, the present invention has the following advantages: 1. Fundamentally different measurement methods: This invention directly collects electrical activity of the cerebral cortex (EEG), rather than indirectly inferring it through body movement or heart rate. Accelerometers can only detect body activity and cannot distinguish between the static deep sleep stage and the REM sleep stage; this invention can directly determine the sleep stage by using the power distribution of each frequency band (Delta, Theta, Alpha, Beta) and characteristic waveforms such as sleep spindle waves and K-complex waves. 2. Significantly improved accuracy of sleep staging: Existing consumer-grade devices based on accelerometers have an accuracy of about 60-70% in sleep staging, while the staging method based on EEG characteristics of this invention can achieve an accuracy of over 85%, which is close to the level of medical-grade polysomnography. 3. Wake-up Timing Determined by Quantitative Comparison: Unlike the fixed wake-up time of traditional alarm clocks, and unlike the passive response method of existing prefrontal EEG devices that "trigger upon detecting a light sleep stage," this invention proposes a wake-up suitability score. This score weights and integrates factors such as Delta wave relative power, time proximity, REM sleep termination point, and deep sleep penalty into a comparable quantitative index. Within the wake-up monitoring window, each time window is scored individually, and the highest score is selected. This distinguishes moments within the same light sleep stage but with varying degrees of wake-up difficulty: for example, the moment immediately transitioning from deep sleep to light sleep has a relatively high Delta wave relative power and is not the REM sleep termination point, resulting in a lower score; while the moment transitioning from REM sleep to light sleep has a low Delta wave relative power and is the REM sleep termination point, resulting in a significantly higher score, and the device will prioritize the latter. Furthermore, the introduction of a time proximity factor avoids triggering wake-up very early in the window, unnecessarily shortening sleep duration. This is the core difference between this invention and existing technologies. 4. Gradual wake-up reduces discomfort: By monitoring the rise of alpha waves in real time, the vibration intensity is dynamically adjusted in three levels. The vibration stops immediately after detecting that the user is awake, which is more comfortable than fixed intensity vibration. 5. High comfort for home use: The front main unit has an ergonomic flat shape, which fits the forehead dry electrode group for a close fit and even pressure distribution; with the elastic fabric headband, there is no need to apply conductive paste or complicated and long external leads, making it lightweight and comfortable to wear, and very suitable for daily sleep use at home. 6. Data visualization and long-term tracking: Data is transmitted to a mobile app via Bluetooth, allowing users to view EEG spectrograms, sleep stage curves, sleep efficiency scores, and historical trends, facilitating long-term management of sleep health. 7. The quality of weak signal acquisition is guaranteed: The device has a total gain of 1010 times. With the combination of a 0.5Hz second-order high-pass filter, a 35Hz fourth-order low-pass filter, and a 50Hz dual-T notch filter, it can amplify weak EEG signals in the 50μV range to a level suitable for acquisition by a 16-bit analog-to-digital converter. At the same time, it suppresses baseline drift, EMG artifacts, and power frequency interference, ensuring signal quality under single-channel conditions. Attached Figure Description Figure 1 This is a system block diagram of a device for analyzing sleep via electroencephalogram (EEG) and intelligently waking up according to the present invention; Figure 2 This is a schematic diagram of the front-end circuit for acquiring brainwave signals in this invention. Figure 3 This is a flowchart of the sleep staging algorithm of the present invention; Figure 4 This is a flowchart of the intelligent wake-up decision module of the present invention; Figure 5This is a flowchart of the progressive wake-up strategy of the present invention; Figure 6 This is a schematic diagram of the wearing configuration of the device of the present invention; Figure 7 This is a schematic diagram of the sleep periodization results and wake-up trigger points of this invention. Explanation of markings in the diagram: 1—EEG frequency acquisition device; 2—Signal processing module; 3—Sleep staging algorithm module; 4—Intelligent wake-up decision module; 5—Data storage; 6—Wake-up output unit (e.g., vibrator); 7—Bluetooth module; 8—Mobile APP; 10—Elastic fabric headband; 11—Forehead dry electrode group; 12—Input protection circuit; 13—Instrumentation amplifier; 14—High-pass filter; 15—Secondary amplifier; 16—Low-pass filter; 17—Notch filter; 18—Analog-to-digital converter; 20—Internal main control processing motherboard; 21—Microcontroller; 61—Linear vibration motor; 100—Integrated forehead main unit. Detailed Implementation In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances. The present invention will now be described in further detail with reference to the accompanying drawings. The following embodiments illustrate the specific working process of the device of the present invention in three wake-up modes. The times, relative power values of each frequency band, and wake-up suitability scores listed are exemplary values given for the convenience of explaining the technical solution, and are used to clarify the processing logic and mutual cooperation of each module, and do not constitute a limitation on the scope of protection of the present invention. Users' sleep structures vary individually, and the start and end times, durations, and characteristic parameter values of each sleep stage will vary with the user, wearing status, and environmental conditions in actual operation, but the processing flow and judgment logic of the device are the same as those in the following embodiments. Example 1: Target Wake-up Time Pattern The user sets the target time to 07:00 and selects Mode 1 (Target Wake-up Time Mode, with the wake-up monitoring window set 30 minutes before and after the target time, i.e., [06:30, 07:30]). Combined with... Figure 7 The working process of the device in this embodiment is described as follows: At 23:30, the user fell asleep wearing the headband. After the device was powered on, the forehead dry electrode assembly 11 was attached to the forehead skin (with the Fpz position as the measurement point and the ipsilateral forehead as the reference point) to collect potential signals. After passing through the input protection circuit 12 (clamped by a 100Ω current-limiting resistor and a BAT54S Schottky diode), the signal entered the instrumentation amplifier 13 (INA333, RG=1kΩ, gain 101 times). The signal passed sequentially through a 0.5Hz second-order high-pass filter 14, a 10x second-order amplifier 15, a 35Hz fourth-order low-pass filter 16, and a 50Hz dual-T notch filter 17, with a total gain of 1010 times. The input 50μV EEG signal was amplified to approximately 50mV and digitized by a 16-bit analog-to-digital converter 18 at a sampling rate of 256Hz. From 23:30 to 23:42, the microcontroller 21 calculated the power spectral density using a 30-second time window (epoch), employing the Hanning window, 2048-point FFT, and a 50% overlap Welch method. During this phase, the relative power of the alpha wave gradually decreased from 32% to 18%, while the relative power of the theta wave increased from 12% to 24%. No sleep spindle waves or K-complex waves were detected, indicating the N1 sleep onset period. From 23:42 to 00:15, sleep spindle waves were detected in the 7th time window (11-16Hz bandpass followed by Hilbert transform to obtain the envelope, the envelope amplitude exceeded the mean plus 1.5 times the standard deviation, and the duration was 1.2 seconds). The Delta wave relative power was 14%, which was determined to be N2 light sleep stage. From 00:15 to 00:52, the relative power of the Delta wave increased to 26%, with a peak-to-peak value exceeding 75μV. Theta, Alpha, and Beta waves all decreased significantly, indicating the N3 deep sleep stage. From 00:52 to 01:08, the relative power of the Delta wave dropped to 16%, and the spindle wave was detected again, indicating N2 light sleep. From 01:08 to 01:25, the relative power of Theta waves increased to 38%, Alpha waves to 7%, and Delta waves to 8%, exhibiting a mixed frequency and low amplitude characteristic. The preceding stage was N2, which was determined to be REM (Rapid Eye Movement) sleep. At 01:25, the end of the REM phase was detected, marking the completion of the first sleep cycle, with a cycle duration of 115 minutes. From 01:25 to 06:10, the device continuously monitored the completion of the second to fourth sleep cycles, with durations of 98 minutes, 92 minutes, and 95 minutes respectively. At 06:10, the fifth sleep cycle began. From 06:10 to 06:22, the individual was in the N2 light sleep stage (12 minutes), followed by REM (Rapid Eye Movement) dreaming at 06:22. Data storage unit 5 recorded the raw signals throughout the night and the staged results for each time window. At 06:30, the intelligent wake-up decision module 4 enters the wake-up monitoring window (within a 30-minute range before and after the target time of 07:00, and monitoring of the pre-segment begins at 06:30). At this time, the user is still in the REM dreaming phase of the fifth cycle. The microprocessor 21 detects that the relative power of Theta waves in the EEG signal is relatively high (42%), and the relative power of Delta waves is 7%. Although the Delta waves are low, the system determines that REM dreaming has not yet ended (IsREMEnd=0). If the user is forcibly woken up at this time, it will interrupt the dream and cause palpitations and cognitive confusion. At this time, the time proximity Proximity (06:30, 07:00) = 1 - 30 / 30 = 0, and the suitability score is: Score = 0.4×(1-0.07) + 0.3×0 + 0.2×0 - 0.5×0 = 0.372, which is lower than the preset threshold of 0.50. The system determines that the user is not suitable for wake-up and maintains silent monitoring. From 06:30 to 06:42, the user remained in the REM dreaming stage. At 06:42, the REM dreaming stage was detected to have ended naturally (IsREMEnd=1). The low-amplitude mixed frequency of the EEG transitioned to sleep spindle waves and K complex waves. The user spontaneously entered the N2 light sleep stage. The relative power of the Delta wave, R_delta, was 8% (0.08). The time proximity (06:42, 07:00) = 1 - 18 / 30 = 0.40. The deep sleep penalty item, IsSWS, was 0 (penalty value - W4 × IsSWS = 0). The suitability score was: Score = 0.4 × (1 - 0.08) + 0.3 × 0.40 + 0.2 × 1 - 0.5 × 0 = 0.368 + 0.120 + 0.200 - 0 = 0.688. The suitability score of 0.688 significantly exceeded the preset threshold of 0.50. In the next time window at 06:42:30, the relative power of the Delta wave rose to 11% and moved away from the end of the REM sleep phase. The suitability score dropped back to 0.481. Based on this, the intelligent wake-up decision module 4 determined that 06:42 was the local peak point of the suitability score, which was the golden time for waking up from a natural transition from dreaming to light sleep. Therefore, the decision module 4 triggered the wake-up output unit 6 to start a gentle and gradual wake-up at 06:42:30, 18 minutes earlier than the user-set target time of 07:00. like Figure 7As shown by the dashed line, if the system does not intelligently wake the user at the golden point of light sleep (06:42), according to the predicted trajectory of the user's natural physiological sleep cycle, after a brief N2 light sleep (06:42-06:48), the user will fall into the fifth cycle's N3 deep slow-wave sleep stage at 06:48. At the target time of 07:00, the relative power of Delta waves in the EEG signal will reach as high as 26%, with peak-to-peak values exceeding 75μV. If a traditional rigid timer is used, it will forcibly wake the brain center from deep sleep at the target time of 07:00, triggering severe sleep inertia and causing the user to experience strong morning grogginess symptoms such as dizziness, drowsiness, palpitations, fatigue, and difficulty concentrating upon waking. In the bidirectional tolerance monitoring window [06:30, 07:30] of Mode 1 of this invention, the system not only successfully captures the golden window of REM sleep ending and transitioning to light sleep at 06:42 to wake the user in advance; furthermore, even if the user is in deep sleep during the first half of 06:30-07:00, the system will not violently wake the user at 07:00, but will continue to wait until the second half of 07:00-07:30, waiting for the deep sleep to naturally transition to light sleep before waking the user. This completely avoids the physiological trap of falling into N3 deep sleep, allowing the user to wake up easily and naturally when the cortical neurons are in an active state. Gradual wake-up process: The wake-up output unit 6 gently starts with an intermittent mode of 20% intensity, 2 seconds of micro-vibration followed by 3 seconds of pause. After 15 seconds, at 06:42:45, the microprocessor 21 detects that the relative power of the alpha wave in the EEG signal has significantly increased from 8% to 45% (exceeding the 40% awakening threshold) and lasted for more than 10 seconds, determining that the user has smoothly transitioned to a conscious state. The wake-up output unit 6 then stops vibrating, and the user is fully awake at 06:45 (e.g., ...). Figure 7 The central solid line transitioned to wakefulness (W) and remained there until 07:00. The mobile app 8 displayed a successful wake-up notification and a one-night sleep report: total sleep duration 7 hours and 15 minutes (435 minutes), including 26 minutes of N1 stage, 3 hours and 36 minutes (216 minutes) of N2 stage, 1 hour and 22 minutes (82 minutes) of N3 stage, and 1 hour and 51 minutes (111 minutes) of REM sleep. The sleep efficiency was 96.7%, and there were 0 awakenings during the night. Example 2: Complete Sleep Cycle Pattern The user sets their expectation to complete 5 full sleep cycles and selects Mode 2. The device began monitoring at 23:00, counting completed sleep cycles in real time. The first to fifth cycles were completed at 00:48, 02:25, 03:58, 05:34, and 07:06, respectively (with the end of the REM phase of each cycle as the boundary). At 07:06, the end of the REM phase of the fifth cycle was detected, and the user entered the N1 phase of the sixth cycle. The device triggered wake-up at the 3rd minute of the N1 phase (07:09), at which time the Delta wave relative power was 6%, which is the easiest time to wake up in the early part of this cycle. The progressive wake-up function detected signs of wakefulness at the 25th second of the first stage and stopped vibrating. The mobile app showed that 5 complete cycles were completed, with a total sleep time of 8 hours and 9 minutes. Example 3: Minimum Sleep Duration Guarantee Mode (Natural Wake-up Assistance After Meeting Sufficient Sleep Duration) Users select Mode 3 on weekends or holidays, setting a minimum sleep duration of 7 hours and no fixed wake-up time, hoping to wake up naturally after achieving the required sleep duration. The device begins monitoring at 23:30. At 06:30, the device's cumulative monitored sleep duration reached the preset minimum sleep duration of 7 hours, and the intelligent wake-up decision module 4 opened the open wake-up monitoring window. At this time, it was detected that the user was in the deep sleep stage (N3) of the fifth sleep cycle, with a Delta wave relative power of 24%. Since this mode is designed to ensure sufficient rest and does not have a mandatory cutoff time, the system does not mechanically trigger a wake-up, but remains silent and continues to monitor the natural evolution of the user's sleep cycle. From 06:30 to 06:55, the user naturally transitioned from N3 deep sleep to N2 light sleep during the fifth sleep cycle, and entered the REM (Rapid Eye Movement) dreaming stage at 06:55. At 07:18, the microcontroller 21 detected the disappearance of sawtooth waves and eye movement features in the EEG signal, and the appearance of low-amplitude mixed frequency transitioning to sleep spindle waves, determining that the REM dreaming stage had naturally ended (IsREMEnd=1). The relative power of the Delta wave dropped to 8%, and the arousal suitability score reached 0.668 (exceeding the preset trigger threshold of 0.50), indicating that the user's cerebral cortex had spontaneously completed sufficient repair of the entire night's sleep cycle and was at an excellent physiological critical point of natural awakening. The intelligent wake-up decision module 4 then initiated a gentle, gradual wake-up process at 07:18: the wake-up output unit 6 gently intervened with a weak intermittent mode of 20% intensity, 2 seconds of micro-vibration followed by a 3-second pause. Within just 12 seconds, at 07:18:12, the microcontroller 21 detected that the relative power of the alpha wave in the EEG signal rapidly increased from 9% to 46% and remained there for over 10 seconds, indicating that the user had smoothly and naturally opened their eyes and regained consciousness. The wake-up output unit 6 then stopped vibrating, and the entire process was without any discomfort from being startled awake. The mobile app 8's sleep report shows that the minimum sleep duration target has been achieved, with an actual total sleep time of 7 hours and 48 minutes (468 minutes). After meeting the required sleep duration, it captures the light sleep phase at the end of the natural sleep cycle to achieve "painless natural wake-up." At the same time, the system has a preset extreme safety protection limit of 10 hours in the software background. If the user continues to sleep for 10 hours without waking up, the system will output a protective prompt, thus perfectly balancing a comfortable and carefree sleep experience with physiological safety. Supplementary Explanation Regarding the Handling of Forgeries Because the forehead Fpz position is close to the eyes, eye movement artifacts are easily mixed into the acquired signal. In this invention, the microcontroller 21 performs artifact detection for each time window: large fluctuations below 1Hz are identified as eye movement artifacts, abnormal power increases above 30Hz are identified as electromyography artifacts, and the time window is marked as invalid data when the calculated signal-to-noise ratio is less than 10dB. During sleep staging, invalid time windows inherit the state of the previous valid time window, and a majority vote of three consecutive time windows (90 seconds) is used in the time-series smoothing process. At the same time, the state transition path is constrained (normal sleep onset is Wake→N1→N2→N3, normal cycle is N3→N2→REM→N2), and unreasonable jumps are prohibited, thereby reducing the impact of artifacts on the staging results. It should be noted that the detection amplitude of the sleep spindle wave under the single-channel configuration of the forehead is lower than that of the central area (Cz, C3, C4). Accordingly, this invention lowers the spindle wave envelope threshold to the mean plus 1.5 times the standard deviation (the central area usually uses the mean plus 2 times the standard deviation) to compensate for the signal attenuation of the single-channel forehead acquisition. The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention; the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the invention, such designs should fall within the protection scope of the present invention.
Claims
1. A device for brain wave analysis of sleep and intelligent wake-up, characterized in that: It includes an EEG frequency acquisition device (1), a signal processing module (2), a sleep staging algorithm module (3), an intelligent wake-up decision module (4), a data recording unit, and a wake-up output unit; The brainwave frequency acquisition device (1) includes an electrode (11) placed on the user's head, an analog front-end circuit that amplifies the potential signal output by the electrode (11), and an analog-to-digital converter (18); the filtering of the potential signal is achieved by the analog filtering circuit in the analog front-end circuit, or by the signal processing module (2) using digital filtering to process the digitized signal. The signal processing module (2) divides the digitized EEG signal into multiple time windows according to a preset duration, and calculates the relative power of at least one frequency band of Delta wave, Theta wave, Alpha wave, Beta wave or the ratio between the power of the frequency bands for each time window. The sleep staging algorithm module (3) determines the sleep state of each time window based on the relative power or the ratio, wherein the sleep state at least distinguishes between wakefulness and sleep, and at least distinguishes between deep sleep and non-deep sleep during sleep; The intelligent wake-up decision module (4) calculates the wake-up suitability score window by window within the wake-up monitoring window. The wake-up suitability score is calculated by one or more factors. When there are two or more factors, the wake-up suitability score is a weighted combination of the factors. The factors include at least a sleep depth factor that reflects sleep depth. The sleep depth factor makes the wake-up suitability score of the time window with a higher relative Delta wave power lower than that of the time window with a lower relative Delta wave power, or makes the wake-up suitability score of the time window with a higher relative Beta wave power or Alpha wave power higher than that of the time window with a lower relative power. The intelligent wake-up decision module (4) determines the wake-up trigger point based on the wake-up suitability score of each time window within the wake-up monitoring window: when the wake-up suitability score of the current time window is not lower than the maximum value of the wake-up suitability scores of each time window before the current time window within the current wake-up monitoring window, and is not lower than a preset trigger threshold, the current time window is selected as the wake-up trigger point; or, within the wake-up monitoring window, a local maximum value of the wake-up suitability score is detected, and when the wake-up suitability score of a certain time window is higher than the wake-up suitability score of the previous time window, higher than the wake-up suitability score of the subsequent time window, and is not lower than a preset trigger threshold, the time window is determined to be a local maximum value point, and the time window corresponding to the local maximum value point or the time window after the local maximum value point is selected as the wake-up trigger point; or, when the wake-up monitoring window is divided into different stages, in the later stage, when the wake-up suitability score of any time window is not lower than the preset trigger threshold, the current time window is selected as the wake-up trigger point; The wake-up output unit is a wake-up actuator or a wake-up command output unit that sends a wake-up command to an external device; the intelligent wake-up decision module (4) controls the wake-up output unit to output a wake-up stimulus or send a wake-up command at the wake-up trigger point; The data recording unit is a data storage device (5) used to store brain wave signals during sleep and / or the corresponding sleep state determination results; or the data recording unit is a data transmission unit used to transmit brain wave signals during sleep and / or the corresponding sleep state determination results to an external device for storage by the external device.
2. The device for analyzing sleep via electroencephalogram (EEG) and intelligently waking up according to claim 1, characterized in that: During the period when the intelligent wake-up decision module (4) controls the wake-up output unit to output wake-up stimuli, it controls the wake-up actuator to output wake-up stimuli in increments of intensity, while continuing to receive the brainwave frequency band characteristics output by the signal processing module (2). When it is determined that the user has entered a waking state based on the brainwave frequency band characteristics, the output of wake-up stimuli is stopped.
3. A device for analyzing sleep via electroencephalogram (EEG) and intelligently waking the patient according to claim 1 or 2, characterized in that: The sleep staging algorithm module (3) determines each time window as one of the following: wakefulness, sleep onset, light sleep, deep sleep, or REM sleep. The sleep staging algorithm module (3) also detects sleep spindle waves and K-complex waves in the EEG signal. The detection method for the spindle waves is to calculate the Hilbert envelope after the EEG signal is bandpass filtered from 11Hz to 16Hz. When the envelope amplitude exceeds the mean of the envelope plus K times the standard deviation of the time window and the duration is 0.5 seconds to 3 seconds, the spindle wave is detected. K is 1.2 to 2.
0. The detection method for the K-complex waves is to detect negative-positive biphasic waveforms with peak-to-peak values exceeding 50μV to 100μV and a duration of not less than 0.5 seconds. The sleep staging algorithm module (3) determines the sleep stage according to the hierarchical decision tree: when the relative power of Delta waves is not less than 20%, it is determined to be deep sleep; when the relative power of Delta waves is less than 20% and spindle waves or K complex waves are detected, it is determined to be light sleep; when spindle waves and K complex waves are not detected, and the relative power of Alpha waves or Beta waves exceeds the preset wakefulness threshold, it is determined to be wakefulness; when the relative power of Theta waves is dominant and the relative power of Delta waves is less than 10%, it is determined to be REM sleep; the rest are determined to be sleep onset. The sleep staging algorithm module (3) also performs majority voting smoothing on the judgment results of three consecutive time windows, and prohibits staging results that jump directly from the waking period to the deep sleep period or directly from the deep sleep period to the waking period.
4. The device for analyzing sleep via electroencephalogram (EEG) and intelligently waking the patient according to claim 1, characterized in that: The sleep depth factor is a factor with positive weights, consisting of the difference between 1 and the relative power of the Delta wave in the time window; the factor also includes a deep sleep adjustment term, which is a deep sleep penalty term with negative weights, and the deep sleep penalty term takes a non-zero value when the time window is determined to be a deep sleep period, or the deep sleep adjustment term is a non-deep sleep bonus term with positive weights, and the non-deep sleep bonus term takes a non-zero value when the time window is determined to be a non-deep sleep period; the factor also includes a positive weighted proximity between the current time and the target wake-up time, and a positive weighted discrimination term for whether the time window is the end point of the REM sleep period; the sleep staging algorithm module (3) also determines the REM sleep period in the sleep state; when the deep sleep adjustment term is the deep sleep penalty term, the calculation formula for the wake-up suitability score is: Score = W1 × (1 - R_delta) + W2 × Proximity(t, T_target) + W3 ×IsREMEnd - W4 × IsSWS Where R_delta is the relative power of the Delta wave in this time window, Proximity(t, T_target) is the proximity of the current time t to the target wake-up time T_target and takes a value of 0 to 1, IsREMEnd is 1 when the time window is the end of the REM phase and 0 otherwise, IsSWS is 1 when the time window is determined to be the deep sleep phase and 0 otherwise; W1, W2, W3, and W4 are all positive numbers, with W1 ranging from 0.3 to 0.5, W2 from 0.2 to 0.4, W3 from 0.1 to 0.3, and W4 from 0.4 to 0.6; the preset trigger threshold is 0.5 to 0.
8.
5. The device for analyzing sleep via electroencephalogram (EEG) and intelligently waking the patient according to claim 4, characterized in that: The intelligent wake-up decision module (4) divides the wake-up monitoring window into a first stage and a second stage. In the first stage, wake-up is triggered only when a local maximum of the wake-up suitability score is detected and the local maximum is not lower than the preset trigger threshold. In the second stage, wake-up is triggered when the wake-up suitability score of any time window is not lower than the preset trigger threshold. If no time window that meets the trigger condition appears until the end of the wake-up monitoring window, a wake-up stimulus is forcibly output or a wake-up command is sent at the end. The intelligent wake-up decision module (4) does not trigger wake-up when the time window is determined to be a rapid eye movement period and no rapid eye movement period is detected to have ended.
6. The device for analyzing sleep via electroencephalogram (EEG) and intelligently waking up according to claim 2, characterized in that: The wake-up actuator is at least one of a vibrator (6), a light-emitting device, or an audio generator. The vibrator (6) is a linear vibration motor (61), an eccentric rotor motor, or a piezoelectric vibrator. The intelligent wake-up decision module (4) controls the wake-up actuator to output wake-up stimuli in increments of strength. The intensity increase between two adjacent levels is 30% to 50% of the rated intensity. Each level lasts for 15 to 60 seconds. During the output, the module continues to receive the relative power of the Alpha wave output by the signal processing module (2). When the relative power of the Alpha wave exceeds the preset wake-up judgment value and lasts for 5 to 15 seconds, the output of the wake-up stimuli stops.
7. The device for analyzing sleep via electroencephalogram (EEG) and intelligently waking up according to claim 1, characterized in that: The electrode (11) is a dry electrode, which is a silver chloride-plated conductive rubber electrode, a stainless steel electrode, a conductive fabric electrode, a conductive silicone electrode, or a flexible printed electrode. The electrode (11) is set at the Fpz position of the international 10-20 system on the user's forehead, or at the Fp1, Fp2, AF7, AF8 positions, or at the user's ear canal, around the ear, earlobe, or behind the ear. The reference electrode is set at the A1 or A2 position behind the ear, the earlobe, the root of the nose, or together with the electrode (11) on the forehead. The electrode (11) is one and constitutes a single acquisition channel, or two or more and constitute two or more acquisition channels. When two or more acquisition channels are constituted, the signal processing module (2) calculates the relative power of each channel signal and then weights and fuses or selects the best one.
8. The device for analyzing sleep via electroencephalogram (EEG) and intelligently waking up according to claim 1, characterized in that: The analog front-end circuit includes an instrumentation amplifier (13), a high-pass filter (14), a secondary amplifier (15), a low-pass filter (16), and a notch filter (17) connected in sequence. The cutoff frequency of the high-pass filter (14) is 0.1 Hz to 1 Hz, the cutoff frequency of the low-pass filter (16) is 30 Hz to 45 Hz, the center frequency of the notch filter (17) is the power frequency, the total gain of the EEG frequency acquisition device (1) is 500 to 5000 times, the resolution of the analog-to-digital converter (18) is not less than 12 bits, and the sampling rate is 128 Hz to 512 Hz. An input protection circuit (12) is provided between the electrode (11) and the instrumentation amplifier (13). The input protection circuit (12) includes a current-limiting resistor connected in series in the signal path, a Schottky clamping diode connected between the signal path and the power rail, and a filter capacitor connected in parallel between the differential input terminals.
9. The device for analyzing sleep via electroencephalogram (EEG) and intelligently waking up according to claim 1, characterized in that: The preset duration is 20 to 60 seconds. The signal processing module (2) uses the Welch power spectrum estimation method to calculate the power of each frequency band. The number of FFT points corresponding to the window length is 1024 to 4096 points, and the overlap rate of adjacent windows is 25% to 75%. The Delta wave band is 0.5 Hz to 4 Hz, the Theta wave band is 4 Hz to 8 Hz, the Alpha wave band is 8 Hz to 13 Hz, and the Beta wave band is 13 Hz to 30 Hz.
10. The device for analyzing sleep via electroencephalogram (EEG) and intelligently waking up according to claim 1, characterized in that: The intelligent wake-up decision module (4) has a target wake-up time mode, a complete sleep cycle mode, and a minimum sleep duration guarantee mode. In the target wake-up time mode, the wake-up monitoring window includes a first time segment before the target wake-up time and a second time segment after the target wake-up time. The start point of the wake-up monitoring window is 20 to 40 minutes before the target wake-up time and the end point is 20 to 40 minutes after the target wake-up time. Wake-up is triggered when the wake-up suitability score of any time window within the wake-up monitoring window meets the preset trigger condition. If no time window meets the trigger condition until the end point of the wake-up monitoring window, a wake-up stimulus is forcibly output or a wake-up command is sent at the end point. In the complete sleep cycle mode, the intelligent wake-up decision module (4) counts the completed sleep cycles with the end point of each REM sleep cycle as the boundary of the sleep cycle, and opens the wake-up monitoring window after reaching the preset number of cycles. There is no forced wake-up time, and the sleep state is continuously monitored until the sleep state is detected to be transitioning to light sleep, sleep onset, or the REM sleep end feature is detected, triggering a wake-up output. In the minimum sleep duration guarantee mode, the wake-up monitoring window is opened. In the duration guarantee mode, the intelligent wake-up decision module (4) starts wake-up monitoring after the cumulative sleep duration reaches the preset minimum sleep duration, and does not set a forced wake-up cutoff time. It continuously monitors the sleep state until it detects that the sleep state has changed to light sleep, sleep onset, or detects the end of REM sleep, triggering the wake-up output. The signal processing module (2) calculates the signal quality index for each time window. When the proportion of sampling points with signal amplitude exceeding the preset saturation threshold in the time window exceeds the preset proportion, or the electrode contact impedance exceeds the preset impedance upper limit, the time window is marked as a pseudo-trace segment and placed side by side. In addition to determining the wake-up time, it also includes a Bluetooth module (7), which is bidirectionally electrically connected to the data recording unit and is used to upload the EEG signal and the sleep state determination result to the mobile terminal, and receive the target wake-up time and wake-up mode setting sent by the mobile terminal; it also includes a wearable device, which is a headband, eye mask, hat or ear hook, and the EEG frequency acquisition device (1), the signal processing module (2), the data recording unit and the unit for outputting wake-up stimuli or sending wake-up commands are all set on the wearable device.
