A non-invasive method and system for monitoring user sleep quality
By combining feature analysis, parameter optimization, and phase synchronization modules with dual-loop feedback, an intelligent sleep quality monitoring system is constructed. This solves the problems of existing technologies failing to deeply analyze EEG signals and neglecting individual physiological characteristics, and achieves personalized sleep quality improvement and continuous monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MAIJING (HANGZHOU) HEALTH MANAGEMENT CO LTD
- Filing Date
- 2026-04-15
- Publication Date
- 2026-06-16
AI Technical Summary
Existing sleep quality monitoring systems fail to delve into the spatiotemporal characteristics of EEG signals, neglect individual physiological characteristics, resulting in improper stimulation parameter settings, affecting stimulation effects, and lacking effective feedback mechanisms, thus failing to continuously improve users' sleep quality.
The feature parsing module extracts the spatiotemporal features of the EEG signal, generates a feature vector set through a graph neural network, calculates the stimulation parameter set in combination with the parameter optimization module, optimizes the stimulation signal using the phase synchronization module, and adjusts the stimulation mode in real time using the dual-loop feedback module to achieve personalized sleep intervention.
It improves the accuracy and effectiveness of sleep quality monitoring, ensures the safety and effectiveness of stimulation parameters, continuously improves users' sleep quality, and adaptively adjusts monitoring strategies.
Smart Images

Figure CN122004794B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of sleep quality monitoring technology, and in particular to a non-invasive method and system for monitoring user sleep quality. Background Technology
[0002] Currently, sleep quality monitoring technology is widely researched and applied. However, in terms of signal analysis, most systems only analyze the basic characteristics of EEG signals and fail to delve into the rich spatiotemporal features of EEG signals. This neglect in existing technologies leads to an incomplete and inaccurate understanding of the user's sleep state. At the same time, in determining stimulation parameters, traditional methods lack sufficient consideration of the individual physiological characteristics of users. As a means of improving sleep quality, transcranial alternating current stimulation often uses fixed or universal standards for parameter settings without dynamic adjustment based on individual physiological indicators. This makes the stimulation effect vary from person to person, making it difficult to meet the personalized needs of different users, and may even cause discomfort or adverse effects on users due to inappropriate stimulation parameters.
[0003] Currently, few technologies can effectively intervene in the waveform of stimulation signals based on real-time changes in brain neural activity. The neural activity in different brain regions has complex phase relationships, and traditional technologies have failed to utilize this phase information to compensate for and optimize the phase of stimulation signals. This results in poor synchronization between stimulation signals and brain neural activity, affecting the effectiveness of stimulation. Moreover, existing sleep quality monitoring systems lack effective feedback mechanisms. When users develop tolerance to transcranial alternating current stimulation, it is impossible to make timely and accurate judgments and take corresponding measures. As a result, the stimulation effect gradually declines after long-term use, and it is impossible to continuously improve the user's sleep quality. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this application provides a non-invasive method and system for monitoring user sleep quality.
[0005] In a first aspect, this application provides a non-invasive user sleep quality monitoring system, which includes: a feature analysis module, a parameter optimization module, a phase synchronization module, and a dual-loop feedback module;
[0006] The feature parsing module is used to acquire EEG signals, extract the spatiotemporal features of EEG signals, and generate feature vector sets by connecting the spatiotemporal features of EEG signals based on graph neural networks.
[0007] The parameter optimization module is used to calculate the similarity between the feature vector set and the transcranial alternating current stimulation parameters, generate a stimulation parameter set, and adjust the individual stimulation threshold and stimulation parameter set according to the user's metabolic rate and heart rate variability.
[0008] The phase synchronization module is used to determine the stimulation signal waveform based on the stimulation parameter set, and to receive phase coherence across brain regions to intervene in the stimulation signal waveform. Based on the feature vector set and individual stimulation threshold, it determines the relationship between sleep stage and stimulation pattern, and performs multiple rounds of transcranial alternating current stimulation on the user according to the stimulation pattern.
[0009] After each round of transcranial alternating current stimulation, the change in the feature vector set is extracted, and the change in the feature vector set and the change in the user's metabolic rate are used to determine whether to reset the generation of stimulation parameter set.
[0010] The dual-loop feedback module is used to determine whether stimulation tolerance has occurred based on the changes in the feature vector group, the magnitude of changes in the user's metabolic rate, and the stimulation effect, so as to adjust the stimulation mode and individual stimulation threshold.
[0011] As an optional implementation, the logic for generating the feature vector set includes:
[0012] Acquire EEG signals and preprocess them;
[0013] Extracting the spatiotemporal features of EEG signals, which include... The spatiotemporal distribution of wave power Wave power ratio and phase coherence across brain regions;
[0014] Construct a graph structure, determine the nodes and edges of the graph structure, input the graph structure into a graph neural network, update the nodes through convolution operations, output the feature vector of each node, and combine the feature vectors of all nodes to generate a feature vector group.
[0015] As an optional implementation, the logic for generating the stimulus parameter set includes:
[0016] The parameters of transcranial alternating current stimulation are encoded and converted into stimulation feature vectors;
[0017] The distance between the feature vector set and the stimulus feature vector is calculated using Mahalanobis distance.
[0018] The distance between the feature vector group and the stimulus feature vector is normalized and converted into the similarity between the feature vector group and the stimulus feature vector. A similarity threshold is configured. If the similarity between the feature vector group and the stimulus feature vector is greater than the similarity threshold, the transcranial alternating current stimulation parameters are included in the stimulation parameter group.
[0019] If the similarity between the feature vector group and the stimulus feature vector is not greater than the similarity threshold, the transcranial alternating current stimulation parameters will be screened out. The transcranial alternating current stimulation parameters include stimulation frequency, stimulation intensity, and stimulation duration.
[0020] As an optional implementation, the adjustment logic of the stimulation parameter set includes:
[0021] Obtain user metabolic rate and heart rate variability, correlate user metabolic rate and heart rate variability to calculate dynamic safety factor, and determine the safe range of stimulation intensity;
[0022] Individual stimulation thresholds are adjusted based on user metabolic rate, heart rate variability, and stimulation intensity.
[0023] With the stimulus effect as the objective and the individual stimulus threshold as a constraint, the stimulus parameter set is iteratively adjusted, where the stimulus effect includes... The rate of change of wave power and the number of times the user is awakened.
[0024] As an optional implementation, the intervention logic of the stimulation signal waveform includes:
[0025] Receive phase coherence across brain regions and analyze the phase difference between different brain regions in real time;
[0026] The compensation speed is adjusted based on the user's metabolic rate, and the phase of the stimulus signal is compensated according to the compensation speed and the phase difference of each brain region.
[0027] Adjust the phase of the stimulus signal based on the individual's stimulus threshold.
[0028] As an optional implementation method, the logic for determining the relationship between sleep stages and stimulation patterns includes:
[0029] The feature vector set is fused with the individual stimulus threshold to generate sleep stage features, and the sleep stage features are then subjected to cluster analysis to obtain the clustering results of the sleep stages.
[0030] The stimulation pattern is determined based on the combination of stimulation parameter sets and stimulation signal waveforms.
[0031] Stimulation patterns were simulated at different sleep stages, and the effects of the stimulation were monitored to evaluate the effectiveness of the stimulation patterns.
[0032] Based on the clustering results of sleep stages and the effects of stimulation patterns, the relationship between sleep stages and stimulation patterns is determined.
[0033] As an optional implementation, the judgment logic for resetting the generation stimulus parameter set includes:
[0034] After each round of transcranial alternating current stimulation, the change in the feature vector set is extracted by calculating the Euclidean distance before and after stimulation.
[0035] Synchronously monitor the changes in the user's metabolic rate, configure the change threshold and the magnitude threshold. If the change in the feature vector group is greater than the change threshold and the change in the user's metabolic rate is greater than the magnitude threshold, then trigger the reset and generation of the stimulus parameter group.
[0036] A reset signal is generated and transmitted to the parameter optimization module to reset the generated stimulus parameter set.
[0037] As an optional implementation, the logic for determining stimulus tolerance includes:
[0038] Stimulus tolerance is obtained by weighting the changes in the feature vector group and the changes in the user's metabolic rate.
[0039] The stimulus effect The rate of change of wave power and the number of times the user aroused were weighted to obtain a score of the stimulus effect;
[0040] Configure a tolerance threshold, compare the stimulus tolerance with the tolerance threshold, and combine the stimulus effect score to make a comprehensive judgment on stimulus tolerance.
[0041] As an optional implementation, the nodes in the graph structure represent the spatiotemporal characteristics of EEG signals from different brain regions, and the edges in the graph structure represent the functional relationships between brain regions.
[0042] Secondly, this application provides a non-invasive method for monitoring user sleep quality, the method comprising:
[0043] Acquire EEG signals, extract the spatiotemporal features of the EEG signals, and generate feature vector sets by connecting the spatiotemporal features of the EEG signals based on graph neural networks;
[0044] Calculate the similarity between the feature vector set and the transcranial alternating current stimulation parameters to generate the stimulation parameter set;
[0045] Adjust individual stimulation thresholds based on user metabolic rate and heart rate variability, and adjust stimulation parameter groups based on individual stimulation thresholds;
[0046] The stimulus signal waveform is determined based on the stimulus parameter set, and the phase coherence across brain regions is received to intervene in the stimulus signal waveform.
[0047] The relationship between sleep stages and stimulation patterns is determined based on feature vector sets and individual stimulation thresholds, and multiple rounds of transcranial alternating current stimulation are performed on users according to the stimulation patterns.
[0048] After each round of transcranial alternating current stimulation, the change in the feature vector set is extracted, and the change in the feature vector set and the change in the user's metabolic rate are used to determine whether to reset the generation of stimulation parameter set.
[0049] Based on the changes in the feature vector group, the magnitude of changes in the user's metabolic rate, and the stimulus effect, a comprehensive judgment is made as to whether stimulus tolerance has occurred. If stimulus tolerance has occurred, the stimulus mode and individual stimulus threshold are adjusted.
[0050] Compared with existing technologies, the beneficial effects of this application are as follows: by organically integrating the feature analysis module, parameter optimization module, phase synchronization module, and dual-loop feedback module, a comprehensive and intelligent sleep quality monitoring system is constructed. The modules cooperate with each other and share data, analyzing, monitoring, and intervening in the user's sleep quality from multiple dimensions. The feature analysis module provides rich and accurate feature data of brain neural activity for subsequent modules. The parameter optimization module determines appropriate stimulation parameters based on these feature data and the user's physiological characteristics. The phase synchronization module optimizes the stimulation signal according to the stimulation parameters and brain phase information. The dual-loop feedback module monitors the stimulation effect in real time and makes dynamic adjustments, enabling the system to adaptively adjust the monitoring and intervention strategies according to the user's real-time sleep state and individual differences, thereby improving the accuracy and effectiveness of sleep quality monitoring and improvement.
[0051] The feature analysis module extracts the spatiotemporal features of EEG signals to reflect the neural activity patterns and functional connectivity of the brain during sleep from different perspectives, providing a data foundation for subsequent modules. By analyzing the spatiotemporal features, it accurately determines the user's sleep stage and sleep quality, improving the accuracy of sleep state assessment. Based on graph neural networks connecting the spatiotemporal features of EEG signals, it generates feature vector sets, effectively integrating information on brain neural activity in the spatial and temporal dimensions. This allows the feature vector sets to comprehensively and accurately describe the user's sleep state, providing a reliable basis for subsequent steps and helping to select suitable stimulation parameters for the user.
[0052] The parameter optimization module generates a set of stimulation parameters by calculating the similarity between the feature vector set and the transcranial alternating current (TCD) stimulation parameters. This fully considers the matching relationship between the user's brain neural activity characteristics and the stimulation parameters, quickly and accurately finding the parameter combination that best suits the user's current sleep state. This improves the targeting and effectiveness of the stimulation parameters, helping to enhance the effect of TCD stimulation on improving the user's sleep quality. The module adjusts the individual stimulation threshold based on the user's metabolic rate and heart rate variability, and then adjusts the stimulation parameter set based on this individual threshold. This fully reflects attention to the user's individual physiological characteristics. Different users have different tolerance levels and optimal response states to TCD stimulation. By dynamically adjusting the individual stimulation threshold, the module ensures that the stimulation parameters are within a safe and effective range, avoiding adverse effects on the user due to excessive stimulation intensity, thus achieving a personalized sleep improvement plan.
[0053] The phase synchronization module determines the stimulus signal waveform based on the stimulus parameter set and combines it with cross-brain region phase coherence intervention to synchronize the stimulus signal waveform with brain neural activity, effectively regulating brain neural activity and promoting improved sleep quality. Based on the feature vector set and individual stimulus thresholds, the module determines the relationship between sleep stage and stimulus pattern, and performs multiple rounds of transcranial alternating current stimulation on the user according to the stimulation pattern, achieving precise matching between sleep stage and stimulation pattern. Different sleep stages elicit different brain responses to stimulation, and corresponding stimulation patterns are used for different sleep stages, improving the targeting and effectiveness of the stimulation. After each round of stimulation, the module determines whether to reset the generated stimulus parameter set based on the change in the feature vector set and the change in the user's metabolic rate, allowing the system to adjust the stimulus parameters in real time according to the stimulation effect, improving the adaptive capability of the sleep quality monitoring system.
[0054] The dual-loop feedback module comprehensively judges whether stimulation tolerance has occurred based on changes in the feature vector set, the magnitude of changes in the user's metabolic rate, and the stimulation effect. This provides a comprehensive and accurate basis for timely detection of the user's tolerance to transcranial alternating current stimulation. It can comprehensively analyze multiple levels, including brain neural activity, overall physiological state, and stimulation effect, improving the accuracy and timeliness of the judgment. If stimulation tolerance occurs, timely adjustment of the stimulation mode and individual stimulation threshold can effectively solve the problem of stimulation tolerance and maintain the stimulation effect. By adjusting the stimulation mode, trying different stimulation methods and parameter combinations, the user's stimulation tolerance state can be broken. By readjusting the individual stimulation threshold and optimizing the stimulation parameter set, the stimulation is ensured to be carried out within a safe and effective range. This flexible adjustment mechanism enables the system to continuously provide users with effective sleep improvement services and improves the long-term stability and reliability of the sleep quality monitoring system. Attached Figure Description
[0055] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0056] Figure 1 A system flowchart of a non-invasive user sleep quality monitoring system provided in this application embodiment;
[0057] Figure 2 A logic diagram for generating the stimulation parameter set provided in the embodiments of this application;
[0058] Figure 3 This is a logic diagram of the stimulation signal waveform intervention provided in the embodiments of this application;
[0059] Figure 4This is a flowchart illustrating a non-invasive method for monitoring user sleep quality, as provided in an embodiment of this application. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of this application more apparent and understandable, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0061] Example 1
[0062] like Figure 1 The diagram shown is a system flowchart of a non-invasive user sleep quality monitoring system provided in this application embodiment. The system includes a feature parsing module, a parameter optimization module, a phase synchronization module, and a dual-loop feedback module.
[0063] The feature parsing module is used to acquire EEG signals, extract the spatiotemporal features of EEG signals, and generate feature vector groups by connecting the spatiotemporal features of EEG signals based on graph neural networks.
[0064] Specifically, the logic for generating feature vector sets includes:
[0065] Acquire EEG signals and preprocess them;
[0066] Extracting the spatiotemporal features of EEG signals, which include... The spatiotemporal distribution of wave power Wave power ratio and phase coherence across brain regions;
[0067] Construct a graph structure, determine the nodes and edges of the graph structure, input the graph structure into a graph neural network, update the nodes through convolution operations, output the feature vector of each node, and combine the feature vectors of all nodes to generate a feature vector group.
[0068] In the graph structure, nodes represent the spatiotemporal characteristics of EEG signals from different brain regions, and edges represent the functional relationships between brain regions.
[0069] Raw EEG signals typically contain various noises and interferences, such as environmental electromagnetic interference and muscle electrical activity interference. These noises can severely affect the accurate extraction and analysis of the spatiotemporal characteristics of EEG signals. Preprocessing after acquiring EEG signals is necessary to remove these noises and interferences, obtaining pure signals that accurately reflect brain electrical activity, thus providing a reliable data foundation for subsequent steps. EEG signals are acquired by embedding nanofiber electrodes into the surface of the bed sheet. A suitable sampling frequency is set, typically 256Hz or higher, to ensure accurate capture of subtle changes in the EEG signal. At the same time, an appropriate gain is set and adjusted according to the signal strength to ensure that the EEG signal is not distorted during acquisition.
[0070] By using bandpass filters to remove low-frequency baseline drift and high-frequency noise interference, or by using notch filters for targeted removal, and employing independent component analysis algorithms to decompose the EEG signal into multiple independent components, components related to artifacts such as electrooculography (EOG) and electromyography (EMG) are removed through manual or automatic identification, while components related to brain electrical activity are retained. This effectively removes noise and artifacts from the EEG signal, improving its quality and signal-to-noise ratio. This makes the subsequent extraction of spatiotemporal features from the EEG signal more accurate and reliable, ensuring accurate analysis of brain electrical activity.
[0071] The spatiotemporal distribution of wave power Spatiotemporal features such as wave power ratio and phase coherence across brain regions can reflect the neural activity patterns and functional connectivity of the brain during sleep from different perspectives. These spatiotemporal features are of great significance for understanding brain mechanisms during sleep and assessing sleep quality, and are key data for subsequent graph structure construction and feature vector generation; among them, for Extracting the spatiotemporal distribution of wave power requires segmenting the preprocessed EEG signal into segments of a certain time length, such as 2 seconds per segment. A Fast Fourier Transform (FFT) is then performed on each segment to convert the time-domain signal into a frequency-domain signal, thereby obtaining the power spectrum of the EEG signal at different frequencies. The power spectrum is then extracted from the frequency-domain signal. Wave power value, and determine The distribution of wave power values in brain space is represented by constructing a spatial matrix, where rows represent different brain regions and columns represent each segment of the EEG signal. Wave power value, thus obtaining The spatiotemporal distribution of wave power.
[0072] Wave power ratio is extracted from frequency signals. wave and The power value of the wave is calculated for each segment of the EEG signal. Wave power and The ratio of wave power forms a time series. The data includes wave power ratio; while the extraction of phase coherence across brain regions is achieved through a phase-locked value algorithm, which calculates the phase coherence of EEG signals between different brain regions. This involves calculating the phase-locked value of each pair of fabric electrodes (corresponding to different brain regions) over a period of time, such as 10 seconds, thus obtaining a matrix reflecting the phase relationship between different brain regions. The matrix elements are the phase-locked values between different brain regions. By accurately extracting these spatiotemporal features, we can gain a deeper understanding of the neural activity patterns and functional connectivity states of the brain during sleep. The spatiotemporal distribution of wave power reflects the slow-wave activity of the brain in different regions and at different times. Wave power ratio reflects the brain's arousal and relaxation states, while phase coherence across brain regions reflects synchronous activity between different brain regions. These spatiotemporal features provide rich data for constructing graph structures. Nodes in the graph structure will be constructed based on these spatiotemporal features, and the weights of edges will also be related to features such as phase coherence between brain regions. Accurate spatiotemporal feature extraction enables the constructed graph structure to more realistically reflect the functional connections of the brain, thereby providing accurate data support for the subsequent generation of effective feature vector sets through graph neural networks.
[0073] The neural activity of the brain is a complex network system. By constructing a graph structure, the spatiotemporal features of EEG signals can be organically integrated. Utilizing the powerful processing capabilities of graph neural networks, the complex relationships and patterns in the brain's neural activity can be mined. The generated feature vector sets can comprehensively reflect the electrical activity characteristics of the brain in different brain regions, at different frequencies, and with different phase relationships, providing a comprehensive and effective feature representation for subsequent parameter optimization and sleep stage judgment.
[0074] Construct a graph structure where each node represents the spatiotemporal features of EEG signals from a brain region, and extract... The spatiotemporal distribution of wave power Features such as wave power ratio and cross-brain region phase coherence are used as node attributes. For example, for a bed sheet acquired by EEG with 32 fabric electrodes, 32 nodes are constructed, each containing the aforementioned spatiotemporal feature data of the corresponding fabric electrode location. Edges represent the functional relationships between brain regions. The weight of the edges is determined based on the cross-brain region phase coherence. The higher the phase coherence, the greater the edge weight, indicating a stronger functional connection between the two brain regions. Through multi-layer graph convolutional neural networks, such as two- or three-layer GCNs, GCNs can perform convolution operations on the graph structure, effectively extracting feature information from the graph. In each layer of the GCN, convolution operations are performed between the convolution kernel and node features and edge weights to update the feature representation of the node. The convolution operation can fuse the node's own features as well as the features of its connected nodes, enabling each node to obtain information from its neighboring nodes. After processing by multi-layer GCNs, the feature vector of each node is output. These feature vectors integrate multiple spatiotemporal features of the EEG signal of the brain region as well as the relationship information with other brain regions, combining the feature vectors of all nodes to form a feature vector group.
[0075] The constructed graph structure and the feature vector set generated by the graph neural network can comprehensively and deeply reflect the neural activity characteristics and functional connectivity patterns of the brain during sleep. Each feature vector in the feature vector set contains rich information, providing comprehensive feature basis for the parameter optimization module to calculate the similarity between the feature vector set and the transcranial alternating current stimulation parameters. In the parameter optimization module, these feature vectors can be matched and analyzed more accurately with the stimulation parameters, thereby generating a more suitable set of stimulation parameters. At the same time, in the phase synchronization module, the feature vector set is also used to determine the relationship between sleep stages and stimulation patterns, providing key data support for accurate judgment of sleep stages and reasonable selection of stimulation patterns.
[0076] The parameter optimization module is used to calculate the similarity between the feature vector set and the transcranial alternating current stimulation parameters, generate a stimulation parameter set, and adjust the individual stimulation threshold according to the user's metabolic rate and heart rate variability, and adjust the stimulation parameter set based on the individual stimulation threshold.
[0077] Specifically, such as Figure 2 As shown, the logic for generating the stimulus parameter set includes:
[0078] The parameters of transcranial alternating current stimulation are encoded and converted into stimulation feature vectors;
[0079] The distance between the feature vector set and the stimulus feature vector is calculated using Mahalanobis distance.
[0080] The distance between the feature vector group and the stimulus feature vector is normalized and converted into the similarity between the feature vector group and the stimulus feature vector. A similarity threshold is configured. If the similarity between the feature vector group and the stimulus feature vector is greater than the similarity threshold, the transcranial alternating current stimulation parameters are included in the stimulation parameter group.
[0081] If the similarity between the feature vector group and the stimulus feature vector is less than or equal to the similarity threshold, then the transcranial alternating current stimulation parameters will be excluded.
[0082] Transcranial alternating current stimulation parameters include stimulation frequency, stimulation intensity, and stimulation duration.
[0083] Transcranial alternating current stimulation parameters are information in different dimensions. To enable unified comparison and analysis with the feature vector set in subsequent calculations, they need to be encoded into a quantifiable vector form so that their similarity to the feature vector set can be measured mathematically. The stimulation frequency is encoded using one-hot encoding. Assuming the stimulation frequency range is divided into several discrete frequency bands, such as 0-1Hz, 1-2Hz, 2-3Hz, etc., for a given stimulation frequency, the encoding position corresponding to its frequency band is set to 1, and the other positions are set to 0. For example, if the stimulation frequency is 1.5Hz, which is in the 1-2Hz band, then the encoding position for that band is 1, and the encoding positions for other bands are 0. The stimulation intensity is normalized so that its value is between 0 and 1. For example, if the actual range of the stimulation intensity is 0-100μA, the current stimulation intensity value is divided by 100 to obtain a normalized value between 0 and 1, and this normalized value is then used as a dimension value in the vector. Similar to intensity encoding, the stimulation duration is normalized, assuming the maximum value of the stimulation duration is... The current stimulation duration is Then the duration encoding value is This value is used as another dimension of the vector. Finally, the frequency encoding, intensity encoding, and duration encoding are combined to form a complete stimulus feature vector. Through this encoding method, the transcranial alternating current stimulation parameters are transformed into a computable and comparable vector form, which makes it convenient to use Mahalanobis distance to calculate its similarity with the feature vector group, laying the foundation for selecting a suitable stimulus parameter group.
[0084] Mahalanobis distance takes into account the covariance structure of the data. For feature vector groups and stimulus feature vectors with different scales and correlations, Mahalanobis distance can more accurately measure the similarity between them. Compared with other distance metrics such as Euclidean distance, Mahalanobis distance better reflects the intrinsic relationship between data and improves the accuracy of selecting stimulus parameter groups. First, the feature vector group is analyzed, and its covariance matrix is calculated. Assuming the feature vector group contains multiple feature vectors, each with n dimensions, the mean of these feature vectors in each dimension is calculated. Then, the covariance between different dimensions is calculated according to the covariance formula, constructing an n×n covariance matrix. Mahalanobis distance is calculated between each feature vector in the feature vector group and the stimulus feature vector, resulting in a set of distance values. Mahalanobis distance considers the correlation and scale differences between the dimensions in the feature vector group, and can more accurately reflect the similarity between the stimulus feature vector and each vector in the feature vector group. By calculating the Mahalanobis distance, a more reliable basis is provided for subsequent conversion of distance into similarity and selection of stimulus parameter groups.
[0085] The range of distance values calculated using Mahalanobis distance is not fixed, making direct comparison and selection difficult. Normalization converts the distance values into similarity scores, placing them between 0 and 1. This facilitates setting a uniform threshold for selection, allowing for rapid and effective filtering of parameters with high similarity to the feature vector group from numerous transcranial AC stimulation parameters. This results in stimulation parameter groups that improve stimulation effectiveness and sleep quality. The Mahalanobis distance values are normalized using a max-min normalization method, resulting in similarity scores between 0 and 1. Higher values indicate higher similarity. Through extensive experimental data and actual testing, a suitable similarity threshold, such as 0.6, was determined. This threshold required comprehensive consideration of different users' sleep characteristics and stimulation effect feedback, and was obtained through multiple trials and optimizations.
[0086] For each transcranial alternating current (TAC) stimulation parameter encoded, the similarity between its encoded feature vector and the feature vector group is calculated. If the similarity is greater than 0.6, the corresponding TAC stimulation parameter is included in the stimulation parameter group; if the similarity is less than or equal to 0.6, the TAC stimulation parameter is excluded. After normalization and threshold screening, stimulation parameter groups with high similarity to the feature vector group are obtained. These parameters have a positive impact on the user's sleep state and provide a relatively high-quality parameter set for subsequent adjustment of the stimulation parameter group based on individual stimulation thresholds. The selected stimulation parameter group is the basis for subsequent adjustments. The quality of the stimulation parameter group directly affects whether the most suitable stimulation parameters for the user can be found, thus affecting the sleep quality improvement effect.
[0087] Specifically, the adjustment logic for the stimulation parameter set includes:
[0088] Obtain user metabolic rate and heart rate variability, correlate user metabolic rate and heart rate variability to calculate dynamic safety factor, and determine the safe range of stimulation intensity;
[0089] Individual stimulation thresholds are adjusted based on user metabolic rate, heart rate variability, and stimulation intensity.
[0090] With the stimulus effect as the objective and the individual stimulus threshold as a constraint, the stimulus parameter set is iteratively adjusted, where the stimulus effect includes... The rate of change of wave power and the number of times the user is awakened.
[0091] A user's metabolic rate and heart rate variability reflect their physiological state. Different physiological states have different tolerances to stimulation intensity. By correlating these two factors to calculate a dynamic safety factor, the safety range of stimulation intensity can be dynamically adjusted according to the user's real-time physiological state, ensuring the safety of the stimulation process and avoiding adverse effects on the user due to excessive stimulation intensity. Wearable devices such as smart bracelets or smartwatches are used to monitor the user's heart rate, skin temperature, and acceleration amplitude of limb movements. At the same time, the user's height, weight, age, and gender information are pre-entered. The user's basal metabolic rate at rest is calculated using the Mifflin-St Jeor formula: User metabolic rate = Basal metabolic rate + (Real-time heart rate - Resting heart rate) × Heart rate weight + Change in skin temperature × Temperature weight + Acceleration amplitude of limb movements × Exercise weight.
[0092] The weights mentioned above are determined based on clinical trials. Heart rate changes have the most significant impact on metabolic rate, with a weight of 0.5; skin temperature changes are the second most significant, with a weight of 0.3; and limb movement has the least impact, with a weight of 0.2. For example, if a user has a basal metabolic rate of 1200 kcal / day, a resting heart rate of 60 beats / minute, and real-time monitoring shows a heart rate of 70 beats / minute, a skin temperature increase of 0.5℃ compared to resting temperature, and a limb movement acceleration amplitude of 0.2g (where g is the acceleration due to gravity), then the user's metabolic rate = 1200 + (70 - 60) × 0.5 + 0.5 × 0.3 + 0.2 × 0.2 = 1200 + 5 + 0.15 + 0.04 = 1205.19 kcal / day.
[0093] Heart rate variability (HRV) is determined by analyzing heartbeat signals over a period of time, such as 5 minutes. The time intervals between adjacent heartbeats, known as the RR intervals, are calculated to form a continuous sequence of heartbeat intervals. Obvious abnormal intervals, such as those caused by jitter, are then removed. A Fast Fourier Transform (FFT) is then used to perform frequency domain analysis on the heartbeat interval sequence. Through integration, the heartbeat signal is decomposed into components of different frequencies. Components with frequencies between 0.04 and 0.15 Hz are considered low-frequency components of HRV, primarily reflecting sympathetic nervous system activity. Components with frequencies between 0.15 and 0.40 Hz are considered high-frequency components, primarily reflecting parasympathetic nervous system activity. For example, after preprocessing, frequency domain analysis of a user's 5-minute RR interval sequence shows a total power of 100 ms in the 0.04–0.15 Hz frequency band. 2 The total power in the 0.15~0.40Hz frequency band is 50ms. 2 That is, the ratio of low frequency to high frequency is 2.
[0094] The dynamic safety factor is calculated by correlating user metabolic rate and heart rate variability. The calculation formula is as follows:
[0095] ;
[0096] In the formula, Indicates dynamic safety factor, Indicates user metabolic rate. This represents the basal metabolic rate. The low-frequency components representing heart rate variability, High-frequency components representing heart rate variability.
[0097] The above formula correlates user metabolic rate and heart rate variability. For example, combining the user data above, the basal metabolic rate is 1200 kcal / day, the user metabolic rate is 1205.19 kcal / day, and the low-frequency component is 100 ms. 2 High-frequency components 50ms 2 The dynamic safety factor is calculated as (1205.19 / 1200)×(1+100 / 50)≈1.0043×3≈3.01. Based on the dynamic safety factor, combined with the pre-set safety coefficient and the maximum safe stimulation intensity, the safe range of stimulation intensity is determined. For example, the safety coefficient is set to 0.8, and the maximum safe stimulation intensity is 1.0mA. The maximum safe stimulation intensity meets the general safety standards for transcranial alternating current stimulation medical devices and has been verified by clinical trials to avoid nerve damage and stimulation.
[0098] The upper limit of the safe range is calculated as: dynamic safety factor × safety coefficient × maximum safe stimulus intensity. The lower limit of the safe range is set at 20% of the upper limit, but can also be adjusted according to actual conditions. For example, if the dynamic safety factor is 3.01, the upper limit of the safe range is 3.01 × 0.8 × 1.0 ≈ 2.41 mA, and the lower limit is 2.41 × 20% ≈ 0.48 mA, meaning the stimulus intensity needs to be controlled between 0.48 and 2.41 mA. By calculating the dynamic safety factor to determine the safe range of stimulus intensity, the limits of stimulus intensity can be adjusted in real time according to the user's physiological state, ensuring the safety of the stimulation process. This provides a safe boundary for subsequent adjustments to the stimulus intensity based on individual stimulus thresholds, allowing the adjustment process to be carried out under safe conditions, avoiding potential risks to users due to inappropriate stimulus intensity, and also providing an important reference for adjusting individual stimulus thresholds.
[0099] Individual stimulation thresholds are not fixed and change with variations in the user's physiological state and the current stimulation intensity. By comprehensively considering these factors and adjusting the individual stimulation threshold, the stimulation can better match the user's actual physiological needs, improving both the stimulation effect and safety. Using regression models in machine learning, such as multiple linear regression or neural network regression models, with user metabolic rate, heart rate variability, and current stimulation intensity as input features and the individual stimulation threshold as output, a large amount of historical data from different users under different physiological states and stimulation intensities is collected to train the regression model. During training, loss functions such as mean squared error are used to measure the difference between the model's predicted values and the actual individual stimulation threshold. Optimization algorithms such as gradient descent are used to continuously adjust the model parameters to minimize the loss function. Simultaneously, as new data is continuously collected, the model is periodically updated to adapt to changes in different users' physiological states and new stimulation situations.
[0100] The system acquires real-time data on the user's metabolic rate, heart rate variability, and current stimulus intensity. This data is input into a trained regression model, which outputs an adjusted individual stimulus threshold. For example, if the user's metabolic rate increases from 1200 kcal / day to 1440 kcal / day, the low-frequency to high-frequency heart rate variability ratio decreases from 2 to 1 (indicating physiological stress), and the current stimulus intensity is close to the upper limit of the safe range (2.41 mA), the model will appropriately lower the individual stimulus threshold, such as to 2.0 mA, to ensure the safety and effectiveness of the stimulus. The regression model is trained based on clinically standardized data tables. Input features include the user's metabolic rate, heart rate variability, and current stimulus intensity. After normalizing the input features, the regression model outputs results based on the learned mapping relationship between physiological parameters and stimulus thresholds, ensuring that the individual stimulus threshold is adapted to the user's current physiological state.
[0101] By establishing a model for dynamically adjusting individual stimulation thresholds, the individual stimulation thresholds can be precisely adjusted based on the user's real-time physiological state and stimulation conditions. The adjusted individual stimulation thresholds better meet the user's actual needs, providing more accurate constraints for subsequent iterative adjustments of the stimulation parameter set with stimulation effect as the goal. Reasonable individual stimulation thresholds can guide the adjustment direction of the stimulation parameter set, making the adjusted stimulation parameter set more likely to achieve the goal of improving sleep quality.
[0102] The goal is to improve users' sleep quality by adjusting stimulus parameters. Stimulation effect is a crucial indicator of sleep quality improvement. Individual stimulus thresholds are used as constraints to ensure that parameters such as stimulus intensity do not exceed the user's tolerance range when adjusting the stimulus parameter set. The optimal combination of stimulus parameters is found through iterative adjustments to maximize the stimulus effect. Simulated annealing is employed, using stimulus frequency, intensity, and duration as optimization variables, and the stimulus effect as the objective function, for example, maximizing... The rate of change of wave power is minimized, and the number of user awakenings is minimized. The individual stimulation threshold is used as a constraint, that is, the stimulation intensity must be within the safe range determined according to the dynamic safety factor and meet the individual stimulation threshold limit.
[0103] In each iteration, the simulated annealing algorithm generates a new set of candidate stimulus parameters based on the current set of stimulus parameters. It calculates the stimulus effect corresponding to the new candidate parameter set and determines whether it meets the individual stimulus threshold constraint. If it does, it evaluates the merits of the new candidate parameter set according to the objective function. If the new candidate parameter set improves the stimulus effect, the current stimulus parameter set is updated; otherwise, adjustments are made according to the rules of the simulated annealing algorithm, and new candidate parameter sets are generated again. For example, the simulated annealing algorithm may accept a poor solution with a certain probability to avoid getting trapped in a local optimum. It also sets iteration termination conditions, such as reaching a certain number of iterations or the improvement in stimulus effect being less than a certain threshold. A threshold is set, where the number of iterations is, for example, 100, and a threshold value is, for example, 0.01. When a termination condition is met, the iteration process ends, yielding the final set of stimulation parameters. By iteratively adjusting the stimulation parameter set under individual stimulation threshold constraints with the stimulation effect as the target, the combination of stimulation parameters most beneficial to improving the user's sleep quality within a safe range can be found. The adjusted stimulation parameter set will be used in subsequent transcranial alternating current stimulation processes, which is expected to improve the stimulation effect and improve the user's sleep quality. At the same time, the adjusted stimulation parameter set also provides specific parameter basis for the phase synchronization module to determine the stimulation signal waveform and the relationship between sleep stages and stimulation patterns, playing a key role in the operation and optimization of the entire sleep quality monitoring system.
[0104] The phase synchronization module is used to determine the stimulation signal waveform based on the stimulation parameter set and to receive phase coherence across brain regions to intervene in the stimulation signal waveform. At the same time, it determines the relationship between sleep stage and stimulation mode based on the feature vector set and individual stimulation threshold. According to the stimulation mode, it performs multiple rounds of transcranial alternating current stimulation on the user. After each round of transcranial alternating current stimulation, it extracts the change in the feature vector set and determines whether to reset the generation of stimulation parameter set based on the change in the feature vector set and the change in the user's metabolic rate.
[0105] The stimulus signal waveform is determined based on the stimulus parameter set generated above. The stimulus signal waveform includes the stimulus signal phase, stimulus signal amplitude, stimulus signal frequency, and waveform shape. Specifically, as follows: Figure 3 As shown, the intervention logic for the stimulus signal waveform includes:
[0106] Receive phase coherence across brain regions and analyze the phase difference between different brain regions in real time;
[0107] The compensation speed is adjusted based on the user's metabolic rate, and the phase of the stimulus signal is compensated according to the compensation speed and the phase difference of each brain region.
[0108] Adjust the phase of the stimulus signal based on the individual's stimulus threshold.
[0109] The neural activity in different brain regions exhibits phase differences. These phase differences contain important information about brain functional connectivity and sleep states. By analyzing the phase differences between brain regions in real time, we can understand the dynamic changes in the brain and provide a basis for subsequent phase-information-based intervention of stimulus signal waveforms, making the stimulation more aligned with the rhythm of the brain's physiological activities and improving the stimulation effect. During the generation of feature vector groups in the feature analysis module, cross-brain region phase coherence data has already been acquired. Here, this data is directly retrieved from the feature analysis module. For signals corresponding to different brain regions, the time-domain signals are converted into analytical signals using Hilbert transform, thereby obtaining the instantaneous phase of the signal in each brain region. Then, the difference between the instantaneous phases of any two brain region signals is calculated to obtain the phase difference between each brain region. For example, for signals from brain region A and brain region B, their instantaneous phases are calculated separately. and Then the phase difference .
[0110] This allows for accurate analysis of the phase difference between different brain regions and real-time capture of the phase characteristics of brain neural activity. It provides fundamental data for subsequent adjustments to the compensation speed based on the user's metabolic rate and for adjusting the phase of the stimulation signal in conjunction with individual stimulation thresholds. Precise phase difference data makes subsequent phase compensation and adjustment more accurate, enabling the optimization of the stimulation signal waveform based on the actual state of the brain, thereby improving the targeting and effectiveness of stimulation.
[0111] A user's metabolic rate reflects their physiological activity level. Different metabolic rates result in different brain response speeds and demands for stimulation. By combining the user's metabolic rate with stimulation signal phase compensation, the stimulation signal can be dynamically adjusted according to the individual's physiological state, better matching it with the brain's neural activity and improving the stimulation effect. The formula for adjusting the compensation speed based on the user's metabolic rate is shown below:
[0112] ;
[0113] In the formula, Indicates the compensation speed. Represents the natural constant. This indicates the user's metabolic rate.
[0114] Generally, the higher the user's metabolic rate, the faster the compensation speed to adapt to the faster rhythm of neural activity in the brain, and then for the phase difference of each brain region. According to the compensation speed The phase compensation amount is calculated using the formula shown below:
[0115] ;
[0116] In the formula, This indicates the phase compensation amount. This indicates the initial phase of the stimulus signal.
[0117] Adjusting the compensation speed based on the user's metabolic rate and performing phase compensation allows the stimulation signal to adjust its phase in real time according to the physiological state. This helps improve the synchronization between the stimulation signal and brain neural activity, enhancing the stimulation effect. The adjusted stimulation signal phase provides a basis for further optimization of the stimulation signal waveform that better meets the user's physiological needs, making the entire stimulation signal waveform intervention process more complete and precise.
[0118] The individual stimulation threshold reflects the user's tolerance to stimulation and optimal response state. Adjusting the stimulation signal phase based on the individual stimulation threshold maximizes the stimulation effect while ensuring safety, making the stimulation more consistent with individual physiological characteristics. A maximum stimulation threshold of 2.5 mA and a minimum stimulation threshold of 0.5 mA are preset. These values are determined based on general safety standards and clinical validation data for transcranial alternating current stimulation medical devices, defining the high and low ranges of the individual stimulation threshold and avoiding excessively large or small phase adjustment amplitudes. The current user's individual stimulation threshold is obtained from the parameter optimization module. When the individual stimulation threshold is high, such as 2.0 mA, close to the maximum stimulation threshold of 2.5 mA, it indicates that the user has a strong tolerance to stimulation. In this case, the phase adjustment amplitude of the stimulation signal can be appropriately increased, set to ±15°, to enhance the stimulation effect.
[0119] Conversely, when the individual stimulation threshold is low, such as 0.6mA, which is close to the minimum stimulation threshold of 0.5mA, the phase adjustment amplitude is reduced to ±5° to avoid overstimulation. Then, this phase adjustment amplitude of the stimulation signal is combined with the phase compensation amount calculated based on the user's metabolic rate and phase difference to obtain the final adjustment value of the stimulation signal phase. For example, if the phase compensation amount is +10°, when the individual stimulation threshold is high, the final adjustment value is +10° + 15° = +25°; when the individual stimulation threshold is low, the final adjustment value is +10° + 5° = +15°.
[0120] By adjusting the phase of the stimulation signal in conjunction with individual stimulation thresholds, the stimulation effect can be optimized while ensuring user safety. The adjusted stimulation signal phase provides a more suitable stimulation waveform for subsequent transcranial AC stimulation of the user based on the stimulation pattern, which helps to improve the overall performance of the sleep quality monitoring system and promote the improvement of sleep quality.
[0121] Specifically, the logic for determining the relationship between sleep stages and stimulation patterns includes:
[0122] The feature vector set is fused with the individual stimulus threshold to generate sleep stage features, and the sleep stage features are then subjected to cluster analysis to obtain the clustering results of the sleep stages.
[0123] The stimulation pattern is determined based on the combination of stimulation parameter sets and stimulation signal waveforms.
[0124] Stimulation patterns were simulated at different sleep stages, and the effects of the stimulation were monitored to evaluate the effectiveness of the stimulation patterns.
[0125] Based on the clustering results of sleep stages and the effects of stimulation patterns, the relationship between sleep stages and stimulation patterns is determined.
[0126] The feature vector set contains the spatiotemporal features of EEG signals, reflecting the state of neural activity in the brain. Individual stimulation thresholds reflect the user's tolerance and response characteristics to stimulation. Integrating these two sets provides a more comprehensive description of the user's physiological state during sleep, offering richer feature information for accurate sleep stage segmentation. Cluster analysis groups sleep states with similar characteristics into a single category, thus identifying different sleep stages. The K-means clustering algorithm determines the number of clusters, K=3, corresponding to the three stages of light sleep, deep sleep, and REM sleep. The spatiotemporal features in the feature vector set are concatenated with the individual stimulation thresholds to form new sleep stage features. Inputting these features into the K-means clustering algorithm yields a clear sleep stage segmentation. Combined with clinical validation data, the optimal stimulation patterns and effects for each sleep stage are as follows:
[0127] The optimal stimulation mode for the light sleep stage is a stimulation frequency of 2Hz, a stimulation intensity of 0.8mA, and a sinusoidal waveform with a phase adjustment range of ±10°. The rate of change in wave power increased by 15%, reducing the number of awakenings by 2 per night; the optimal stimulation mode for deep sleep is a stimulation frequency of 1Hz, a stimulation intensity of 1.2mA, and a square wave waveform with a phase adjustment range of ±5°, which can... The rate of change in wave power increased by 30%, reducing user awakenings by 3 times per night; the optimal stimulation mode for REM sleep is a stimulation frequency of 0.5Hz, a stimulation intensity of 0.6mA, and a triangular waveform with phase adjustment amplitude of ±8°, which can... The rate of change of wave power increased by 8%, and the number of times the user woke up decreased by 1 per night. The above matching results were verified through multiple rounds of simulated stimulation to ensure that when the corresponding optimal stimulation mode is selected in each sleep stage, the stimulation effect is significantly better than other modes.
[0128] Then, the fused sleep stage features are used as input to run the K-means clustering algorithm. The K-means clustering algorithm divides the data points into K clusters based on the distance between sleep stage features, such as Euclidean distance. Each cluster represents a sleep stage. In each iteration, the K-means clustering algorithm updates the center of the clusters until the cluster division no longer changes significantly. This allows the user's sleep state to be classified according to their physiological characteristics, resulting in accurate sleep stage clustering results. These clustering results provide a foundation for subsequently determining the relationship between sleep stages and stimulation patterns. Clear sleep stage division makes the process of simulating stimulation patterns and evaluating the effects of stimulation patterns in different sleep stages more targeted, helping to find the most suitable stimulation pattern for each sleep stage and improving the effectiveness of the sleep quality monitoring system.
[0129] The stimulation parameter set and the stimulation signal waveform together determine the specific mode and characteristics of transcranial alternating current stimulation. Combining them defines the stimulation pattern to comprehensively describe different stimulation schemes, providing a clear object for subsequent evaluation of the effects of different stimulation patterns at different sleep stages. Integrating the individual parameters in the stimulation parameter set with the characteristics of the stimulation signal waveform using an encoding method, such as arranging these parameters and features into a vector in a certain order, generates multiple stimulation pattern vectors for different combinations of stimulation parameters and changes in stimulation signal waveform. These vectors are stored in a stimulation pattern library. In practical applications, appropriate stimulation patterns are selected from the library for experiments and evaluations as needed. This provides a rich selection of stimulation patterns for simulating different sleep stages, enabling accurate control of variables when evaluating the effects of stimulation patterns, better analysis of the impact of different stimulation patterns on sleep quality, and providing reliable data support for determining the relationship between sleep stages and stimulation patterns.
[0130] The brain's neural activity and response to stimuli differ at different sleep stages. By simulating various stimulation patterns at different sleep stages and monitoring the stimulation effects, we can understand the effectiveness of each stimulation pattern at different sleep stages, providing a basis for determining the optimal matching relationship between sleep stages and stimulation patterns. Based on the clustering results of the sleep stages obtained above, we can select different sleep stages, such as data samples representing different stages like light sleep and deep sleep from the clustering results, and select different stimulation pattern vectors from the stimulation pattern library. Based on the parameters and features in the vectors, we can generate corresponding transcranial alternating current stimulation signals.
[0131] The stimulus is applied to the corresponding sleep stage to simulate the sleep process, and the stimulus effect is monitored in real time during the simulation. The rate of change of wave power is calculated before and after the stimulus. The difference in wave power compared to before stimulation The ratio of wave power was obtained; the number of user arousals was statistically analyzed by examining arousal characteristics in the EEG signal, which included increased high-frequency activity and Changes in wave power ratio, etc., can yield a large amount of data on the effects of different stimulation modes at different sleep stages. This provides direct evidence for determining the relationship between sleep stages and stimulation modes, helps to find the optimal stimulation mode for different sleep stages, thereby improving the targeting and effectiveness of sleep quality monitoring systems and providing users with personalized sleep improvement solutions.
[0132] Clarifying the relationship between sleep stages and stimulation patterns can provide guidance for selecting the most suitable stimulation pattern based on the user's sleep stage, thereby optimizing the effect of transcranial alternating current stimulation and improving the performance of the sleep quality monitoring system. Analyzing the stimulation effects obtained from simulated stimulation patterns at different sleep stages, and comparing the differences in stimulation effects of different stimulation patterns at the same sleep stage and the same stimulation pattern at different sleep stages through analysis of variance, the relationship between sleep stages and stimulation patterns can be determined based on the results of data analysis.
[0133] For example, during deep sleep, a certain stimulation pattern is significantly enhanced. The rate of change in wave power and the reduction of user awakenings, such as a stimulation frequency of 1Hz, moderate stimulation intensity, and a specific waveform shape and phase adjustment pattern, establish a positive correlation between deep sleep stages and this stimulation pattern. This relationship can be visually represented through tables or graphs, with rows representing sleep stages, columns representing stimulation patterns, and cells containing a stimulus effect score. The stimulus effect score is based on... The result is calculated by weighting two indicators: the rate of change of wave power and the number of times the user is awakened.
[0134] Specifically, the weights of the indicators should first be determined through clinical trials. The rate of change in wave power has a weight of 0.7 on its impact on sleep quality, while the number of user awakenings has a weight of 0.3. Since the number of awakenings is a negative indicator, it needs to be reversed; then, standardization is performed. The rate of change of wave power maps the actual rate of change to a score range of 0-50, meaning 1 point is awarded for every 1% increase in the rate of change, up to a maximum of 50 points. The number of arousals maps the actual number of arousals to a score range of 0-30, meaning 30 points are awarded when the number of arousals is 0, and 5 points are deducted for each additional arousal, down to a minimum of 0 points. The stimulus effect score = ( (Standardized score of rate of change of wave power × 0.7) + (Standardized score of number of awakenings × 0.3); For example, after using the optimal stimulation mode during deep sleep, The rate of change of wave power increases by 30%, which is equivalent to a standardized score of 30. The number of arousals decreases by 3, which is equivalent to an actual arousal of 1, resulting in a standardized score of 25. The stimulus effect score = 30 × 0.7 + 25 × 0.3 = 21 + 7.5 = 28.5 points, out of a possible 80 points.
[0135] Similarly, the relationship between sleep stages and stimulation patterns is presented visually in a table, as shown in Table 1:
[0136] Table 1. Relationship between sleep stages and stimulation patterns
[0137]
[0138] This allows the system to quickly select the most suitable stimulation mode based on the user's current sleep stage, improving the effectiveness of transcranial alternating current stimulation. It also provides a basis for adjusting the stimulation mode according to the sleep stage, making the entire sleep quality monitoring system operate more intelligently and effectively, which is of great significance for improving the user's sleep quality.
[0139] Multiple rounds of transcranial alternating current (TCD) stimulation are administered to the user based on the stimulation pattern. Termination conditions for these rounds are determined to avoid unnecessary overstimulation. The stimulation effect score is used as the termination condition. If the stimulation effect score is not less than the set target score, and the scores for three consecutive rounds are not less than the set target score, then sleep quality is considered satisfactory, and the multiple rounds of TCD stimulation are terminated. The target score is determined based on statistical data of stimulation effects from a clinically normal sleep population. The mean score for 500 normal sleep individuals is 26 points, with a standard deviation of 2 points. To ensure stable and satisfactory stimulation effects, the target score is set as the mean minus the standard deviation, i.e., 24 points. For example, if a user's stimulation effect scores for three consecutive rounds during deep sleep are 27, 28.5, and 29 points respectively, all ≥24 points, and their self-satisfaction with sleep quality is 8.5 points, then sleep quality is considered satisfactory, and the multiple rounds of TCD stimulation are terminated.
[0140] If, during multiple rounds of transcranial alternating current (TAC) stimulation, the stimulation parameter set needs to be reset multiple times, but the score of the stimulation effect after the reset is less than the set target score, then the current stimulation mode is deemed ineffective for the user. The multiple rounds of TAC stimulation are then terminated, and the user's relevant data is recorded. For example, if a user's stimulation effect scores in the light sleep stage are 20, 21, and 19 after five resets of the stimulation parameter set, all less than 24, and their sleep self-satisfaction score is 6, then the current stimulation mode is deemed ineffective, the multiple rounds of stimulation are terminated, and the data is recorded. Simultaneously, the time window for each round of TAC stimulation is set to 20-30 minutes, such as 25 minutes for the light sleep stage, 30 minutes for the deep sleep stage, and 20 minutes for the REM sleep stage. This helps to stably observe the stimulation effect and matches it with the brain's sleep cycle and physiological regulatory rhythm, thereby improving the effectiveness and safety of the stimulation.
[0141] Specifically, the logic for resetting the generation stimulus parameter set includes:
[0142] After each round of transcranial alternating current stimulation, the change in the feature vector set is extracted by calculating the Euclidean distance before and after stimulation.
[0143] Synchronously monitor the changes in the user's metabolic rate, configure the change threshold and the magnitude threshold. If the change in the feature vector group is greater than the change threshold and the change in the user's metabolic rate is greater than the magnitude threshold, then trigger the reset and generation of the stimulus parameter group.
[0144] A reset signal is generated and transmitted to the parameter optimization module to reset the generated stimulus parameter set.
[0145] The feature vector set comprehensively reflects the neural activity characteristics of the brain during sleep. Transcranial alternating current stimulation (TAC) aims to regulate brain neural activity to improve sleep quality. Calculating the change in the feature vector set before and after stimulation can intuitively quantify the impact of stimulation on brain neural activity patterns. If the change exceeds a certain range, it indicates that the current stimulation parameter set is not accurately adapted to the user's physiological state, and it is necessary to reset and optimize the stimulation parameter set to improve the stimulation effect and better meet user needs. Before each round of TAC stimulation, the complete feature vector set at the current moment is obtained from the feature analysis module. After the stimulation ends, the feature vector set at this time is obtained again from the feature analysis module. The Euclidean distance between the feature vector sets before and after stimulation is calculated using the Euclidean distance formula. The resulting Euclidean distance value is the change in the feature vector set. This clearly presents the change in brain neural activity characteristics caused by stimulation in a quantitative way. This change serves as key data, providing a basis for subsequent comparison with set thresholds and determining whether to trigger the reset and generation of stimulation parameter sets. Accurate calculation of the change can keenly capture the adaptation deviation between the stimulation parameter set and the user's physiological state, prompting the system to adjust the stimulation parameter set in a timely manner and improve the accuracy and effectiveness of the sleep quality monitoring system.
[0146] The user's metabolic rate reflects their physiological activity level and energy consumption. During transcranial alternating current stimulation, changes in the user's metabolic rate can indirectly reflect the body's overall response to the stimulation. By combining the changes in the feature vector set and the amplitude of changes in the user's metabolic rate, the stimulation effect can be comprehensively evaluated from two levels: brain neural activity and overall physiological state. Setting thresholds for the amount of change and the amplitude provides objective and quantitative standards for judgment. When both exceed the thresholds, it strongly indicates that the current stimulation parameter set is no longer able to adapt to changes in the user's physiological state and it is urgent to reset the stimulation parameter set to maintain the safety and effectiveness of the stimulation.
[0147] The magnitude of change in user metabolic rate is obtained by comparing the difference between the user's metabolic rate before and after stimulation with the user's metabolic rate before stimulation. Based on a large amount of experimental data and actual test results from multiple groups of different users, appropriate thresholds for change and magnitude are determined through repeated optimization via statistical analysis. For example, based on 1,000 rounds of transcranial alternating current stimulation test data completed within 3 months by 200 subjects of different ages (18-60 years old) and different sleep conditions (normal sleep, mild insomnia, moderate insomnia), the data covers indicators such as feature vector groups and metabolic rate before and after stimulation.
[0148] Normal distributions were fitted to the changes and amplitudes of feature vector groups in all test data. The upper limit of the 95% confidence interval was taken as the threshold to ensure that a reset is triggered only when the user's physiological state shows significant abnormal changes, thus avoiding false triggers. Through 100 rounds of cross-validation, the false trigger rate of this threshold combination was less than 3%, and the missed trigger rate was less than 2%, which meets the reliability requirements of the system's adaptive adjustment. Finally, the change threshold was 0.7, corresponding to the judgment criterion of significant changes in neural activity characteristics, and the amplitude threshold was 15%, corresponding to the judgment criterion of significant fluctuations in the overall physiological state.
[0149] The calculated change in the feature vector set is compared with a change threshold, and the magnitude of the change in the user's metabolic rate is compared with an magnitude threshold. If the change in the feature vector set is greater than the change threshold and the magnitude of the change in the user's metabolic rate is greater than the magnitude threshold, then a reset and generation of the stimulus parameter set is immediately triggered. For example, the feature vector set before stimulation is [0.3, 0.5, 0.2, 0.4, 0.6, 0.3, 0.5, 0.2, 0.4, 0.3], and the user's metabolic rate is 1200 kcal / day; the feature vector set after stimulation is [0.3, 0.5, 0.2, 0.4, 0.3], and the user's metabolic rate is 1200 kcal / day. The feature vector group = [0.8, 0.1, 0.7, 0.2, 0.1, 0.8, 0.2, 0.7, 0.1, 0.8], and the user's metabolic rate is 1410 kcal / day; the change in the feature vector group = √{(0.8-0.3)^2+(0.1-0.5)^2+…+(0.8-0.3)^2}≈1.2, which is greater than the change threshold of 0.7; the change amplitude of metabolic rate = (1410-1200) / 1200×100%=17.5%, which is greater than the amplitude threshold of 15%.
[0150] Since both indicators exceed the corresponding thresholds, a reset is immediately triggered to generate the stimulation parameter set. After receiving the reset signal, the parameter optimization module re-selects and adjusts the stimulation parameters, such as adjusting the stimulation frequency from 2Hz to 1.5Hz and the stimulation intensity from 0.8mA to 0.6mA. This improves the accuracy and comprehensiveness of the judgment. Once the triggering conditions are met, the reset process is initiated in a timely manner, providing a clear reset signal to the parameter optimization module, prompting it to regenerate a stimulation parameter set that better matches the user's current physiological state. This ensures the adaptive adjustment capability of the sleep quality monitoring system and continuously provides users with effective sleep improvement stimulation solutions.
[0151] When the judgment indicates that the stimulation parameter set needs to be reset, a reset signal is generated and transmitted to the parameter optimization module. This is a crucial step in enabling the entire system to achieve adaptive adjustment. Based on this reset signal, the parameter optimization module recalculates and filters the stimulation parameters to generate a stimulation parameter set that is more suitable for the user's current physiological state, ensuring that transcranial alternating current stimulation continues to exert its best effect and improve the user's sleep quality. When the triggering conditions are met, the signal generation program is automatically triggered, thereby quickly and effectively notifying the parameter optimization module to start the reset process, rapidly recalculate the individual stimulation threshold, filter the transcranial alternating current stimulation parameters, and generate a new stimulation parameter set. This allows the system to respond promptly to changes in the user's physiological state, adjust the stimulation plan, maintain the efficient operation of the sleep quality monitoring system, and continuously provide users with personalized and precise sleep improvement services.
[0152] The dual-loop feedback module is used to comprehensively determine whether stimulation tolerance has occurred based on the changes in the feature vector group, the magnitude of changes in the user's metabolic rate, and the stimulation effect. If stimulation tolerance occurs, the stimulation mode and individual stimulation threshold are adjusted.
[0153] Specifically, the logic for judging stimulus tolerance includes:
[0154] Stimulus tolerance is obtained by weighting the changes in the feature vector group and the changes in the user's metabolic rate.
[0155] The stimulus effect The rate of change of wave power and the number of times the user aroused were weighted to obtain a score of the stimulus effect;
[0156] Configure a tolerance threshold, compare the stimulus tolerance with the tolerance threshold, and combine the stimulus effect score to make a comprehensive judgment on stimulus tolerance.
[0157] If the stimulus tolerance is greater than the tolerance threshold and the stimulus effect score decreases repeatedly, then the user is considered to have developed stimulus tolerance.
[0158] If the user develops stimulus tolerance, the stimulus pattern is adjusted and the stimulus effect is monitored. If the stimulus effect score improves, the adjustment is effective.
[0159] If the stimulus effect score decreases repeatedly, the adjustment is ineffective. The individual stimulus threshold should be readjusted to adjust the stimulus parameter set, and the stimulus effect should be monitored until the adjustment is effective.
[0160] The changes in the feature vector group reflect the degree to which brain neural activity is affected by stimulation, while the changes in the user's metabolic rate reflect the body's overall physiological state in response to stimulation. Different users' tolerance to transcranial alternating current stimulation is reflected in their neural activity and overall physiological state. By weighted calculation, these two key factors can be integrated to obtain the stimulation tolerance, which can comprehensively and individually assess the user's tolerance to stimulation and provide core data for accurate determination of stimulation tolerance in the future.
[0161] Before and after each round of transcranial alternating current stimulation, the changes in the feature vector group and the magnitude of changes in the user's metabolic rate were recorded. The model was trained using cross-validation, a machine learning technique, combined with historical data from a large number of different users. The dataset was divided into training and test sets. Different weight combinations were tested in the training set, with the weights summed to 1. Gradient descent was used to adjust the weights to maximize the model's accuracy in judging known stimulation tolerance on the test set. After multiple experiments, the weight for the change in the feature vector group was determined to be 0.6, and the weight for the magnitude of changes in the user's metabolic rate was determined to be 0.4. This weight combination is suitable for ordinary users of all ages. Stimulation tolerance = change in feature vector group × 0.6 + magnitude of change in user's metabolic rate × 0.4. For example, if a user's feature vector group change is 1.2 and the user's metabolic rate change is 17.5% during the current stimulation cycle, the stimulation tolerance is calculated as 1.2 × 0.6 + 17.5% × 0.4 = 0.72 + 0.07 = 0.79.
[0162] This quantitative indicator can comprehensively reflect the tolerance of brain neural activity and the body's overall physiological state to stimuli. It provides a key data foundation for subsequent comparison with tolerance thresholds and comprehensive judgment based on stimulus effect scores, making the judgment process more scientific and comprehensive. Accurate calculation of stimulus tolerance helps to discover the user's tolerance trend to stimuli in a timely manner, providing a strong basis for adjusting stimulation patterns or individual stimulation thresholds.
[0163] The rate of change in wave power and the number of user awakenings are important indicators for measuring the impact of transcranial alternating current stimulation on sleep quality. Increased wave power is generally associated with improved sleep depth, while a decrease in awakenings directly reflects improved sleep stability. Different users have varying sensitivities to these two indicators. Weighted calculations can comprehensively assess the stimulus effect based on individual circumstances, providing a more realistic score for determining stimulus tolerance and accurately judging whether the stimulus has achieved the expected effect. Through the above-mentioned... The rate of change in wave power and the number of user awakenings are determined by referring to the aforementioned relationship between sleep stages and stimulation patterns to obtain a stimulus effect score. Here, the number of awakenings needs to be reversed because an increase in the number of awakenings indicates a decrease in sleep quality. The rate of change of wave power has an opposite effect on sleep quality; thus, it provides a quantitative and comprehensive indicator for assessing stimulation tolerance. This score, combined with stimulation tolerance, can more comprehensively determine whether the user has developed stimulation tolerance, providing a basis for subsequent adjustment strategies.
[0164] The tolerance threshold is the benchmark for determining whether a user has developed tolerance to stimulation. Stimulation tolerance or stimulation effect scores alone cannot accurately reflect the level of tolerance. Comparing stimulation tolerance with the tolerance threshold and combining it with the stimulation effect score provides a comprehensive and accurate assessment of whether a user has developed tolerance to the current transcranial alternating current stimulation, avoiding misjudgment and providing a basis for subsequent adjustments to the stimulation pattern or individual stimulation threshold. By statistically analyzing experimental data from 500 users at different stimulation stages, the mean and standard deviation of all data are calculated to obtain the tolerance threshold. For example, the data on stimulation tolerance from 500 users at different stimulation stages shows a mean of 0.8 and a standard deviation of 0.2, therefore the tolerance threshold = 0.8 + 0.2 = 1.0.
[0165] When stimulation tolerance exceeds the tolerance threshold and the stimulation effect score decreases consecutively (e.g., three times), the user is considered to have developed stimulation tolerance. This allows for accurate identification of the user's stimulation tolerance status. Once stimulation tolerance is determined, an adjustment strategy is initiated promptly, i.e., adjusting the stimulation mode or individual stimulation threshold. For example, changing the stimulation mode from a 1Hz square wave to a 2Hz sine wave, and monitoring shows that the stimulation effect score rises to 27.0 points, the adjustment is deemed effective, and the new stimulation mode is continued. If the score continues to decline after adjustment, the individual stimulation threshold is lowered from 1.2mA to 0.9mA, and a new stimulation parameter set is generated until the stimulation effect score recovers to above the target score, thus maintaining the stimulation effect, improving sleep quality, and helping the system adaptively optimize the stimulation program, thereby enhancing the adaptability of the sleep quality monitoring system to individual user differences and long-term use.
[0166] When it is determined that the user has developed stimulation tolerance, a new mode is selected from the stimulation mode library. If the current mode has a stimulation frequency of 1Hz, a stimulation intensity of 0.5mA, and a stimulation duration of 20 minutes, it is switched to a mode with a stimulation frequency of 2Hz, a stimulation intensity of 0.6mA, and a stimulation duration of 25 minutes. After adjusting the stimulation mode, continuous monitoring is performed. The rate of change of wave power and the number of user arousals are used to calculate the score of the stimulus effect based on the aforementioned method. Every 3 rounds of stimulation are set as the judgment cycle. If the score increases, the adjustment is effective. If it decreases for 3 consecutive times, the adjustment is ineffective. If the adjustment of the stimulation mode is ineffective, the user's metabolic rate, heart rate variability and stimulation intensity are obtained to readjust the individual stimulation threshold. The stimulation parameter set is readjusted with the new individual stimulation threshold as a constraint, and the stimulation effect is monitored again until the adjustment is effective.
[0167] Example 2
[0168] like Figure 4 The diagram shown is a flowchart of a non-invasive method for monitoring user sleep quality, as provided in this application embodiment. The method includes:
[0169] Acquire EEG signals, extract the spatiotemporal features of the EEG signals, and generate feature vector sets by connecting the spatiotemporal features of the EEG signals based on graph neural networks;
[0170] Calculate the similarity between the feature vector set and the transcranial alternating current stimulation parameters to generate the stimulation parameter set;
[0171] Adjust individual stimulation thresholds based on user metabolic rate and heart rate variability, and adjust stimulation parameter groups based on individual stimulation thresholds;
[0172] The stimulus signal waveform is determined based on the stimulus parameter set, and the phase coherence across brain regions is received to intervene in the stimulus signal waveform.
[0173] The relationship between sleep stages and stimulation patterns is determined based on feature vector sets and individual stimulation thresholds, and multiple rounds of transcranial alternating current stimulation are performed on users according to the stimulation patterns.
[0174] After each round of transcranial alternating current stimulation, the change in the feature vector set is extracted, and the change in the feature vector set and the change in the user's metabolic rate are used to determine whether to reset the generation of stimulation parameter set.
[0175] Based on the changes in the feature vector group, the magnitude of changes in the user's metabolic rate, and the stimulus effect, a comprehensive judgment is made as to whether stimulus tolerance has occurred. If stimulus tolerance has occurred, the stimulus mode and individual stimulus threshold are adjusted.
[0176] Since the principle of the method in this application embodiment is similar to that of the system described in this application embodiment, the implementation of the method is the same as that of the system, and the repeated parts will not be described again.
Claims
1. A non-invasive user sleep quality monitoring system, characterized in that, include: Feature parsing module, parameter optimization module, phase synchronization module, and dual-loop feedback module; The feature parsing module is used to acquire EEG signals, extract the spatiotemporal features of EEG signals, and generate feature vector sets by connecting the spatiotemporal features of EEG signals based on graph neural networks. The parameter optimization module is used to calculate the similarity between the feature vector set and the transcranial alternating current stimulation parameters, generate a stimulation parameter set, and adjust the individual stimulation threshold and stimulation parameter set according to the user's metabolic rate and heart rate variability. The phase synchronization module is used to determine the stimulation signal waveform based on the stimulation parameter set, and to receive phase coherence across brain regions to intervene in the stimulation signal waveform. Based on the feature vector set and individual stimulation threshold, it determines the relationship between sleep stage and stimulation pattern, and performs multiple rounds of transcranial alternating current stimulation on the user according to the stimulation pattern. After each round of transcranial alternating current stimulation, the change in the feature vector set is extracted, and the change in the feature vector set and the change in the user's metabolic rate are used to determine whether to reset the generation of stimulation parameter set. The dual-loop feedback module is used to determine whether stimulation tolerance has occurred based on the changes in the feature vector group, the magnitude of changes in the user's metabolic rate, and the stimulation effect, so as to adjust the stimulation mode and individual stimulation threshold.
2. The non-invasive user sleep quality monitoring system as described in claim 1, characterized in that, The logic for generating the feature vector group includes: Acquire EEG signals and preprocess them; Extracting the spatiotemporal features of EEG signals, which include... The spatiotemporal distribution of wave power Wave power ratio and phase coherence across brain regions; Construct a graph structure, determine the nodes and edges of the graph structure, input the graph structure into a graph neural network, update the nodes through convolution operations, output the feature vector of each node, and combine the feature vectors of all nodes to generate a feature vector group.
3. The non-invasive user sleep quality monitoring system as described in claim 2, characterized in that, The logic for generating the stimulus parameter set includes: The parameters of transcranial alternating current stimulation are encoded and converted into stimulation feature vectors; The distance between the feature vector set and the stimulus feature vector is calculated using Mahalanobis distance. The distance between the feature vector group and the stimulus feature vector is normalized and converted into the similarity between the feature vector group and the stimulus feature vector. A similarity threshold is configured. If the similarity between the feature vector group and the stimulus feature vector is greater than the similarity threshold, the transcranial alternating current stimulation parameters are included in the stimulation parameter group. If the similarity between the feature vector group and the stimulus feature vector is not greater than the similarity threshold, the transcranial alternating current stimulation parameters will be screened out. The transcranial alternating current stimulation parameters include stimulation frequency, stimulation intensity, and stimulation duration.
4. The non-invasive user sleep quality monitoring system as described in claim 3, characterized in that, The adjustment logic for the stimulation parameter set includes: Obtain user metabolic rate and heart rate variability, correlate user metabolic rate and heart rate variability to calculate dynamic safety factor, and determine the safe range of stimulation intensity; Individual stimulation thresholds are adjusted based on user metabolic rate, heart rate variability, and stimulation intensity. With the stimulus effect as the objective and the individual stimulus threshold as a constraint, the stimulus parameter set is iteratively adjusted, where the stimulus effect includes... The rate of change of wave power and the number of times the user is awakened.
5. A non-invasive user sleep quality monitoring system as described in claim 4, characterized in that, The intervention logic of the stimulation signal waveform includes: Receive phase coherence across brain regions and analyze the phase difference between different brain regions in real time; The compensation speed is adjusted based on the user's metabolic rate, and the phase of the stimulus signal is compensated according to the compensation speed and the phase difference of each brain region. Adjust the phase of the stimulus signal based on the individual's stimulus threshold.
6. The non-invasive user sleep quality monitoring system as described in claim 5, characterized in that, The logic for determining the relationship between sleep stages and stimulation patterns includes: The feature vector set is fused with the individual stimulus threshold to generate sleep stage features, and the sleep stage features are then subjected to cluster analysis to obtain the clustering results of the sleep stages. The stimulation pattern is determined based on the combination of stimulation parameter sets and stimulation signal waveforms. Stimulation patterns were simulated at different sleep stages, and the effects of the stimulation were monitored to evaluate the effectiveness of the stimulation patterns. Based on the clustering results of sleep stages and the effects of stimulation patterns, the relationship between sleep stages and stimulation patterns is determined.
7. A non-invasive user sleep quality monitoring system as described in claim 6, characterized in that, The logic for resetting the stimulus parameter set includes: After each round of transcranial alternating current stimulation, the change in the feature vector set is extracted by calculating the Euclidean distance before and after stimulation. Synchronously monitor the changes in the user's metabolic rate, configure the change threshold and the magnitude threshold. If the change in the feature vector group is greater than the change threshold and the change in the user's metabolic rate is greater than the magnitude threshold, then trigger the reset and generation of the stimulus parameter group. A reset signal is generated and transmitted to the parameter optimization module to reset the generated stimulus parameter set.
8. A non-invasive user sleep quality monitoring system as described in claim 7, characterized in that, The logic for determining stimulus tolerance includes: Stimulus tolerance is obtained by weighting the changes in the feature vector group and the changes in the user's metabolic rate. The stimulus effect The rate of change of wave power and the number of times the user aroused were weighted to obtain a score of the stimulus effect; Configure a tolerance threshold, compare the stimulus tolerance with the tolerance threshold, and combine the stimulus effect score to make a comprehensive judgment on stimulus tolerance.
9. A non-invasive user sleep quality monitoring system as described in claim 2, characterized in that, The nodes in the graph structure represent the spatiotemporal characteristics of EEG signals from different brain regions, and the edges in the graph structure represent the functional relationships between brain regions.