A Schumann wave sleep aid method and system based on EEG closed-loop control

By constructing a sleep stage classification model based on EEG closed-loop control, and using multi-class support vector machines and feature sequence annotation to generate Schumann wave target parameters, the shortcomings of existing sleep aid devices in personalized stimulation strategies are addressed, achieving a more efficient sleep regulation effect.

CN121754783BActive Publication Date: 2026-06-30BEIJING SHENMOU TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SHENMOU TECH CO LTD
Filing Date
2025-12-18
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing sleep aids are unable to automatically adjust the Schumann wave stimulation strategy according to the user's individual physiological fluctuations, resulting in insufficient targeting and stability of the regulatory effect, which may cause harm to the human body.

Method used

By collecting continuous EEG data from users, a sleep stage classification model is constructed using a multi-class support vector machine. Combined with bandpass filtering and power frequency notch preprocessing, feature sequences are extracted and labeled with sleep stage tags to generate a Schumann wave target parameter vector, thereby adjusting the output parameters of the Schumann wave generator.

Benefits of technology

It improves the accuracy of automatic sleep stage identification and the stability of overnight sleep structure assessment, reduces the impact of individual differences on stage accuracy, and ensures the targetedness and stability of Schumann wave stimulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121754783B_ABST
    Figure CN121754783B_ABST
Patent Text Reader

Abstract

This invention proposes a Schumann wave sleep aid method and system based on EEG closed-loop control, belonging to the technical field of sleep assistance and physiological signal processing. The method includes: acquiring continuous EEG data from the user; preprocessing first and second EEG data to obtain first and second calibration data, calculating feature sequences corresponding to the first and second calibration data, and labeling the sleep stage tags corresponding to the feature sequences to construct a sleep stage classification model; inputting the feature sequences corresponding to the second calibration data into the sleep stage classification model to obtain the sleep stage tags corresponding to the feature sequences; if the second calibration data meets switching constraints, updating the sleep stage tags and mapping the sleep stage tags to a Schumann wave target parameter vector; and generating Schumann wave modulation commands based on the Schumann wave target parameter vector to regulate the output parameters of the Schumann wave generator. This application helps improve the targeting and stability of the modulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of sleep aid and physiological signal processing technology, and in particular to a Schumann wave sleep aid method and system based on EEG closed-loop control. Background Technology

[0002] Most existing sleep aids are either standalone Schumann wave generators or simply acoustically guided devices. Wearable devices often rely on a single parameter (heart rate or body movement) for assessment. Some EEG-based sleep aids use stimulation to directly act on the human body instead of controlling the Schumann wave generator. This direct stimulation of the human body makes it difficult to guide the timing and intensity of physical stimulation, resulting in individual differences in user experience. This can easily lead to ineffective or excessive stimulation, potentially causing harm to the human body.

[0003] Chinese patent application CN120919533A discloses a transcranial electrical stimulation control method and system for regulating mental fatigue. The system includes an EEG acquisition and processing module and an electrical stimulation module, which wirelessly communicate to form a closed loop. The EEG acquisition and processing module acquires three-lead EEG signals from the prefrontal cortex. After preprocessing (FIR filtering to remove baseline drift and high-frequency interference, wavelet transform combined with Kalman filtering to remove eye movement artifacts), it classifies the state of mental fatigue using an onboard lightweight convolutional neural network (CNN) algorithm and generates control commands. The electrical stimulation module receives the commands and generates bipolar pulse width modulation transcranial direct current stimulation (tPWMDCs) current to stimulate the prefrontal cortex. However, the aforementioned prior art uses a fixed onboard CNN model to classify EEG, making it difficult to automatically adjust the discrimination and stimulation strategies according to the user's physiological fluctuations during long-term use, thus affecting the targetedness and stability of the intervention effect. Therefore, it is necessary to provide a Schumann wave sleep aid method and system based on EEG closed-loop control to improve the targetedness and stability of the regulation. Summary of the Invention

[0004] In view of this, the present invention proposes a Schumann wave sleep aid method and system based on EEG closed-loop control.

[0005] This invention provides a Schumann wave-based sleep aid method based on closed-loop EEG control, the method comprising:

[0006] Collect continuous EEG data from the user, wherein the continuous EEG data includes first EEG data and second EEG data;

[0007] The first EEG data and the second EEG data are preprocessed to obtain first calibration data and second calibration data respectively. The feature sequences corresponding to the first calibration data and the second calibration data are calculated, and the sleep stage labels corresponding to the feature sequences are labeled.

[0008] A sleep stage classification model is constructed based on a multi-class support vector machine, the feature sequence corresponding to the first calibration data, and the sleep stage label.

[0009] The feature sequence corresponding to the second calibration data is input into the sleep stage classification model to obtain the sleep stage label corresponding to the feature sequence. If the second calibration data satisfies the switching constraint condition, the sleep stage label is updated and the sleep stage label is mapped to the Schumann target parameter vector.

[0010] Schumann wave control commands are generated based on the Schumann wave target parameter vector to control the output parameters of the Schumann wave generator.

[0011] Based on the above technical solutions, preferably, the step of calculating the feature sequences corresponding to the first calibration data and the second calibration data, and labeling the sleep stage tags corresponding to the feature sequences, specifically includes:

[0012] The first EEG data and the second EEG data are respectively subjected to bandpass filtering and power frequency notch preprocessing to obtain the first calibration data and the second calibration data;

[0013] The first calibration data and the second calibration data are divided into multiple data segments. Power spectrum estimation is performed on each data segment of the first calibration data and the second calibration data to obtain feature sequences of multiple preset frequency bands in each data segment. The feature sequences include the power, relative power and ratio features of the preset frequency bands.

[0014] Based on the feature sequence and preset quantile corresponding to each data segment, an individualized threshold corresponding to the feature sequence is obtained, and each data segment is assigned a corresponding sleep state label according to the individualized threshold. The sleep stage label includes any one of the following: awake stage, fatigue stage, light sleep stage, and deep sleep stage.

[0015] Based on the above technical solutions, preferably, the method for determining the sleep stage tag includes:

[0016] When the relative power of the first preset frequency band of the first data segment is greater than or equal to the deep sleep power threshold, and the ratio of slow waves to fast waves is greater than or equal to the preset ratio threshold, the first data segment is marked as the deep sleep stage.

[0017] When the relative power of the second preset frequency band of the second data segment is greater than or equal to the light sleep power threshold, and the relative power of the first preset frequency band is lower than the deep sleep power threshold, the second data segment is marked as the light sleep stage.

[0018] When the relative power of the third preset frequency band of the third data segment is greater than or equal to the awake power threshold and the relative power ratio of the second preset frequency band to the third preset frequency band is less than the drowsy power threshold, the third data segment is marked as the awake stage.

[0019] All remaining data segments excluding the first data segment, the second data segment, and the third data segment are marked as fatigue stages, wherein the first preset frequency band is less than the second preset frequency band, and the second preset frequency band is less than the third preset frequency band.

[0020] More preferably, the step of updating the sleep stage labels and mapping the sleep stage labels to Schumann target parameter vectors specifically includes:

[0021] Input the feature sequence of each data segment in the second calibration data into the sleep stage classification model to obtain the sleep stage label corresponding to each data segment;

[0022] If a preset number of data segments are continuously detected to be marked with the same sleep stage label and the switching constraint condition is met, the current sleep stage will be updated to the sleep stage label of the corresponding data segment.

[0023] The current sleep stage is mapped to the corresponding Schumann wave target parameter vector, wherein the Schumann wave target parameter vector is used to characterize the target output parameters of the Schumann wave generator, and the target output parameters include output frequency, output amplitude and output envelope shape.

[0024] More preferably, the switching constraint conditions specifically include:

[0025] Within a continuous data segment, if the sleep stage classification results corresponding to the second calibration data are all the same target sleep stage, then the current sleep stage is switched to the target sleep stage.

[0026] If the target sleep stage is adjacent to the current sleep stage in the preset sleep stage sequence, then the current sleep stage is allowed to switch to the target sleep stage, wherein the sleep stage sequence is, in order, the waking stage, the fatigue stage, the light sleep stage, and the deep sleep stage.

[0027] More preferably, if the number of times the current sleep stage and the target sleep stage are switched exceeds a preset switching threshold within a preset time window, then switching from the current sleep stage to the target sleep stage is prohibited until the preset time window ends.

[0028] More preferably, the method further includes:

[0029] Based on the feature vectors and sleep stage labels corresponding to the second calibration data, a sleep state dataset is formed. Multiple sets of sleep state datasets of the second calibration data are integrated to form an integrated dataset.

[0030] Based on the integrated dataset, the individualized threshold of each feature vector in the integrated dataset is recalculated to obtain a set of individualized thresholds;

[0031] The sleep stage labels of each data segment in the integrated dataset are corrected based on the individualized threshold set to generate a calibrated integrated dataset, and the sleep stage classification model is retrained based on the calibrated integrated dataset.

[0032] A second aspect of this application provides a Schumann wave sleep aid system based on EEG closed-loop control, the Schumann wave sleep aid system comprising a data acquisition module, a data processing module, and a signal modulation module, wherein...

[0033] The data acquisition module is used to acquire continuous EEG data of the user, wherein the continuous EEG data includes first EEG data and second EEG data;

[0034] The data processing module is used to preprocess the first EEG data and the second EEG data to obtain first calibration data and second calibration data respectively, calculate the feature sequences corresponding to the first calibration data and the second calibration data, and label the sleep stage labels corresponding to the feature sequences. Based on the multi-class support vector machine, the feature sequences corresponding to the first calibration data and the sleep stage labels, a sleep stage classification model is constructed. The feature sequences corresponding to the second calibration data are input into the sleep stage classification model to obtain the sleep stage labels corresponding to the feature sequences. If the second calibration data meets the switching constraint conditions, the sleep stage labels are updated and the sleep stage labels are mapped to Schumann wave target parameter vectors.

[0035] The signal control module is used to generate Schumann wave control commands based on the Schumann wave target parameter vector, so as to control the output parameters of the Schumann wave generator.

[0036] A third aspect of this application provides an electronic device including a processor, a memory, a user interface, and a network interface, wherein the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory.

[0037] A fourth aspect of this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of a Schumann wave sleep aid method based on EEG closed-loop control.

[0038] The Schumann wave sleep aid method and system based on EEG closed-loop control provided by this invention has the following advantages over existing technologies:

[0039] (1) By preprocessing the first and second EEG data respectively, extracting feature sequences and labeling them, the original continuous EEG signals are transformed into a structured feature space, which is beneficial for filtering out artifacts and noise, improving the separability of features. Using a multi-class support vector machine to construct a sleep stage classification model, a better classification hyperplane can be obtained in the high-dimensional feature space. Compared with simple threshold or empirical rule staging, the automatic recognition accuracy of different sleep stages is improved. Furthermore, by first training the model with the first calibration data and then using the second calibration data for classification and correction, it can better adapt to the EEG characteristics of individual subjects and reduce the impact of individual differences on staging accuracy. When performing sleep staging using the second calibration data, a switching constraint is introduced to update and correct the sleep stage labels. This avoids frequent model jitter on boundary samples and reduces rapid back-and-forth switching that does not conform to physiological patterns. This temporal constraint makes the final sleep stage label sequence more consistent with the actual evolution of sleep structure, improving the stability and reliability of the overall sleep structure assessment. At the same time, the sleep stage labels corrected by the temporal constraint are mapped to the corresponding Schumann wave target parameter vectors, so that the output parameters of the Schumann wave generator correspond one-to-one with the current sleep stage. This is beneficial for applying more suitable electromagnetic environmental stimulation at appropriate sleep stages, thereby improving the targeting and stability of regulation.

[0040] (2) By performing bandpass filtering and power frequency notch filtering on the first and second EEG data respectively, noise components such as electromyography, eye movement, DC drift and power frequency interference are effectively filtered out, while retaining effective frequency band information closely related to sleep rhythm. Furthermore, the calibration data is divided into multiple data segments, and power spectrum estimation is performed on each data segment to extract the power, relative power and ratio characteristics of multiple preset frequency bands. This can comprehensively reflect the energy distribution and relative relationship of EEG activity in different frequency bands, enhance the difference in EEG characteristics between different sleep stages, and help to finely distinguish between states such as wakefulness, fatigue, light sleep and deep sleep. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 A flowchart illustrating a Schumann wave sleep aid method based on EEG closed-loop control provided by the present invention;

[0043] Figure 2 Schematic diagram of the Helmholtz coil in the sleep aid device provided by the present invention

[0044] Figure 3 This is a schematic diagram of the structure of the Schumann wave sleep aid system provided by the present invention;

[0045] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention.

[0046] Explanation of reference numerals in the attached diagram: 1. Schumann Wave Sleep Aid System; 11. Data Acquisition Module; 12. Data Processing Module; 13. Signal Control Module; 2. Electronic Equipment; 21. Processor; 22. Communication Bus; 23. User Interface; 24. Network Interface; 25. Memory. Detailed Implementation

[0047] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0048] This invention discloses a Schumann wave sleep aid method based on EEG closed-loop control, with reference to... Figure 1 and Figure 2 The steps of this method include S1 to S5.

[0049] Step S1: Collect continuous EEG data from the user, including first EEG data and second EEG data. The first EEG data represents the EEG data collected when the user used the sleep aid device on the first day.

[0050] In this step, the EEG acquisition device can be a head-mounted or ear-worn wearable sleep aid device. After the user puts on the sleep aid device and prepares to fall asleep, the EEG acquisition program is activated to continuously collect the user's EEG signals throughout the sleep process, obtaining continuous EEG data. The first EEG data represents the continuous EEG data collected when the user uses the sleep aid device on the first day. The first EEG data typically spans the entire process from the user getting into bed to naturally waking up, and is used to build an individualized sleep stage recognition model and threshold parameters. The second EEG data represents the continuous EEG data collected when the user uses the sleep aid device after the first day, and is used to perform sleep stage discrimination and Schumann wave output control based on the existing model.

[0051] The coil / generator head of the sleep aid device is preferably placed near the subject's head at the head of the bed, approximately 20–50 cm away, just enough to cover the upper part of the skull; alternatively, it can be placed under the pillow or on the upper surface of the mattress directly facing the head. In this embodiment, the fundamental component of the Schumann wave is generated by a sinusoidal signal of a fixed frequency. To ensure a slow, rhythmic change in output intensity, a low-frequency envelope function is superimposed on its outer layer. The normal direction of the coil (the principal direction of the magnetic field) faces the head to facilitate field coupling. Large metal headboards should be avoided as much as possible to prevent field weakening. The coil / generator head is placed in a fixed plate / cover to ensure its position remains unchanged each night.

[0052] Step S2: Preprocess the first EEG data and the second EEG data to obtain the first calibration data and the second calibration data respectively, calculate the feature sequences corresponding to the first calibration data and the second calibration data, and label the sleep stage labels corresponding to the feature sequences.

[0053] This step also includes steps S21 to S23.

[0054] Step S21: Bandpass filtering and power frequency notch preprocessing are performed on the first EEG data and the second EEG data respectively to obtain the first calibration data and the second calibration data.

[0055] In this step, single / dual-channel EEG data from the forehead or ear clip are sampled at a rate ≥250 Hz, passed through a 0.5–45 Hz bandpass filter and a power frequency notch filter, and then sent to the processor. Continuous EEG data is segmented into 20-second segments with a sliding window length of 10 seconds, and each adjacent sliding window overlaps by 50%. The Welch method is used to calculate the power spectrum of each data segment. The time-domain signal of each data segment is denoted as , ,in .

[0056] Assuming a sleep duration of 8 hours, add a length of [unclear] to each 20-second signal segment. Window functions (such as the Hamming window):

[0057]

[0058] in, Indicates the first A windowed signal sequence of data segments, Represents the sequence values ​​of the window function.

[0059] Calculate the Fourier transform (FFT) of the windowed signal sequence and obtain the power spectral density:

[0060]

[0061] in, This represents the energy normalization coefficient of the window function. For the first Each frequency point, Indicates the first The first data segment The power spectral density corresponding to each frequency point, and the corresponding frequency resolution, can be expressed as:

[0062]

[0063] Step S22: Divide the first calibration data and the second calibration data into multiple data segments respectively, perform power spectrum estimation on each data segment of the first calibration data and the second calibration data, and obtain feature sequences of multiple preset frequency bands in each data segment. The feature sequences include the power, relative power and ratio features of the preset frequency bands.

[0064] In this step, the preset frequency band includes the first preset frequency band. Second preset frequency band Third preset frequency band Fourth preset frequency band and the fifth preset frequency band First preset frequency band δ The frequency range is 0.5~4Hz, the second preset frequency band The frequency range is 4~7Hz, the third preset frequency band The frequency range is 8~12Hz, the fourth preset frequency band The frequency range is 12~16Hz, the fifth preset frequency band The frequency range is 16~30Hz.

[0065] Then the first Data segments in any frequency band The power on is:

[0066]

[0067] in, Indicates frequency resolution. Indicates the first The first data segment The power spectral density corresponding to each frequency point.

[0068] Therefore, for the first The data segments are:

[0069]

[0070]

[0071]

[0072]

[0073]

[0074] in, Indicates the first Each data segment is in the first preset frequency band brainwave power, Indicates the first Each data segment is in the second preset frequency band brainwave power, Indicates the first The data segment is in the third preset frequency band. brainwave power, Indicates the first The data segment is in the fourth preset frequency band. brainwave power, Indicates the first The data segment is in the fifth preset frequency band. The brainwave power.

[0075] No. The total power of each data segment can be expressed as:

[0076]

[0077] Furthermore, the first preset frequency band The relative power can be expressed as:

[0078]

[0079] Second preset frequency band The relative power can be expressed as:

[0080]

[0081] Third preset frequency band The relative power can be expressed as:

[0082]

[0083] The drowsiness sensitivity ratio can be expressed as:

[0084]

[0085] The slow / fast wave ratio can be expressed as:

[0086]

[0087] in, To prevent division by zero, the smaller the slow / fast wave ratio, the more awake a person is; the smaller the drowsiness sensitivity ratio, the lighter the sleep. (First preset frequency band) The lower the relative power, the shallower the sleep; second preset frequency band The lower the relative power, the shallower the sleep; third preset frequency band The lower the relative power, the more sleepy a person feels.

[0088] Step S23: Based on the feature sequence and preset quantile corresponding to each data segment, obtain the individualized threshold corresponding to the feature sequence, and assign a corresponding sleep state label to each data segment according to the individualized threshold. The sleep stage label includes any one of the following: awake stage, fatigue stage, light sleep stage, and deep sleep stage.

[0089] In this step, for the segmented Data segments ( The relative power, drowsiness sensitivity ratio, and slow / fast wave ratio of each of the aforementioned preset frequency bands can be used to obtain this. K The ratio of data segments:

[0090]

[0091]

[0092]

[0093]

[0094]

[0095]

[0096] in, Indicates the first The first preset frequency band of each data segment Percentage sequence, Indicates the first The second preset frequency band of each data segment Percentage sequence, Indicates the first The third preset frequency band of each data segment Percentage sequence, Indicates the first The fifth preset frequency band of each data segment Percentage sequence, Indicates the first The sequence of the proportion of drowsiness sensitivity ratios for each data segment. Indicates the first The sequence of slow / fast wave ratios for each data segment.

[0097] Furthermore, the methods for determining sleep stage labels include:

[0098] When the relative power of the first preset frequency band of the first data segment is greater than or equal to the deep sleep power threshold, and the ratio of slow waves to fast waves is greater than or equal to the preset ratio threshold, the first data segment is marked as the deep sleep stage.

[0099] When the relative power of the second preset frequency band of the second data segment is greater than or equal to the light sleep power threshold, and the relative power of the first preset frequency band is lower than the deep sleep power threshold, the second data segment is marked as the light sleep stage.

[0100] When the relative power of the third preset frequency band of the third data segment is greater than or equal to the awake power threshold and the relative power ratio of the second preset frequency band to the third preset frequency band is less than the drowsy power threshold, the third data segment is marked as the awake stage.

[0101] All remaining data segments excluding the first, second, and third data segments are marked as fatigue stages, wherein the first preset frequency band is less than the second preset frequency band, and the second preset frequency band is less than the third preset frequency band.

[0102] In one example, for this K For each indicator in each data segment, calculate the quantile. The quantile can be expressed as... After sorting the quantiles, it can be represented as:

[0103]

[0104] That" p quantiles ) is defined as the first digit after sorting. Number:

[0105]

[0106] The deep sleep power threshold can be expressed as:

[0107]

[0108] The sobriety power threshold can be expressed as:

[0109]

[0110] The light sleep power threshold can be expressed as:

[0111]

[0112] The drowsiness power threshold can be expressed as:

[0113]

[0114] The slow / fast contrast threshold used for deep sleep can be expressed as:

[0115]

[0116] in, This indicates that the first night is on the first preset frequency band. The deep sleep power threshold is obtained from the 75th percentile of the percentage sequence. This indicates that the first night will be on the third preset frequency band. The 70th percentile of the percentage sequence yields the threshold for awake power. This indicates that the first night will be on the second preset frequency band. The light sleep power threshold is obtained from the 60th percentile of the percentage sequence. This represents the drowsiness power threshold obtained from the 50th percentile of the drowsiness sensitivity ratio sequence on the first night. This represents the slow / fast contrast threshold used for deep sleep, obtained from the 70th percentile of the slow / fast wave ratio sequence on the first night.

[0117] Label each data segment from the first night according to the following rules. :

[0118]

[0119] In this embodiment, by applying bandpass filtering and power frequency notch filtering to the first and second EEG data respectively, noise components such as electromyography, eye movement, DC drift, and power frequency interference are effectively filtered out, while retaining effective frequency band information closely related to sleep rhythm. Furthermore, the calibration data is divided into multiple data segments, and power spectrum estimation is performed on each segment to extract power, relative power, and ratio features of multiple preset frequency bands. This comprehensively reflects the energy distribution and relative relationships of EEG activity in different frequency bands, enhancing the differences in EEG characteristics between different sleep stages and facilitating precise differentiation between states such as wakefulness, fatigue, light sleep, and deep sleep. Dividing continuous EEG data into multiple data segments and independently extracting power spectrum features for each segment allows the system to observe and distinguish EEG states on a shorter timescale. Individualized thresholds are calculated using the feature sequences corresponding to each data segment and preset quantiles. Different sleep stages are divided based on the individual's own characteristic distribution, rather than using fixed empirical thresholds. This automatically adapts to the differences in EEG amplitude range and frequency band distribution among different individuals, effectively reducing the impact of individual differences on the accuracy of sleep stage determination.

[0120] Step S3: Construct a sleep stage classification model based on the multi-class support vector machine, the feature sequence corresponding to the first calibration data, and the sleep stage labels.

[0121] In this step, for each data segment Construct feature sequences:

[0122]

[0123] The training set can be represented as:

[0124]

[0125] A sleep stage classification model is obtained using a multi-class support vector machine:

[0126]

[0127] in, This represents the training data generated on the first night. This represents a sleep stage classification model. c Indicates the candidate sleep stage category, This represents the value estimated by the classification model, given the features. Under the condition that the sample belongs to the category c The probability of.

[0128] Step S4: Input the feature sequence corresponding to the second calibration data into the sleep stage classification model to obtain the sleep stage label corresponding to the feature sequence. If the second calibration data meets the switching constraint condition, update the sleep stage label and map the sleep stage label to the Schumann target parameter vector.

[0129] This step also includes steps S41 to S43.

[0130] Step S41: Input the feature sequence of each data segment in the second calibration data into the sleep stage classification model to obtain the sleep stage label corresponding to each data segment.

[0131] Step S42: If a preset number of data segments are continuously detected to be marked with the same sleep stage label and the switching constraint condition is met, then the current sleep stage is updated to the sleep stage label of the corresponding data segment.

[0132] In this step, the constraints are switched, specifically including:

[0133] If, within a continuous data segment, the sleep stage classification results corresponding to the second calibration data are all the same target sleep stage, then the current sleep stage will be switched to the target sleep stage.

[0134] If the target sleep stage is adjacent to the current sleep stage in the preset sleep stage sequence, the current sleep stage is allowed to switch to the target sleep stage. The sleep stage sequence is as follows: wakefulness stage, fatigue stage, light sleep stage, and deep sleep stage.

[0135] If the number of times the current sleep stage and the target sleep stage are switched exceeds the preset switching threshold within the preset time window, switching from the current sleep stage to the target sleep stage will be prohibited until the preset time window ends.

[0136] Furthermore, to avoid abrupt changes in the Schumann wave generator, sleep state switching only occurs after 10 consecutive data segments are detected in the same state, and modulation can only proceed from an adjacent state. For example, the frequency can only be tuned from a fatigued state to a conscious / light sleep state, not directly to a deep sleep state. Additionally, the system monitors for reverse transitions or signal quality abnormalities in the EEG data stages (such as a sudden increase in the proportion of the conscious segment or a sudden increase in power across the entire frequency band). If an abnormality occurs, the output is automatically reduced to a safe threshold, and the output is restored according to a gradual restart curve once the EEG data stabilizes.

[0137] Step S43: Map the current sleep stage to the corresponding Schumann wave target parameter vector, wherein the Schumann wave target parameter vector is used to characterize the target output parameters of the Schumann wave generator, and the target output parameters include the output frequency, output amplitude and output envelope shape.

[0138] In this step, the previously trained sleep stage classification model is used for classification:

[0139]

[0140] in, Indicates the first t Evening j Predicted sleep stage labels from segment data Indicates the first t Evening j Feature vectors of segment data Indicates by the first t The sleep stage classification model obtained from training for -1 night will Mapped to Schumann wave control quantity:

[0141] Specify a set of target parameters for each state .

[0142] in, This indicates the fundamental frequency (Earth's Schumann fundamental frequency), which is 7.83 Hz; Indicates the output amplitude. Indicates the first t Late-to-mid-slow envelope function; This represents the actual output time proportion within a complete envelope / control cycle, with a value between 0 and 1. It represents the envelope period and imposes a 30-60s slow start / slow end and unit time change rate constraint on amplitude changes.

[0143] When a certain state is detected Then, this set of parameters is retrieved. Generate the actual output according to the formula:

[0144]

[0145] in, Indicates by duty cycle The generated gating function:

[0146]

[0147] Step S5: Generate Schumann wave control commands based on the Schumann wave target parameter vector to control the output parameters of the Schumann wave generator.

[0148] In this step, sleep is induced with a slow rhythm while the person is awake (W). The fundamental frequency of the awake state... Amplitude of the waking state (At a low level), the envelope is a slow sinusoidal envelope, which can be represented as:

[0149]

[0150] in, Indicates the first t Envelope function during the late-night waking state, envelope period during the waking state. Duty cycle in the waking state The output in a conscious state can be represented as:

[0151] .

[0152] In a state of fatigue (T), the rhythm is made smoother and slightly stronger. The fundamental frequency of the fatigued state. The amplitude of fatigue state (Slightly higher than sobriety), the envelope is changed to a slower, flatter sinusoidal envelope, which can be expressed as:

[0153]

[0154] in, Indicates the first t The envelope function under the state of fatigue in the evening is taken as the minimum value. Take the maximum value of the envelope function. Take the envelope period under fatigue state. Then the envelope can be represented as:

[0155] .

[0156] In a fatigued state, the envelope period simply oscillates between 0.6 and 1.0, unlike the oscillation between 0 and 1 in a conscious state. Duty cycle in fatigue state The output in a conscious state can be represented as:

[0157] .

[0158] In light sleep (LS), a slow rhythm can guide you to sleep. The fundamental frequency of light sleep. Amplitude of light sleep state The envelope can be set to a constant 1 or a very gentle envelope, and its envelope can be expressed as:

[0159]

[0160] in, Indicates the first t Envelope function during light sleep in the middle of the night, and duty cycle during light sleep. The output during light sleep can be represented as:

[0161] .

[0162] In deep sleep (DS), a slow rhythm guides you to sleep. The fundamental frequency of deep sleep. Amplitude of deep sleep ,in Slightly lower than light sleep, the envelope can be set to a constant of 1 or an ultra-slowly varying envelope, which can be expressed as:

[0163]

[0164] in, Indicates the first t Envelope function during late-mid sleep, duty cycle during deep sleep. The output during deep sleep can be represented as:

[0165] .

[0166] In one example, a sleep state dataset is formed based on the feature vectors and sleep stage labels corresponding to the second calibration data. Multiple sets of sleep state datasets of the second calibration data are integrated to form an integrated dataset. The individualized thresholds of each feature vector in the integrated dataset are recalculated based on the integrated dataset to obtain an individualized threshold set. The sleep stage labels of each data segment in the integrated dataset are corrected based on the individualized threshold set to generate a calibrated integrated dataset. The sleep stage classification model is then retrained based on the calibrated integrated dataset.

[0167] Will Save to the t Late Data Concentration The most recent 3 nights' data are merged, and the integrated dataset can be represented as:

[0168]

[0169] like t =2 means In integrating datasets The quantiles of each ratio are recalculated to obtain a new set of individualized thresholds:

[0170]

[0171] For individualized threshold sets Update sleep stage labels and use integrated datasets. Retrain the sleep stage classification model to obtain the first... t Late sleep stage classification model , used for the Late sleep stage label prediction.

[0172] In this embodiment, by preprocessing the first and second EEG data respectively, extracting feature sequences and labeling them, the original continuous EEG signals are transformed into a structured feature space, which is beneficial for filtering out artifacts and noise, improving the separability of features. A sleep stage classification model is constructed using a multi-class support vector machine, which can obtain a better classification hyperplane in the high-dimensional feature space. Compared with simple threshold or empirical rule staging, it improves the automatic identification accuracy of different sleep stages. Furthermore, by first training the model with the first calibration data and then using the second calibration data for classification and correction, it can better adapt to the EEG characteristics of individual subjects and reduce the impact of individual differences on the staging accuracy. When performing sleep staging on the second calibration data, a switching constraint condition is introduced to update and correct the sleep stage labels, which can avoid frequent model jitter on boundary samples and reduce rapid back-and-forth switching that does not conform to physiological laws. This temporal constraint makes the final sleep stage label sequence more consistent with the actual sleep structure evolution law, improving the stability and reliability of the whole night sleep structure assessment. Simultaneously, the sleep stage labels, after time-constrained correction, are mapped to corresponding Schumann wave target parameter vectors, ensuring a one-to-one correspondence between the output parameters of the Schumann wave generator and the current sleep stage. This facilitates the application of more suitable electromagnetic environmental stimulation at appropriate sleep stages, thereby improving the targeting and stability of the modulation. Furthermore, the sleep stage classification model and subsequent parameter mapping can be trained and updated based on the EEG characteristics of different individuals, enabling individualized Schumann wave parameter settings for different populations.

[0173] Based on the above method, this application discloses a Schumann wave sleep aid system based on EEG closed-loop control, referencing... Figure 3 The Schumann wave sleep aid system 1 includes a data acquisition module 11, a data processing module 12, and a signal control module 13, wherein...

[0174] The data acquisition module 11 is used to acquire continuous EEG data of the user, wherein the continuous EEG data includes first EEG data and second EEG data;

[0175] The data processing module 12 is used to preprocess the first EEG data and the second EEG data to obtain the first calibration data and the second calibration data respectively, calculate the feature sequences corresponding to the first calibration data and the second calibration data, and label the sleep stage labels corresponding to the feature sequences. Based on the multi-class support vector machine, the feature sequences corresponding to the first calibration data and the sleep stage labels, a sleep stage classification model is constructed. The feature sequences corresponding to the second calibration data are input into the sleep stage classification model to obtain the sleep stage labels corresponding to the feature sequences. If the second calibration data meets the switching constraint conditions, the sleep stage labels are updated and the sleep stage labels are mapped to the Schumann wave target parameter vector.

[0176] The signal control module 13 is used to generate Schumann wave control commands based on the Schumann wave target parameter vector in order to control the output parameters of the Schumann wave generator.

[0177] In one example, the data processing module 12 performs bandpass filtering and power frequency notch preprocessing on the first EEG data and the second EEG data respectively to obtain the first calibration data and the second calibration data; divides the first calibration data and the second calibration data into multiple data segments, performs power spectrum estimation on each data segment, and obtains feature sequences of multiple preset frequency bands in each data segment, wherein the feature sequences include the power, relative power, and ratio features of the preset frequency bands; based on the feature sequences and preset quantiles corresponding to each data segment, obtains the individualized threshold corresponding to the feature sequences, and assigns a corresponding sleep state label to each data segment according to the individualized threshold, wherein the sleep stage label includes any one of the following: awake stage, fatigue stage, light sleep stage, and deep sleep stage.

[0178] In one example, the method for determining sleep stage labels includes:

[0179] When the relative power of the first preset frequency band of the first data segment is greater than or equal to the deep sleep power threshold, and the ratio of slow waves to fast waves is greater than or equal to the preset ratio threshold, the first data segment is marked as the deep sleep stage.

[0180] When the relative power of the second preset frequency band of the second data segment is greater than or equal to the light sleep power threshold, and the relative power of the first preset frequency band is lower than the deep sleep power threshold, the second data segment is marked as the light sleep stage.

[0181] When the relative power of the third preset frequency band of the third data segment is greater than or equal to the awake power threshold and the relative power ratio of the second preset frequency band to the third preset frequency band is less than the drowsy power threshold, the third data segment is marked as the awake stage.

[0182] All remaining data segments excluding the first, second, and third data segments are marked as fatigue stages, wherein the first preset frequency band is less than the second preset frequency band, and the second preset frequency band is less than the third preset frequency band.

[0183] In one example, the data processing module 12 is used to input the feature sequence of each data segment in the second calibration data into the sleep stage classification model to obtain the sleep stage label corresponding to each data segment; if a preset number of data segments are continuously detected to be labeled with the same sleep stage label and the switching constraint condition is met, the current sleep stage is updated to the sleep stage label of the corresponding data segment; the current sleep stage is mapped to the corresponding Schumann wave target parameter vector, wherein the Schumann wave target parameter vector is used to characterize the target output parameters of the Schumann wave generator, and the target output parameters include the output frequency, output amplitude and output envelope shape.

[0184] In one example, switching constraints specifically includes:

[0185] Within a continuous data segment, if the sleep stage classification results corresponding to the second calibration data are all the same target sleep stage, then the current sleep stage will be switched to the target sleep stage.

[0186] If the target sleep stage is adjacent to the current sleep stage in the preset sleep stage sequence, the current sleep stage is allowed to switch to the target sleep stage. The sleep stage sequence is as follows: wakefulness stage, fatigue stage, light sleep stage, and deep sleep stage.

[0187] In one example, if the number of times the current sleep stage and the target sleep stage are switched exceeds a preset switching threshold within a preset time window, switching from the current sleep stage to the target sleep stage is prohibited until the preset time window ends.

[0188] In one example, the method also includes:

[0189] Based on the feature vectors and sleep stage labels corresponding to the second calibration data, a sleep state dataset is formed. Multiple sets of sleep state datasets of the second calibration data are integrated to form an integrated dataset.

[0190] Based on the integrated dataset, the individualized thresholds of each feature vector in the integrated dataset are recalculated to obtain a set of individualized thresholds;

[0191] The sleep stage labels of each data segment in the integrated dataset are corrected based on the individualized threshold set to generate a calibrated integrated dataset, and the sleep stage classification model is retrained based on the calibrated integrated dataset.

[0192] Please see Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 2 may include: at least one processor 21, at least one network interface 24, user interface 23, memory 25, and at least one communication bus 22.

[0193] The communication bus 22 is used to enable communication between these components.

[0194] The user interface 23 may include a display screen and a camera. Optionally, the user interface 23 may also include a standard wired interface and a wireless interface.

[0195] The network interface 24 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0196] The processor 21 may include one or more processing cores. The processor 21 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 25, and by calling data stored in the memory 25. Optionally, the processor 21 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the processor 21.

[0197] The memory 25 may include random access memory (RAM) or read-only memory. Optionally, the memory 25 may include non-transitory computer-readable storage medium. The memory 25 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 25 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 25 may also be at least one storage device located remotely from the aforementioned processor 21. Figure 4 As shown, the memory 25, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for a Schumann wave sleep aid method based on EEG closed-loop control.

[0198] exist Figure 4 In the electronic device 2 shown, the user interface 23 is mainly used to provide an input interface for the user and to obtain the user input data; while the processor 21 can be used to call an application program stored in the memory 25 that is a Schumann wave sleep aid method based on EEG closed-loop control. When executed by one or more processors, the electronic device performs one or more methods as described in the above embodiments.

[0199] A computer-readable storage medium storing instructions that, when executed by one or more processors, cause a computer to perform one or more methods as described in the above embodiments.

[0200] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0201] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0202] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the shown or discussed mutual couplings or direct couplings or communication connections may be through some service interfaces; indirect couplings or communication connections between apparatuses or units may be electrical or other forms.

[0203] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0204] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0205] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0206] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A Schumann wave-based sleep aid method based on closed-loop EEG control, characterized in that, The method includes: Collect continuous EEG data from the user, wherein the continuous EEG data includes first EEG data and second EEG data; The first EEG data and the second EEG data are preprocessed to obtain first calibration data and second calibration data respectively. The feature sequences corresponding to the first calibration data and the second calibration data are calculated, and the sleep stage labels corresponding to the feature sequences are labeled. The step of calculating the feature sequences corresponding to the first calibration data and the second calibration data, and labeling the sleep stage tags corresponding to the feature sequences, specifically includes: The first EEG data and the second EEG data are respectively subjected to bandpass filtering and power frequency notch preprocessing to obtain the first calibration data and the second calibration data; The first calibration data and the second calibration data are divided into multiple data segments. Power spectrum estimation is performed on each data segment of the first calibration data and the second calibration data to obtain feature sequences of multiple preset frequency bands in each data segment. The feature sequences include the power, relative power and ratio features of the preset frequency bands. Based on the feature sequence and preset quantile corresponding to each data segment, an individualized threshold corresponding to the feature sequence is obtained, and each data segment is assigned a corresponding sleep state label according to the individualized threshold. The sleep stage label includes any one of the following: wakefulness stage, fatigue stage, light sleep stage, and deep sleep stage. A sleep stage classification model is constructed based on a multi-class support vector machine, the feature sequence corresponding to the first calibration data, and the sleep stage label. The feature sequence corresponding to the second calibration data is input into the sleep stage classification model to obtain the sleep stage label corresponding to the feature sequence. If the second calibration data satisfies the switching constraint condition, the sleep stage label is updated and the sleep stage label is mapped to the Schumann target parameter vector. The step of updating the sleep stage labels and mapping the sleep stage labels to Schumann target parameter vectors specifically includes: Input the feature sequence of each data segment in the second calibration data into the sleep stage classification model to obtain the sleep stage label corresponding to each data segment; If a preset number of data segments are continuously detected to be marked with the same sleep stage label and the switching constraint condition is met, the current sleep stage will be updated to the sleep stage label of the corresponding data segment. The current sleep stage is mapped to the corresponding Schumann wave target parameter vector, wherein the Schumann wave target parameter vector is used to characterize the target output parameters of the Schumann wave generator, and the target output parameters include output frequency, output amplitude and output envelope shape; The switching constraints specifically include: Within a continuous data segment, if the sleep stage classification results corresponding to the second calibration data are all the same target sleep stage, then the current sleep stage is switched to the target sleep stage. If the target sleep stage is adjacent to the current sleep stage in the preset sleep stage sequence, then the current sleep stage is allowed to switch to the target sleep stage, wherein the sleep stage sequence is, in order, the waking stage, the fatigue stage, the light sleep stage, and the deep sleep stage. Schumann wave control commands are generated based on the Schumann wave target parameter vector to control the output parameters of the Schumann wave generator.

2. The Schumann wave sleep aid method based on EEG closed-loop control as described in claim 1, characterized in that, The method for determining the sleep stage label includes: When the relative power of the first preset frequency band of the first data segment is greater than or equal to the deep sleep power threshold, and the ratio of slow waves to fast waves is greater than or equal to the preset ratio threshold, the first data segment is marked as the deep sleep stage. When the relative power of the second preset frequency band of the second data segment is greater than or equal to the light sleep power threshold, and the relative power of the first preset frequency band is lower than the deep sleep power threshold, the second data segment is marked as the light sleep stage. When the relative power of the third preset frequency band of the third data segment is greater than or equal to the awake power threshold and the relative power ratio of the second preset frequency band to the third preset frequency band is less than the drowsy power threshold, the third data segment is marked as the awake stage. All remaining data segments excluding the first data segment, the second data segment, and the third data segment are marked as fatigue stages, wherein the first preset frequency band is less than the second preset frequency band, and the second preset frequency band is less than the third preset frequency band.

3. The Schumann wave sleep aid method based on EEG closed-loop control as described in claim 1, characterized in that, If, within a preset time window, the number of times the current sleep stage is switched to the target sleep stage exceeds a preset switching threshold, then switching from the current sleep stage to the target sleep stage is prohibited until the preset time window ends.

4. The Schumann wave sleep aid method based on EEG closed-loop control as described in claim 1, characterized in that, The method further includes: Based on the feature vectors and sleep stage labels corresponding to the second calibration data, a sleep state dataset is formed. Multiple sets of sleep state datasets of the second calibration data are integrated to form an integrated dataset. Based on the integrated dataset, the individualized threshold of each feature vector in the integrated dataset is recalculated to obtain a set of individualized thresholds; The sleep stage labels of each data segment in the integrated dataset are corrected based on the individualized threshold set to generate a calibrated integrated dataset, and the sleep stage classification model is retrained based on the calibrated integrated dataset.

5. A Schumann wave sleep aid system based on EEG closed-loop control, characterized in that, The Schumann wave sleep aid system (1) includes a data acquisition module (11), a data processing module (12), and a signal control module (13), wherein, The data acquisition module (11) is used to acquire continuous EEG data of the user, wherein the continuous EEG data includes first EEG data and second EEG data; The data processing module (12) is used to preprocess the first EEG data and the second EEG data to obtain the first calibration data and the second calibration data respectively, calculate the feature sequences corresponding to the first calibration data and the second calibration data, and label the sleep stage labels corresponding to the feature sequences. Based on the multi-class support vector machine, the feature sequences corresponding to the first calibration data and the sleep stage labels, a sleep stage classification model is constructed. The feature sequences corresponding to the second calibration data are input into the sleep stage classification model to obtain the sleep stage labels corresponding to the feature sequences. If the second calibration data meets the switching constraint conditions, the sleep stage labels are updated and the sleep stage labels are mapped to the Schumann wave target parameter vector. The step of calculating the feature sequences corresponding to the first calibration data and the second calibration data, and labeling the sleep stage tags corresponding to the feature sequences, specifically includes: The first EEG data and the second EEG data are respectively subjected to bandpass filtering and power frequency notch preprocessing to obtain the first calibration data and the second calibration data; The first calibration data and the second calibration data are divided into multiple data segments. Power spectrum estimation is performed on each data segment of the first calibration data and the second calibration data to obtain feature sequences of multiple preset frequency bands in each data segment. The feature sequences include the power, relative power and ratio features of the preset frequency bands. Based on the feature sequence and preset quantile corresponding to each data segment, an individualized threshold corresponding to the feature sequence is obtained, and each data segment is assigned a corresponding sleep state label according to the individualized threshold. The sleep stage label includes any one of the following: wakefulness stage, fatigue stage, light sleep stage, and deep sleep stage. The step of updating the sleep stage labels and mapping the sleep stage labels to Schumann target parameter vectors specifically includes: Input the feature sequence of each data segment in the second calibration data into the sleep stage classification model to obtain the sleep stage label corresponding to each data segment; If a preset number of data segments are continuously detected to be marked with the same sleep stage label and the switching constraint condition is met, the current sleep stage will be updated to the sleep stage label of the corresponding data segment. The current sleep stage is mapped to the corresponding Schumann wave target parameter vector, wherein the Schumann wave target parameter vector is used to characterize the target output parameters of the Schumann wave generator, and the target output parameters include output frequency, output amplitude and output envelope shape; The switching constraints specifically include: Within a continuous data segment, if the sleep stage classification results corresponding to the second calibration data are all the same target sleep stage, then the current sleep stage is switched to the target sleep stage. If the target sleep stage is adjacent to the current sleep stage in the preset sleep stage sequence, then the current sleep stage is allowed to switch to the target sleep stage, wherein the sleep stage sequence is, in order, the waking stage, the fatigue stage, the light sleep stage, and the deep sleep stage. The signal control module (13) is used to generate Schumann wave control commands based on the Schumann wave target parameter vector in order to control the output parameters of the Schumann wave generator.

6. An electronic device, characterized in that, The device includes a processor (21), a memory (25), a user interface (23), and a network interface (24). The memory (25) is used to store instructions. The user interface (23) and the network interface (24) are used to communicate with other devices. The processor (21) is used to execute the instructions stored in the memory (25) to cause the electronic device (2) to perform the method as described in any one of claims 1-4.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1-4.