Sleep aiding method, sleep aiding sound box, program product and storage medium
By collecting information on users' physiological, activity, and environmental characteristics, and using a strategy selection model to generate personalized sleep-aid strategies, the problem of existing devices being unable to dynamically adjust is solved, thus achieving a highly efficient improvement in sleep quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-14
- Publication Date
- 2026-03-10
AI Technical Summary
Existing sleep aids are unable to dynamically adjust their sleep strategies based on changes in the user's physiological state and sleep environment, resulting in an inability to meet personalized sleep needs and making users easily disturbed by external noise or unable to fall asleep effectively.
By collecting information on users' physiological, activity, and environmental characteristics, a strategy selection model is used to generate personalized sleep-aid strategies, including audio type, parameters, and anti-interference measures. The strategies are then monitored and adjusted in real time to adapt to changes in user status and environment.
It enables real-time adjustments based on the user's physiological state and environmental changes, improving the accuracy and adaptability of the sleep aid effect and ensuring continuous optimization of sleep quality.
Smart Images

Figure CN121623097A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of sleep aids, and more particularly to a sleep aid method, a sleep aid speaker, a program product, and a storage medium. Background Technology
[0002] With the fast pace of modern life and increasing work pressure, sleep quality has become a growing concern. Good sleep not only helps the body recover energy and boost immunity, but also improves work efficiency and quality of life. Therefore, how to help users achieve quality sleep has become an important research topic.
[0003] Currently, most sleep aid devices on the market help users fall asleep by playing preset sleep-inducing audio. These devices typically have multiple built-in types of sleep-inducing audio, such as white noise, natural sounds, and music. Users can choose the audio type and volume according to their personal preferences, and the device will play the audio for a fixed duration.
[0004] However, due to differences in each user's physiological state and sleep habits, and the fact that the sleep environment can change at any time, a fixed sleep aid plan may not meet the user's actual needs. For example, when a user is in a light sleep state, a sudden external noise may wake the user up; or when a user is energetic, simple white noise may not be able to help the user fall asleep effectively. Summary of the Invention
[0005] This application provides a sleep aid method, a sleep aid speaker, a program product, and a storage medium to improve the adaptability of sleep aid solutions to user needs.
[0006] In a first aspect, this application provides a sleep aid method applied to a sleep aid speaker. The method includes: collecting physiological and activity characteristic information of a target user; determining the current sleep stage of the target user based on the physiological characteristic information; predicting the sleep demand level of the target user based on the activity characteristic information; inputting the sleep stage and sleep demand level as parameters into a strategy selection model to obtain a current sleep aid strategy, which includes audio type, audio parameters, and anti-interference measures; controlling the sleep aid speaker to execute the current sleep aid strategy, which includes audio type, audio parameters, and anti-interference measures; and controlling the sleep aid speaker to execute the current sleep aid strategy.
[0007] By employing the above technical solution, the sleep stage is determined based on the target user's physiological characteristics, and the degree of sleep need is predicted by combining activity characteristics. This multi-dimensional information is then input into a strategy selection model to generate a sleep-aid strategy that includes audio type and parameters. When the sleep-aid speaker executes this strategy, the audio output matches the user's physiological state, making the sleep-aid effect more precise and controllable, improving sleep quality, and achieving personalized sleep assistance that is tailored to the individual and dynamically intelligent.
[0008] In conjunction with some embodiments of the first aspect, in some embodiments, the step of predicting the sleep needs of a target user based on the activity feature information specifically includes: obtaining activity feature information of the target user within a preset time period, the activity feature information including the target user's sleep schedule, exercise volume, and daily routine; calculating the target user's average sleep duration and sleep regularity index based on the sleep schedule, the sleep regularity index being determined based on the fluctuation of sleep duration within the preset time period; calculating the target user's average daily physical exertion level based on the exercise volume; and inputting the average sleep duration, the sleep regularity index, the physical exertion level, and the activity information of the next day into a sleep needs prediction model to obtain the sleep needs of the target user.
[0009] By employing the aforementioned technical solutions, information on the target user's daily routine, activity level, and schedule within a preset time period is obtained. Average sleep duration and sleep regularity index are calculated, and physical exertion level is derived based on activity level. This data serves as input to the sleep demand prediction model, reflecting the user's daily routine, physical exertion, and the next day's activity plan. The sleep demand prediction model comprehensively analyzes these factors and outputs a quantitative assessment of sleep demand, enabling sleep aid strategies to accurately grasp the intensity of the user's actual sleep needs.
[0010] In conjunction with some embodiments of the first aspect, in some embodiments, the step of identifying sleep disturbance factors based on the environmental feature information specifically includes: collecting environmental parameters of the environment where the target user is located, wherein the environmental parameters are one or more of noise signals, light signals, air quality information, and temperature information; performing spectral analysis on the environmental parameters to obtain noise intensity in different frequency bands; matching the noise intensity in different frequency bands based on a preset noise feature library to obtain the noise source type; detecting the intensity change trend of the environmental parameters to determine whether there is periodic light interference within a preset distance of the target user, and obtaining the light interference result; determining the environmental interference level according to the noise source type and the light interference result; and when the environmental interference level exceeds a preset interference threshold, marking the noise source type or the light interference result as a sleep disturbance factor.
[0011] By employing the above technical solution, the sleep aid speaker can accurately identify the noise intensity of different frequency bands by collecting environmental parameters and performing spectrum analysis. It then determines the specific noise source type by matching it with a preset noise feature database. Simultaneously, the system monitors the intensity trends of environmental parameters, effectively identifying periodic light interference. Based on the environmental interference level calculated from the noise source type and light interference results, the system automatically marks the corresponding interference factors when they exceed a preset threshold, providing reliable data support for subsequent anti-interference measures.
[0012] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of controlling the sleep aid speaker to execute the current sleep aid strategy, the method further includes: when physiological characteristic information, activity characteristic information, or environmental characteristic information changes, acquiring physiological characteristic change information, activity characteristic change information, and environmental characteristic change information of the target user; inputting the physiological characteristic change information, the activity characteristic change information, and the environmental characteristic change information as parameters into the strategy selection model to obtain a changing sleep aid strategy; and controlling the sleep aid speaker to execute the changing sleep aid strategy.
[0013] By employing the above technical solution, while executing the current sleep-aid strategy, changes in physiological, activity, and environmental characteristics are continuously monitored. Once a change is detected, the corresponding information is immediately acquired and used as parameters to re-input the strategy selection model, generating an updated sleep-aid strategy. The sleep-aid speaker then executes the new strategy, enabling the sleep-aid process to respond promptly to dynamic changes in the user's state and environment. The entire process forms a closed-loop real-time feedback mechanism, ensuring that the sleep-aid strategy remains synchronized with the user's current state.
[0014] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of controlling the sleep aid speaker to execute the current sleep aid strategy, the method further includes: acquiring brainwave frequency information of the target user; generating a frequency adjustment scheme based on the brainwave frequency information, the frequency adjustment scheme including a target frequency value and a frequency adjustment step size; and updating the audio parameters in the sleep aid strategy according to the frequency adjustment scheme.
[0015] By employing the above technical solution, brainwave frequency information of the target user is acquired during the implementation of the sleep-aid strategy, and a frequency adjustment scheme containing the target frequency value and adjustment step size is generated accordingly. Audio parameters are dynamically updated based on this adjustment scheme, so that the frequency of the played audio resonates with the user's brainwave frequency. The frequency adjustment scheme guides the user's brainwave frequency to gradually transition towards a sleep state by precisely controlling the rate and amplitude of change in the audio parameters.
[0016] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of controlling the sleep aid speaker to execute the current sleep aid strategy, the method further includes: detecting the audio output channel status of the sleep aid speaker; determining an audio channel configuration scheme based on the sleep stage of the target user, the audio channel configuration scheme including volume parameters and audio clarity parameters; adjusting the output of the sleep aid speaker according to the audio channel configuration scheme; collecting the physiological characteristic information of the target user in real time; and dynamically updating the audio channel configuration scheme according to the changing trend of the physiological characteristic information.
[0017] By employing the above technical solution, the audio output channel status of the sleep aid speaker is monitored in real time. The audio channel configuration is determined based on the user's sleep stage, precisely controlling volume and audio clarity parameters to match the audio output with the user's sleep stage. The system continuously collects user physiological characteristic information and dynamically updates the configuration based on its changing trends, achieving real-time synchronization between audio output and the user's physiological state. This sleep stage-based adaptive audio channel adjustment mechanism ensures optimal output of sleep aid audio at different sleep stages, effectively improving the comfort of the sleep aid experience.
[0018] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of controlling the sleep aid speaker to execute the current sleep aid strategy, the method further includes: obtaining the target wake-up time set by the target user; determining the sleep stage of the target user based on the physiological characteristic information; generating a wake-up execution plan according to the sleep stage, the wake-up execution plan including the target wake-up time and wake-up audio parameters; and controlling the sleep aid speaker to execute a wake-up operation according to the wake-up execution plan.
[0019] By employing the aforementioned technical solution, the system obtains the user-set target wake-up time and, combined with real-time monitored physiological characteristics, determines the user's sleep stage. Based on this, it generates a wake-up execution plan that includes the wake-up time and audio parameters. This plan, based on sleep cycle patterns, selects the most suitable wake-up time and gradually wakes the user through carefully designed audio parameters. The sleep aid speaker adjusts its audio output according to the execution plan, gently adjusting the user's circadian rhythm during the pre-wake phase, and then using optimized acoustic stimulation to naturally wake the user during the main wake-up phase.
[0020] In conjunction with some embodiments of the first aspect, in some embodiments, after controlling the sleep aid speaker to execute the current sleep aid strategy, the method further includes: collecting physiological characteristic information, activity characteristic information, and environmental characteristic information of the target user; determining the current sleep stage of the target user based on the physiological characteristic information; predicting the sleep demand level of the target user based on the activity characteristic information; identifying sleep disturbance factors of the target user based on the environmental characteristic information; inputting the sleep stage, sleep demand level, and sleep disturbance factors as parameters into a strategy selection model to obtain a target sleep aid strategy, the target sleep aid strategy including audio type, audio parameters, and anti-interference measures; and controlling the sleep aid speaker to execute the target sleep aid strategy.
[0021] By adopting the above technical solution, the sleep aid speaker establishes a continuously optimized dynamic adjustment mechanism. After executing the initial sleep aid strategy, it continues to collect information on the user's physiological, activity, and environmental characteristics, and updates the user's sleep stage, need level, and interfering factors in real time. By re-inputting these updated parameters into the strategy selection model, a more precise target sleep aid strategy can be generated, thereby achieving dynamic optimization and adjustment of the sleep aid plan and ensuring continuous improvement in sleep aid effectiveness.
[0022] In conjunction with some embodiments of the first aspect, in some embodiments, the hardware configuration of the sleep aid speaker includes: sound volume adjustment, resonant frequency, audio control, sensor, and alarm clock.
[0023] By adopting the above technical solution, the sleep aid speaker integrates multiple functional modules such as sound volume adjustment, resonant frequency, audio control, sensors, and alarm clock, forming a complete hardware support system. These hardware modules work together to enable the sleep aid speaker to fully execute various sleep-aid strategies defined by the system, achieving complete closed-loop control from environmental perception to strategy execution.
[0024] In a second aspect, embodiments of this application provide a sleep aid speaker, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the sleep aid speaker to perform the method described in the first aspect and any possible implementation thereof.
[0025] It is understood that the sleep aid speakers provided in the second aspect above are all used to perform the methods provided in the embodiments of this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.
[0026] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0027] 1. This application determines the sleep stage based on the target user's physiological characteristics and predicts the degree of sleep need by combining activity characteristics. This multi-dimensional information is then input into a strategy selection model to generate a sleep-aid strategy that includes audio type and parameters. When the sleep-aid speaker executes this strategy, the audio output matches the user's physiological state, making the sleep-aid effect more precise and controllable, improving sleep quality, and achieving personalized sleep aid that is individualized, intelligent, and dynamic.
[0028] 2. This application obtains activity characteristics information of target users within a preset time period, such as their sleep schedule, exercise volume, and daily routine, calculates average sleep duration and sleep regularity index, and derives physical exertion level based on exercise volume. This data serves as input to a sleep demand prediction model, reflecting the user's sleep patterns, physical exertion, and the next day's activity plan. The sleep demand prediction model comprehensively analyzes these factors and outputs a quantitative assessment of sleep demand, enabling sleep aid strategies to accurately grasp the intensity of the user's actual sleep needs.
[0029] 3. This application continuously monitors changes in physiological, activity, and environmental characteristics while executing the current sleep-aid strategy. Upon detecting a change, it immediately acquires the corresponding information and re-inputs this real-time information as parameters into the strategy selection model to generate an updated sleep-aid strategy. The sleep-aid speaker then executes the new strategy, ensuring the sleep-aid process responds promptly to dynamic changes in the user's state and environment. This entire process forms a closed-loop real-time feedback mechanism, ensuring the sleep-aid strategy remains synchronized with the user's current state. Attached Figure Description
[0030] Figure 1 This is a flowchart illustrating a sleep-aiding method in an embodiment of this application;
[0031] Figure 2 This is another flowchart illustrating the sleep-aiding method in the embodiments of this application;
[0032] Figure 3 This is another flowchart illustrating the sleep-aiding method in the embodiments of this application;
[0033] Figure 4 This is a schematic diagram of the physical device structure of a sleep aid speaker in the embodiments of this application. Detailed Implementation
[0034] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions “a,” “an,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.
[0035] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0036] It should be noted that the sleep aid speaker in this embodiment is used to be placed under the user's pillow, and the hardware configuration of the sleep aid speaker includes:
[0037] The sound volume can be adjusted, the sound can be blurred, and the player / speaker design can use bone conduction or miniature speakers. It utilizes brainwave technology at 3~10Hz, and different hertz differences can produce a sleep-inducing effect on the human body.
[0038] 7.83Hz is the Earth's resonant frequency, a soothing wave, the Earth's frequency, which relaxes the body.
[0039] Audio control guides the body into a sleep state through sound. It uses a certain pattern of changes in volume, vocal tract, and sound clarity (one or more) to induce deep sleep, monitors the body's state in real time, and provides voice guidance.
[0040] Sensors (vibration sensors, sound sensors, temperature sensors, photoelectric sensors, etc.) are used to acquire data parameters of the surrounding environment, such as human body vibration (turning over, rotating), sound detection (breathing, snoring, ambient sounds), body surface temperature, heart rate changes, and pulse changes.
[0041] Temperature / humidity / PM2.5 / brightness sensors, linked with other smart home appliances.
[0042] It has an alarm clock, and sleep is divided into REM (Rapid Eye Movement) and SEM (Slow Eye Movement) phases. It intelligently monitors the body's state and wakes you up during the REM phase, making you feel more energetic.
[0043] For ease of understanding, the method provided in this implementation is described in process below. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating a sleep-aiding method in an embodiment of this application.
[0044] S101. Collect physiological and activity characteristics of the target user.
[0045] Physiological characteristic information refers to various physiological indicators that reflect the user's physical condition, including heart rate, respiratory rate, body temperature, blood pressure, blood oxygen, etc.; activity characteristic information represents the user's daily behavior data, including exercise volume, rest time, work and study intensity, etc.; environmental characteristic information is used to represent various parameters of the user's environment, including temperature, humidity, light, noise, etc.
[0046] This process begins before the user prepares to fall asleep, using various sensors built into the sleep aid speaker to comprehensively monitor the target user. Specifically, the sleep aid speaker collects the user's physiological data through infrared sensors and pressure sensors; acquires activity data through user input and synchronization with devices such as smart bracelets and mobile phones; and collects environmental parameter data through temperature and humidity sensors, light sensors, and microphones, thereby creating a holistic data profile of the user.
[0047] In some embodiments, physiological characteristic information can be collected in the following ways: Optionally, an infrared sensor can be used to scan the user's body surface temperature distribution, a pressure sensor can be used to detect body movement frequency, a photoelectric sensor can be used to monitor blood oxygen saturation, and an electrocardiogram sensor can be used to record heart rate changes; Optionally, data can be synchronized with wearable devices such as smart bracelets or smartwatches worn by the user via wireless communication methods such as Bluetooth to obtain the user's physiological indicator data. It is understood that other sensors or data sources can also be used to obtain the user's physiological characteristic information, and this is not limited here.
[0048] S102. Determine the current sleep stage of the target user based on the physiological characteristic information.
[0049] Among them, sleep stages refer to the different physiological states that the human body experiences during sleep, mainly including the waking period, light sleep period, deep sleep period and REM sleep period; physiological characteristic information represents the user's current physiological indicators and parameters; current state refers to the target user's real-time sleep state.
[0050] This step is executed immediately after acquiring the user's physiological characteristics information, and the sleep stage is determined by analyzing the user's physiological indicators. Specifically, based on a pre-trained sleep stage recognition model, the user's physiological characteristics such as heart rate, respiration, and body movement are taken as input, and the model outputs the user's most likely current sleep stage and its probability distribution, thereby achieving accurate identification of the sleep stage.
[0051] In some embodiments, sleep stage determination can be achieved in the following ways: Optionally, physiological characteristic data is first preprocessed and features are extracted, then input into a sleep staging model trained based on a deep learning algorithm (this model is trained using a large amount of labeled physiological data of sleep stages), and finally the sleep stage is determined based on the model output; Optionally, threshold ranges for various physiological indicators in different sleep stages are set based on medical experience, and the current sleep stage is determined by rule matching. It is understood that other algorithm models or determination methods can also be used to determine sleep stages, and this is not limited here.
[0052] S103. Based on the activity feature information, predict the sleep needs of the target user.
[0053] Among them, the degree of sleep demand refers to the user's current urgency for sleep, which is expressed by quantitative indicators. The higher the value, the stronger the sleep demand. Activity characteristic information represents the user's daily behavior data, including exercise intensity, work duration, cognitive load, etc. Prediction refers to the quantitative assessment of the user's sleep demand based on historical data and current status. Target users refer to specific users who are currently using the sleep aid speaker.
[0054] This step is performed after obtaining complete activity characteristics information, and the assessment is usually completed before the user prepares to fall asleep. Specifically, firstly, statistical analysis is performed on the user's recent activity data, including calculating indicators such as average exercise volume, work / study time, and energy consumption; then, combined with historical data such as the user's work-rest patterns and sleep cycles, the data is input into a pre-trained sleep demand prediction model; finally, based on the prediction results output by the model, the user's current level of sleep demand is determined, and sleep aid strategies are adjusted accordingly.
[0055] In some embodiments, sleep demand can be predicted in several ways: Optionally, firstly, user activity data for the past 7 days, including daily exercise volume, work hours, and cognitive load, is collected; then, an activity intensity score is calculated; next, the user's sleep patterns are analyzed to obtain sleep debt; finally, these features are input into a prediction model trained using a random forest algorithm (this model is trained using a large amount of user activity data and subjective sleep demand scores) to obtain the level of sleep demand. Optionally, firstly, user physical exertion data and cognitive fatigue levels for the day are obtained; then, sleep deprivation time is calculated by combining the user's standard sleep duration; finally, the level of sleep demand is comprehensively assessed through a weighted calculation. It is understood that other data analysis methods or model algorithms can also be used to predict sleep demand, and this is not limited here.
[0056] S104. Input the sleep stage and sleep demand level as parameters into the strategy selection model to obtain the current sleep aid strategy. The current sleep aid strategy includes audio type, audio parameters and anti-interference measures.
[0057] Among them, sleep stage refers to the user's current physiological state, including wakefulness, falling asleep, light sleep, and deep sleep; sleep demand level refers to the user's current urgent need for sleep; strategy selection model refers to the algorithm model that generates personalized sleep aid solutions based on multi-dimensional input; sleep aid strategy includes specific execution parameters; audio type refers to the basic category of sound; audio parameters include volume and frequency characteristics; and anti-interference measures refer to specific solutions for suppressing environmental interference.
[0058] This step is executed after acquiring user status and environmental information to generate a personalized sleep aid plan. Specifically, the sleep aid speaker normalizes the sleep stage (represented by integers from 0 to 3) and sleep demand level (scores from 0 to 100) and inputs them into a pre-trained strategy selection model. This model is based on a deep learning algorithm and learns the optimal sleep aid strategy by analyzing a large amount of user data. The model output includes: audio type classification results (such as natural sound, white noise, etc.), specific values of audio parameters (such as volume, frequency, etc.), and corresponding anti-interference measures (such as noise reduction, dimming, etc.). The sleep aid speaker organizes these outputs into a complete sleep aid strategy for subsequent execution control.
[0059] In some embodiments, strategy generation can be achieved as follows: Optionally, the input features are first normalized, the sleep stage is encoded as a one-hot vector, and the sleep demand level is scaled to the [0, 1] interval. Then, the processed features are input into a multi-task learning model based on a deep neural network, which includes a shared feature extraction layer and dedicated task branches. Finally, an audio type is selected using a softmax classifier, audio parameters are predicted using a regressor, and anti-interference measures are determined using a binary classifier. Optionally, a rule-based decision tree is first constructed, with the sleep stage as the primary branch condition, the sleep demand level as the secondary branch condition, and interfering factors as leaf node judgment conditions. Then, the decision tree is traversed to obtain the initial strategy selection. Finally, a feedback adjustment algorithm is used to optimize the strategy parameters, dynamically adjusting the parameter weights based on historical execution results. It is understood that other machine learning algorithms or heuristic methods can also be used to generate sleep-aid strategies, which are not limited here.
[0060] The sleep aid strategy includes audio type, audio parameters, and anti-interference measures. Audio type refers to the type of sound selected based on the sleep stage and the degree of sleep need. Audio parameters include various parameter settings for fine-tuning the audio type. The specific parameter selection and adjustment scheme of the sleep aid strategy are dynamically generated by the strategy selection model based on the real-time status. The strategy selection model is trained using a deep learning algorithm. The input of the model includes the sleep stage and the degree of sleep need, and the output includes the specific scheme of the above-mentioned audio type selection and audio parameter setting values.
[0061] The training data for the strategy selection model was collected from clinical sleep monitoring data, user usage data, environmental monitoring data, and sleep aid effect data. Specifically, the clinical sleep monitoring data included polysomnography data annotated by professional physicians; the user usage data included user interaction data and effect feedback; the environmental monitoring data included records of sleep environment parameters; and the sleep aid effect data included strategy execution records.
[0062] The strategy selection model employs a deep neural network architecture, including a feature extraction layer and a multi-task branching layer. The feature extraction layer consists of three fully connected layers with 512, 256, and 128 nodes respectively. The multi-task branching layer includes an audio type classification branch, a parametric regression branch, and an anti-interference measure classification branch. Model training utilizes a phased training strategy, combining cross-entropy loss and mean squared error loss in the loss function, and is optimized using the Adam optimizer.
[0063] The model achieves 92% accuracy in audio type classification on the validation set, with an average relative error of less than 5% in parameter prediction. The model is continuously optimized through an online update mechanism, including collecting user feedback data, regular retraining, and incremental learning.
[0064] S105. Control the sleep aid speaker to execute the current sleep aid strategy.
[0065] Among them, "sleep-aid speaker" refers to a smart speaker device with sleep-aid function; "control" refers to the adjustment and operation of the device's functions; "execution" refers to the transformation of sleep-aid strategy into specific device actions; and "current sleep-aid strategy" refers to a personalized sleep-aid plan generated based on the user's real-time status.
[0066] This step is executed immediately after the sleep-aid strategy is generated and continues until the user falls asleep or actively terminates it. Specifically, the sleep-aid speaker first selects corresponding sound materials based on the audio type in the strategy, then adjusts the playback effect according to the configured audio parameters, and simultaneously activates appropriate anti-interference measures. During execution, the sleep-aid speaker monitors the user's state and environmental changes in real time, dynamically adjusting the execution parameters based on feedback data to ensure optimal sleep-aid effects.
[0067] In some embodiments, the sleep-aid strategy can be implemented in several ways: Optionally, firstly, the audio processing module is invoked to load a specified type of sound file; then, audio output parameters, including volume curve and frequency characteristics, are set; next, a smart noise-canceling sleep-aid speaker is activated to suppress environmental interference; and finally, the playback effect is adjusted in real time based on user feedback. Optionally, firstly, a multi-channel output sleep-aid speaker is configured to create an immersive sound field; then, sound characteristics are dynamically modulated according to strategy parameters; next, an environmental adjustment module is activated to improve the sleep environment; and finally, the execution effect is monitored and optimized using sensors. It is understood that other technical means or control methods can also be used to implement the sleep-aid strategy, and this is not limited here.
[0068] The following provides a more detailed description of the process of the method provided in this implementation. Please refer to [link / reference]. Figure 2 This is another flowchart illustrating the sleep aid method in this application embodiment.
[0069] S201. Collect physiological characteristic information, activity characteristic information and environmental characteristic information of the target user.
[0070] Among them, physiological characteristic information represents the user's physical status indicators, including physiological data such as heart rate, respiratory rate, body temperature, skin conductance, and electromyography; activity characteristic information refers to the user's behavioral data, including exercise volume, work and rest patterns, and work and study status; environmental characteristic information is used to represent the physical parameters of the user's environment, including temperature, humidity, light intensity, and noise level.
[0071] The sleep aid speaker collects user data in real time through its built-in multi-source sensors. Physiological characteristic collection uses an infrared sensor to scan body surface temperature distribution, an electrocardiogram sensor to record heart rate changes, a pressure sensor to detect body motion frequency, and a photoelectric sensor to monitor blood oxygen saturation. Activity characteristics are acquired synchronously with the user's smart terminal devices, including exercise data synchronized from a smart bracelet, work schedules obtained from a calendar management application, and sleep records obtained from a mobile app. Environmental characteristic collection relies on a temperature and humidity sensor to record indoor temperature and humidity, a light sensor to measure ambient light intensity, and a microphone array to collect ambient noise. All sensors continuously collect data at a sampling frequency of 100Hz, and after signal preprocessing and feature extraction, a complete user status dataset is formed.
[0072] S202. Determine the current sleep stage of the target user based on the physiological characteristic information.
[0073] Among them, sleep stages refer to the different physiological states that the human body experiences during sleep, including wakefulness, light sleep, deep sleep, and REM sleep; physiological characteristic information represents the user's various physiological indicators and parameters; current state refers to the target user's real-time sleep status.
[0074] The sleep aid speaker uses a deep learning model to determine sleep stages. This model is trained using 50,000 polysomnography (PSG) data points annotated by professional doctors, including multi-dimensional physiological signals such as electrocardiogram (ECG), respiration, and body movement. The model architecture employs a recurrent neural network structure, consisting of two LSTM layers and one fully connected layer. The input is a sequence of physiological features within a 30-second time window, and the output is a probability distribution of four sleep stages. In practical applications, the sleep aid speaker processes the collected physiological feature data every 30 seconds, extracting time-domain and frequency-domain features before inputting them into the model. The current sleep stage is determined based on the category with the highest probability. The model achieves a classification accuracy of 87% on the test set.
[0075] S203. Obtain the activity characteristic information of the target user within a preset time period. The activity characteristic information includes the target user's rest time, amount of exercise, and schedule.
[0076] Among them, the preset time period refers to the data statistics period set by the sleep aid speaker, usually the past 7 days; the sleep schedule refers to the user's sleep and wake times; the amount of exercise refers to the user's physical activity data; and the schedule is used to represent the user's work and study plans.
[0077] The sleep aid speaker synchronizes data with the user's smart device via a data interface. For sleep-wake cycles, the speaker records the user's sleep and wake times for seven consecutive days, cross-validating this data using phone usage records, light sensor data, and motion sensor data. Activity data is obtained from a smart bracelet, including steps, exercise duration, and calories burned, weighted by exercise intensity. Schedule information is retrieved from the user's phone calendar app, extracting daily work meeting times, study plans, and other information. The sleep aid speaker standardizes the acquired data, unifying the time scale and numerical range to create a structured activity feature dataset for subsequent sleep demand prediction.
[0078] S204. Calculate the average sleep duration and sleep regularity index of the target user based on the work and rest schedule. The sleep regularity index is determined based on the degree of fluctuation of sleep time within the preset time period.
[0079] Among them, average sleep duration represents the user's average daily sleep time within the statistical period; sleep regularity index is a quantitative indicator that measures the stability of sleep time; volatility is used to represent the dispersion of sleep time; preset time period refers to a statistical period of 7 consecutive days.
[0080] The calculation process consists of two parts: First, the average sleep duration is calculated by summing the actual daily sleep time (the time interval from falling asleep to waking up) and dividing by the number of days. Then, the sleep regularity index is calculated. Specifically, the timestamps of each day's sleep arrival time are calculated, and the standard deviation σt of sleep arrival times over 7 days is obtained; the daily sleep duration is calculated, and the standard deviation σd of sleep duration over 7 days is obtained; the two standard deviations are normalized to the interval [0, 1] to obtain normalized values Nt and Nd; the sleep regularity index R = 1 - (0.6 × Nt + 0.4 × Nd), where the weighting coefficients are obtained through analysis of sleep data from 1000 users. A value closer to 1 indicates better sleep regularity.
[0081] S205. Calculate the target user's average daily physical exertion level based on the amount of exercise.
[0082] Among them, exercise volume includes objective data such as steps, exercise duration, and exercise intensity; physical exertion level refers to the total amount of physical exertion consumed by the user each day; daily average represents the average level within the statistical period.
[0083] The calculation of physical exertion level uses a modified METs (metabolic equivalents) calculation method. First, the user's exercise data is divided into five levels according to intensity: sedentary (1.0 METs), light activity (1.5-3.0 METs), moderate activity (3.0-6.0 METs), high-intensity activity (6.0-9.0 METs), and vigorous exercise (>9.0 METs). Then, the activity duration Ti and the corresponding METs value Mi for each intensity level are calculated. Daily average physical exertion is calculated using the formula E = Σ(Ti×Mi×W), where W is the user's weight. Finally, the calculation results are standardized to the [0, 100] interval to obtain the physical exertion level score. This calculation method has been validated in a sample of 10,000 users, and its correlation with the energy consumption calculation results of professional fitness trackers reaches 0.92.
[0084] S206. Based on the average sleep duration, the sleep regularity index, the physical exertion level, and the activity information of the next day, input the sleep demand prediction model to obtain the sleep demand level of the target user.
[0085] Among them, the sleep demand prediction model refers to the algorithm model used to assess the intensity of a user's current sleep demand; the next day activity information represents the user's schedule for the next day; and the sleep demand level is used to quantify the user's urgency for sleep.
[0086] The sleep demand prediction model employs a gradient boosting decision tree (GBDT) structure and is trained using historical data from 30,000 users. Input features include: ① the difference between average sleep duration and recommended sleep duration (8 hours); ② sleep regularity index; ③ physical exertion level score; ④ next-day activity intensity score (1-5 points based on schedule type). The model outputs a sleep demand score from 0 to 100. Five-fold cross-validation is used during training, with root mean square error (RMSE) as the evaluation metric. Model parameters include: maximum tree depth = 6, number of trees = 100, learning rate = 0.1, minimum number of split samples = 50. The prediction error on the test set is less than 8 points.
[0087] S207. Collect environmental parameters of the target user's environment. The environmental parameters are one or more of the following: noise signal, light signal, air quality information, and temperature information.
[0088] Among them, noise signal represents sound wave data in the environment; light signal refers to light intensity change data in the environment; acquisition refers to obtaining environmental parameters through sensors; the target user's environment specifically refers to the physical space of the user's sleeping location.
[0089] The sleep aid speaker uses a microphone array and a light sensor to collect environmental signals. The microphone array consists of eight omnidirectional microphones with a sampling rate of 48kHz, quantization accuracy of 24bit, sensitivity of -38dB, dynamic range of 120dB, and frequency response range of 20Hz-20kHz. The light sensor employs a dual-spectrum design, including a visible light sensor (response range 380-780nm) and an infrared sensor (response range 780-1100nm), with a sampling rate of 10Hz and a resolution of 0.01lux. The sleep aid speaker preprocesses the collected raw signals, including DC removal, pre-emphasis, and frame segmentation of noise signals, as well as mean filtering and abrupt change detection of the light signals, outputting a standardized environmental parameter data stream.
[0090] S208. Perform spectral analysis on environmental parameters to obtain noise intensity in different frequency bands.
[0091] Among them, environmental parameters include noise signals, spectrum analysis refers to converting time-domain signals into frequency-domain representations; frequency bands represent sound waves within a specific frequency range; and noise intensity refers to the distribution of sound wave energy across different frequency bands.
[0092] Spectrum analysis employed the Short-Time Fourier Transform (STFT) method. First, the preprocessed noise signal was framed with a frame length of 1024 points and a frame shift of 512 points, using a Hamming window for windowing. Then, a 1024-point FFT was performed on each frame to obtain the spectrum data. The spectrum was divided into the following frequency bands: 20-100Hz (low frequency), 100-500Hz (low-mid frequency), 500-2000Hz (mid frequency), 2000-8000Hz (mid-high frequency), and 8000-20000Hz (high frequency). The energy density spectrum was calculated for each band, and a logarithmic transform was performed to obtain the decibel value. Finally, the spectrum data from 50 consecutive frames was averaged to obtain a stable frequency band energy distribution.
[0093] S209. Match the noise intensity of different frequency bands based on the preset noise feature library to obtain the noise source type.
[0094] Among them, the preset noise feature library refers to a database containing feature templates of various typical noise sources; the noise source type indicates the specific sound source that generates the noise; and matching refers to calculating the similarity between the measured spectrum and the templates in the feature library.
[0095] Noise source identification employs a Support Vector Machine (SVM) classifier. The feature library contains 10,000 labeled environmental noise samples, covering 20 typical noise sources including traffic noise, residential noise, natural noise, and mechanical noise. For each noise sample, 40-dimensional Mel-frequency cepstral coefficients (MFCC) features and 5-dimensional frequency band energy features are extracted. The classifier uses the RBF kernel function, and the optimal parameters (C=10, γ=0.01) are determined using grid search. Feature vectors of the same dimension are extracted from real-time acquired noise signals and input into the trained SVM classifier, outputting the noise source category label and confidence score. In experimental verification, the proposed method achieves a noise source identification accuracy of 85%.
[0096] S210. Detect the intensity change trend of environmental parameters to determine whether there is periodic light interference within the preset distance of the target user, and obtain the light interference result.
[0097] Among them, the environmental parameters include the intensity change trend of the light signal, which refers to the fluctuation pattern of the light intensity over time; the preset distance represents the effective detection range of the light sensor, which is set to 5 meters; periodic light interference represents regularly changing light fluctuations, such as vehicle lights, flashing billboards, etc.; the light interference results include the location, frequency, and intensity information of the interference source.
[0098] Light interference detection employs a time-series analysis method. First, a 60-second sliding window analysis is performed on the 10Hz sampled light data, with a window overlap rate of 50%. The data for each window is processed as follows: the first-order difference of light intensity is calculated to obtain the rate of change; autocorrelation analysis is performed on the difference sequence to extract periodic features; wavelet transform is used for time-frequency analysis to identify abrupt changes and periodic components. The sleep aid speaker compares the detected periodic changes with preset thresholds (10 lux / s during the day and 2 lux / s at night). When the rate of change exceeds the threshold and exhibits significant periodicity, light interference is identified. Through collaborative localization using multiple light sensors, the spatial location of the interference source is calculated, outputting an interference feature vector containing location coordinates, flicker frequency, and peak intensity.
[0099] S211. Determine the environmental interference level based on the type of noise source and the result of the light interference.
[0100] Among them, the environmental interference level refers to the quantitative indicator of the degree of impact on sleep quality; the noise source type indicates the category of the identified sound source; and the light interference result indicates the detected light fluctuation characteristics.
[0101] The environmental interference level is determined using a weighted scoring method. For noise interference, a base score is set based on the sound source type: 8 points for sudden noise (e.g., car horns), 5 points for continuous noise (e.g., air conditioner noise), and 2 points for background noise (e.g., wind noise). Then, a correction is made based on noise intensity: 1 point is added for every 45 dB increase, up to a maximum of 5 points. For light interference, a score is set based on flicker characteristics: 7 points for high-frequency flicker (>2Hz), 4 points for low-frequency flicker (<2Hz), and 2 points for gradually changing light. A correction is made based on the magnitude of light intensity variation: 1 point is added for every 5 lux / s increase, up to a maximum of 4 points. The noise and light intensity scores are weighted and summed (weights of 0.6 and 0.4 respectively) to obtain an environmental interference level score of 0-10.
[0102] S212. When the level of environmental interference exceeds the preset interference threshold, mark the noise source type or the light interference result as a sleep disturbance factor.
[0103] Among them, the preset interference threshold refers to the critical value for determining that environmental factors constitute sleep disturbance; sleep disturbance factors refer to environmental problems that need to be addressed specifically; and marking refers to recording and classifying the information of interference sources.
[0104] The sleep aid speaker dynamically adjusts its interference threshold based on sleep stages: 5 points for sleep onset, 6 points for light sleep, 4 points for deep sleep, and 7 points for REM sleep. When environmental interference exceeds the threshold for the current stage, relevant interference source information is written to the interference factor data table. The data table includes the following fields: interference type (noise / light), source description, spatial location, intensity characteristics, duration, and degree of impact. For noise interference, spectral characteristics and source identification confidence are additionally recorded; for light interference, flicker patterns and trends are additionally recorded. The marked interference factor information is used for subsequent selection and implementation of anti-interference measures.
[0105] S213. Input the sleep stage, the degree of sleep need, and the sleep disturbance factor into the strategy selection model as parameters to obtain the target sleep aid strategy, which includes audio type, audio parameters, and anti-interference measures.
[0106] Among them, the strategy selection model refers to the deep learning model used to generate personalized sleep aid solutions; the audio type represents the basic category of sound, such as white noise, natural sound, music, etc.; the audio parameters include sound features such as volume, frequency, and rhythm; and the anti-interference measures refer to the specific implementation plan for suppressing environmental interference.
[0107] The strategy selection model employs a deep neural network architecture, trained using 100,000 user sleep aid records. The input layer comprises three branches: sleep stage encoding (4-dimensional one-hot vector), sleep demand level (1-dimensional scalar), and interference factor features (12-dimensional noise + 8-dimensional illumination). The network backbone uses a three-layer fully connected structure (512-256-128 nodes), employing ReLU activation and Batch Normalization. The output layer consists of three task branches: audio type classification (softmax, 10 classes), audio parameter regression (linear output, 8-dimensional), and anti-interference measure selection (sigmoid, 6-dimensional). The loss function combines cross-entropy loss and mean squared error, trained using the Adam optimizer (learning rate 0.001, batch size 64). The model achieves 92% audio type accuracy and less than 5% parameter prediction error on the validation set.
[0108] S214. Control the sleep aid speaker to execute the target sleep aid strategy.
[0109] Among them, control refers to the scheduling and management of device functions; sleep aid speaker refers to a smart speaker device with sleep aid function; execution means translating the strategy into specific hardware operations; target sleep aid strategy refers to a personalized sleep aid plan generated based on real-time status.
[0110] The sleep aid strategy employs a layered control architecture. At the audio playback level: the sleep aid speaker selects a specified type of audio file from the audio resource library and adjusts audio parameters in real time via a digital signal processing module, including using dynamic range compression to control the volume envelope, applying a parametric equalizer to adjust the frequency response, and adding spatial effects through a reverb unit. At the interference prevention level: the active noise-canceling sleep aid speaker generates anti-phase sound waves to cancel out ambient noise, the smart curtain sleep aid speaker blocks external light, and the air conditioning sleep aid speaker optimizes the indoor environment. During execution, a PID control algorithm is used to adjust the parameters of each execution unit in real time to maintain the stability of the output effect. The sleep aid speaker samples execution status data once per second, recording a time-series log of strategy execution.
[0111] S215. When physiological characteristic information, activity characteristic information, or environmental characteristic information changes, acquire information on changes in the target user's physiological characteristic, activity characteristic, and environmental characteristic.
[0112] Among them, feature change information represents the deviation of user status parameters from the baseline value; physiological feature changes include the amount of change in physiological indicators such as heart rate and respiration; activity feature changes refer to changes in behavioral data such as exercise volume and rest; and environmental feature changes represent fluctuations in environmental parameters such as noise and light.
[0113] The sleep aid speaker employs a multi-threshold detection method to identify changes in user state. For physiological characteristics, the following detection thresholds are set: heart rate change exceeding ±10%, respiratory rate change exceeding ±15%, and body movement frequency change exceeding ±20%; data acquisition is triggered when any of these indicators exceeds the threshold. For activity characteristics, abrupt changes in user behavior patterns are recorded through real-time synchronization of data from smart devices. For environmental characteristics, the rate of change in noise and light intensity is continuously monitored; environmental change data is recorded when these exceed preset thresholds (noise ±5dB / s, light ±3lux / s). The sleep aid speaker uses a circular buffer to store characteristic change data from the past 30 minutes, including change timestamps, change magnitude, and change duration, providing a basis for subsequent strategy adjustments.
[0114] S216. Input the information on changes in physiological characteristics, activity characteristics, and environmental characteristics as parameters into the strategy selection model to obtain a change-based sleep aid strategy.
[0115] Among them, physiological characteristic change information represents real-time deviation data of the user's physiological state; activity characteristic change information refers to the dynamic changes in the user's behavior pattern; environmental characteristic change information refers to the fluctuation data of surrounding environmental parameters; and changing sleep aid strategy represents a new sleep aid plan that is dynamically adjusted according to changes in state.
[0116] The variation strategy generation employs an incremental learning method. Feature variation information is converted into difference vectors: physiological feature differences (heart rate change rate, respiratory rate change rate, body movement rate change rate), activity feature differences (exercise volume change rate, sleep-wake cycle deviation), and environmental feature differences (noise change rate, light intensity change rate). These difference vectors are input into the incremental update module of the strategy selection model. This module uses a residual network structure, containing two residual blocks (each containing two convolutional layers and one batch normalization layer). The model outputs incremental adjustments to the policy parameters: audio type conversion probability (softmax output), audio parameter adjustment amount (linear output), and anti-interference measure update vector (sigmoid output). These incremental values are then combined with the current policy parameters to generate a new variation-based sleep aid strategy. The model uses online learning, continuously optimizing parameters based on user feedback.
[0117] S217. Control the sleep aid speaker to execute the changed sleep aid strategy.
[0118] Among them, control refers to the scheduling process of the device executing instructions; sleep aid speaker refers to a smart speaker device with integrated sleep aid function; execution refers to the conversion of strategy into specific hardware operations; and changing sleep aid strategy refers to a new sleep aid scheme generated based on changes in state.
[0119] The change strategy employs a smooth transition mechanism. For audio control: a cross-fade-in / fade-out algorithm is used to switch audio types, with a fade-out time of 5-10 seconds; a parametric interpolation algorithm is used to gradually adjust audio characteristics, including volume envelope, frequency response, and spatial effects. For anti-interference control: a gradual adjustment method is used to update noise reduction parameters, lighting control parameters, and environmental adjustment parameters to avoid discomfort caused by sudden changes. The sleep aid speaker maintains its effectiveness through real-time feedback control, including audio output monitoring, noise reduction effect detection, and lighting change detection. All adjustments to control parameters are recorded in the execution log for subsequent strategy evaluation and optimization.
[0120] S218. Obtain the brainwave frequency information of the target user.
[0121] Among them, brainwave frequency information represents the frequency characteristics of brain electrical activity; target users refer to users who need to undergo sleep monitoring; acquisition refers to the process of collecting and processing users' brainwave signals through external smart devices.
[0122] Brainwave information acquisition is achieved through data interaction with smart wearable devices. The sleep aid speaker supports Bluetooth connection with devices such as smart headbands and smart eye masks that have EEG monitoring functions. The acquisition device collects EEG signals through a dry electrode array with a sampling rate of 250Hz. Data transmission uses the Bluetooth Low Energy (BLE) protocol, with a transmission latency of less than 100ms. After receiving the raw EEG data, the sleep aid speaker performs signal processing: ① Digital filtering: using a Butterworth bandpass filter (0.5-45Hz) to remove power frequency interference and baseline drift; ② Spectrum analysis: using Fast Fourier Transform to calculate the energy distribution of delta waves (0.5-4Hz), theta waves (4-8Hz), alpha waves (8-13Hz), and beta waves (13-30Hz); ③ Feature extraction: calculating the relative power and frequency band ratio of each frequency band. The sleep aid speaker receives and processes EEG data every 30 seconds to assess the user's brain activity status in real time. When an external device is detected to be disconnected, the sleep aid speaker automatically switches to a sleep state assessment mode based on sound and light feedback.
[0123] S219. Generate a frequency adjustment scheme based on the brainwave frequency information. The frequency adjustment scheme includes a target frequency value and a frequency adjustment step size.
[0124] Among them, the frequency adjustment scheme refers to the control scheme that guides the user's brainwave frequency to change towards the target state; the target frequency value represents the desired main brainwave frequency, with deep sleep corresponding to the delta band (0.5-4Hz); the frequency adjustment step size refers to the amount of frequency change adjusted each time, used to control the smoothness of frequency guidance.
[0125] The frequency adjustment scheme is generated using an adaptive control algorithm. First, the dominant frequency distribution of the user's current brainwave spectrum is calculated: a short-time Fourier transform is performed on the brainwave data of the most recent 60 seconds, with a window length of 256 points and an overlap rate of 50%, resulting in a time-spectrum. A peak detection algorithm is used to identify the energy center frequency of each band. Adjustment intervals are divided according to the sleep process: wakefulness to sleep stage (β waves to α waves, 13-8Hz), sleep to light sleep stage (α waves to θ waves, 8-4Hz), and light sleep to deep sleep stage (θ waves to δ waves, 4-0.5Hz). The target frequency value is set using a segmented strategy: if the current dominant frequency is in the β wave band, the target is set to the α wave band center frequency (10Hz); if in the α wave band, the target is set to the θ wave band center frequency (6Hz); if in the θ wave band, the target is set to the δ wave band center frequency (2Hz). The frequency adjustment step size is dynamically calculated based on the difference between the current frequency and the target frequency: the step size is 0.5 Hz / min when the difference is greater than 4 Hz, the step size is 0.3 Hz / min when the difference is between 2 and 4 Hz, and the step size is 0.1 Hz / min when the difference is less than 2 Hz.
[0126] S220. Update the audio parameters in the sleep aid strategy according to the frequency adjustment scheme.
[0127] Among them, audio parameters include characteristics such as sound frequency, rhythm, and volume; updating refers to dynamically adjusting audio characteristics according to the frequency adjustment scheme; and sleep aid strategy refers to the overall scheme for controlling audio output.
[0128] The audio parameters are updated using a progressive modulation method. Based on binaural rhythms, a brainwave synchronization effect is generated through the frequency difference between the left and right channels. Frequency parameter adjustment process: The reference frequency is set to 432Hz, and the frequency difference between the left and right channels gradually changes according to the frequency adjustment scheme. Modulation depth control: Sine wave modulation is used, with the modulation depth dynamically adjusted within the range of 20-40%, and the modulation frequency follows the target frequency. Rhythm parameter control: The main rhythm cycle is synchronized with the target frequency, and an envelope detector is used to maintain the rhythm intensity within a threshold range. Volume parameter control: Dynamically adjusted based on the stability of the user's current brainwave frequency; the more stable the brainwave frequency, the lower the volume, ensuring a volume range of 30-50dB. All parameter adjustments use linear interpolation to achieve a smooth transition, avoiding interference caused by abrupt changes. The sleep aid speaker updates its audio parameters every 5 seconds, generating the modulated audio signal in real time through a digital signal processor.
[0129] In light of the above scenarios, the following is a more detailed description of the process provided in this implementation. Please refer to [link / reference]. Figure 3 This is another flowchart illustrating the sleep aid method in this application embodiment.
[0130] S301. Detect the status of the audio output channel of the sleep aid speaker.
[0131] Among them, the audio output channel refers to the hardware components in the speaker responsible for sound playback, including the speaker unit, power amplifier and audio processor; the channel status represents the operating parameters of the audio output components, including technical indicators such as channel response characteristics, signal-to-noise ratio, and distortion; detection refers to the process of obtaining channel status parameters through sensors and signal analysis.
[0132] The audio channel status detection employs a self-testing quantization method. The sleep aid speaker first outputs a standard test signal, including a swept-frequency sine wave, white noise, and square wave signal from 20Hz to 20kHz, with the signal amplitude at 50% of the rated power. The actual output sound is acquired using a built-in feedback microphone at a sampling rate of 48kHz and a quantization precision of 24bit. Channel status parameters are obtained through signal processing and analysis: ① Frequency response: The transfer function of the input and output signals is calculated to obtain the amplitude-frequency characteristic curve; ② Signal-to-noise ratio: The background noise level is measured, and the ratio of the peak signal value to the mean noise value is calculated; ③ Harmonic distortion: The output signal is analyzed spectrally, and the ratio of harmonic components to the fundamental component is calculated; ④ Channel balance: The output level difference between the left and right channels is compared. The sleep aid speaker performs a complete channel status detection every 24 hours, and the detection results are stored as a state vector for subsequent channel configuration optimization.
[0133] S302. Determine the audio channel configuration scheme based on the sleep stage of the target user. The audio channel configuration scheme includes volume parameters and audio clarity parameters.
[0134] Among them, the audio channel configuration scheme refers to the parameter setting scheme for the audio output channel; the volume parameter represents the intensity level of the sound; the audio clarity parameter includes signal processing filtering parameters, dynamic range compression parameters, etc.; and the sleep stage refers to the user's current sleep process.
[0135] The configuration scheme is generated using a segmented mapping algorithm. Audio parameters are set for different sleep stages: ① Awake stage: Volume set in the 45-50dB range, wideband response mode enabled (20Hz-20kHz), dynamic range compression ratio 1.5:1; ② Falling asleep stage: Volume gradually decreases to 35-40dB, low-pass filter cutoff frequency set to 8kHz, compression ratio increased to 2:1; ③ Light sleep stage: Volume maintained at 30-35dB, cutoff frequency further reduced to 4kHz, compression ratio set to 3:1; ④ Deep sleep stage: Volume decreases to 25-30dB, low-pass filter limited to below 2kHz, compression ratio reaches 4:1. All parameter settings are corrected based on the preceding channel status detection results to ensure the actual output effect meets the configuration requirements.
[0136] S303. Adjust the output of the sleep aid speaker according to the audio channel configuration scheme.
[0137] Among them, adjustment refers to setting parameters and optimizing the performance of the audio output channel; output refers to the actual sound signal generated by the speaker; and configuration scheme refers to the audio parameter setting scheme generated in the previous steps.
[0138] The audio output adjustment employs a real-time feedback control mechanism. First, the digital signal processor parameters are configured: audio sampling rate (48kHz), quantization bit depth (24bit), and buffer size (512 sampling points). Gain parameters are set via the digital volume controller, and a lookup table is used to convert the dB values in the configuration scheme into digital gain coefficients. The signal processing flow is as follows: ① Pre-equalization: The coefficients of the IIR filter bank are set according to the frequency response requirements of the configuration scheme; ② Dynamic processing: The threshold, ratio, and release time of the dynamic range compressor are configured; ③ Post-optimization: Noise gate control and dereverberation processing are applied. The sleep aid speaker monitors the output effect in real time through a feedback loop: the output signal is sampled every 100ms, the actual volume and spectral parameters are calculated, and the processing parameters are fine-tuned after comparison with the configured target to maintain output stability.
[0139] S304. Collect the physiological characteristic information of the target user in real time.
[0140] Among them, physiological characteristic information refers to physiological parameters that reflect the user's physical state, including respiratory rate, body movement rate and heart rate; real-time acquisition means the process of continuously acquiring data; target user refers to the user who needs to be physiologically monitored.
[0141] Physiological feature acquisition utilizes millimeter-wave radar sensing technology. A 24GHz millimeter-wave radar sensor with a sampling rate of 100Hz is used. Signal processing is divided into three channels: ① Respiratory monitoring channel: extracts micro-Doppler signals in the 0.1-0.5Hz frequency band to calculate respiratory cycle and depth; ② Body movement monitoring channel: analyzes Doppler signals in the 0.5-2Hz frequency band to identify the intensity of body activity; ③ Heart rate monitoring channel: processes weak reflected signals in the 0.8-2Hz frequency band to extract heart rate information. The signal processing flow includes: bandpass filtering to remove interference, wavelet transform to extract features, and peak detection to calculate frequency. The sleep aid speaker outputs a physiological parameter vector once per second, including respiratory rate (breaths / min), body movement intensity (relative value 0-1), and heart rate (breaths / min). When a decrease in signal quality is detected, the radar gain and signal processing parameters are automatically adjusted to maintain detection accuracy.
[0142] S305. Dynamically update the audio channel configuration scheme according to the changing trend of the physiological characteristic information.
[0143] Among them, the trend of change refers to the pattern of change of physiological parameters over time; dynamic update refers to adjusting configuration parameters in real time according to the trend; the audio channel configuration scheme includes audio output parameters such as volume and frequency response.
[0144] The configuration update uses a trend-response algorithm. First, it calculates the characteristics of physiological parameter changes: time-series analysis is performed on the most recent 5 minutes of data to calculate the first-order difference (reflecting the rate of change) and the second-order difference (reflecting the acceleration of change). Audio parameters are adjusted based on these characteristics: ① When respiratory rate decreases and stabilizes, the volume is reduced by 2-3 dB to decrease high-frequency response; ② When body rate increases, the volume is increased by 3-5 dB to increase the proportion of low frequencies; ③ When heart rate fluctuates, the volume remains stable, and the mid-frequency response is enhanced. Parameter adjustments use a smooth transition: the target parameter value is calculated using an exponential moving average, and the gradual change is completed within 30 seconds. The configuration is updated every 10 seconds to ensure that the audio output changes synchronously with the user's status.
[0145] S306. Obtain the target wake-up time set by the target user.
[0146] Among them, the target wake-up time refers to the specific time when the user expects to wake up; setting refers to the time information entered by the user through the interactive interface; and obtaining refers to the process by which the sleep aid speaker receives and processes the time settings.
[0147] The wake-up time is obtained using a multi-mode input method. The sleep aid speaker offers three time setting methods: ① Voice input: The user's spoken time is converted into a 24-hour time value through voice recognition; ② Touch input: The specific time is set by sliding the time selector on the speaker's touchscreen; ③ Mobile application input: The time is set through a Bluetooth-connected mobile application. Time data processing flow: The input time is uniformly converted into a minute count value (relative to midnight of the current day); the time validity is checked to ensure that the set time is later than the current time; the remaining time until wake-up is calculated. The sleep aid speaker stores the time setting in non-volatile memory and displays the countdown information on the LED display. When a new time setting is detected, the stored value is immediately updated and the relevant parameters are recalculated.
[0148] S307. Determine the sleep stage of the target user based on this physiological characteristic information.
[0149] Among them, sleep stages refer to the user's sleep state, which is divided into four stages: wakefulness, falling asleep, light sleep, and deep sleep; physiological characteristic information includes respiratory rate, body movement intensity, and heart rate data; judgment refers to the classification of sleep state through machine learning models.
[0150] Sleep stage determination employs a multi-feature fusion classification method. A sleep classification model is constructed using Support Vector Machines (SVM), with feature vectors containing 12 dimensions: mean respiratory rate, variance of respiratory rate, mean respiratory depth, body movement frequency, mean body movement intensity, body movement duration, mean heart rate, heart rate variability, and the trend slope of three physiological indicators. Model training utilizes a labeled sleep dataset (containing sleep records of 1000 users), and 5-fold cross-validation is used to optimize model parameters. The classification process involves extracting feature vectors every 30 seconds, performing a sliding window analysis on the most recent 10 minutes of physiological data, and calculating feature values. The feature vectors are then input into the SVM model, outputting a probability distribution of sleep stages. Median filtering is used to smooth the classification results and eliminate short-term fluctuations. The classification accuracy reached over 85% in clinical validation.
[0151] S308. Generate a wake-up execution plan based on the sleep stage. The wake-up execution plan includes the target wake-up time and wake-up audio parameters.
[0152] Among them, the wake-up execution plan refers to the operation plan that controls the user to change from a sleep state to a wake-up state, and the target wake-up time indicates the specific moment when the wake-up is started; the wake-up audio parameters include the frequency, volume and rhythm characteristics of the audio.
[0153] The wake-up plan generation uses a sleep cycle matching algorithm. Based on the 90-minute sleep cycle pattern, it calculates the number of complete cycles from the current moment to the target wake-up time, and selects the light sleep stage closest to the target time as the target wake-up time. Audio parameter settings are divided into three stages: ① Pre-wake stage (15 minutes before wake-up): Volume linearly increases from 30dB to 40dB, using a low-frequency rhythm of 2-4Hz; ② Main wake-up stage (5 minutes before wake-up): Volume increases to 45-50dB, frequency increases to 8-13Hz, and natural ambient sound is added; ③ Wake-up maintenance stage (5 minutes after wake-up): Maintains a volume of 50dB, using a wake-up frequency of 15-20Hz. The sleep aid speaker dynamically adjusts parameters according to real-time sleep status: extending the pre-wake time to 20 minutes during deep sleep and shortening it to 10 minutes during light sleep.
[0154] S309. Control the sleep aid speaker to perform the wake-up operation according to the wake-up execution plan.
[0155] Among them, wake-up operation refers to the process of waking the user from sleep; control refers to adjusting the speaker output according to the predetermined plan; and execution refers to the specific process of implementing the wake-up plan.
[0156] The wake-up operation employs a progressive control strategy. The sleep aid speaker first initializes the audio processor: setting the sampling rate to 48kHz, the buffer size to 1024 points, and enabling the real-time processing module. Audio generation uses a three-layer structure: ① The base layer generates white noise, which is then filtered through a bandpass filter to form background sound in a specified frequency band; ② The rhythm layer superimposes binaural beat signals, with the frequency gradually increasing according to the scheme settings; ③ The environmental layer mixes natural sounds (such as birdsong and flowing water), with intensity controlled by envelope modulation. The execution process consists of five steps: ① Checking if the current time has reached the target wake-up time; ② Calculating the current audio parameters based on the progress percentage; ③ Generating and mixing the three-layer audio signals; ④ Adjusting the output gain through a digital volume controller; ⑤ Outputting the sound signal through a power amplifier. The sleep aid speaker updates the processing parameters every 100ms to ensure a smooth sound transition.
[0157] The sleep aid speaker in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference]. Figure 4 This is a schematic diagram of the physical device structure of a sleep aid speaker in the embodiments of this application.
[0158] It should be noted that, Figure 4 The structure of the sleep aid speaker shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0159] like Figure 4 As shown, the sleep aid speaker includes a Central Processing Unit (CPU) 401, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 402 or programs loaded from storage section 408 into Random Access Memory (RAM) 403, such as performing the methods described in the above embodiments. The RAM 403 also stores various programs and data required for system operation. The CPU 401, ROM 402, and RAM 403 are interconnected via a bus 404. An Input / Output (I / O) interface 405 is also connected to the bus 404.
[0160] The following components are connected to I / O interface 405: input section 406 including audio input devices, push-button switches, etc.; output section 407 including a liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 408 including a hard disk, etc.; and communication section 409 including a network interface card such as a LAN (Local Area Network) card, modem, etc. Communication section 409 performs communication processing via a network such as the Internet. Drive 410 is also connected to I / O interface 405 as needed. Removable media 411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 410 as needed so that computer programs read from them can be installed into storage section 408 as needed.
[0161] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 409, and / or installed from removable medium 411. When the computer program is executed by central processing unit (CPU) 401, it performs the various functions defined in the present invention.
[0162] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0163] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.
[0164] Specifically, the sleep aid speaker in this embodiment includes a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, it implements the sleep aid method provided in the above embodiment.
[0165] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the sleep aid speaker described in the above embodiments; or it may exist independently and not assembled into the sleep aid speaker. The storage medium carries one or more computer programs that, when executed by a processor of the sleep aid speaker, cause the sleep aid speaker to implement the sleep aid method provided in the above embodiments.
[0166] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0167] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0168] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A sleep aiding method characterized by, The method applied to a sleep-aiding sound box comprises: collecting physiological characteristic information and activity characteristic information of a target user; determining a sleep stage in which the target user is currently located according to the physiological characteristic information; predicting a sleep demand degree of the target user based on the activity characteristic information; inputting the sleep stage and the sleep demand degree as parameters into a strategy selection model to obtain a current sleep-aiding strategy, the current sleep-aiding strategy comprising an audio type, an audio parameter and an anti-interference measure; controlling the sleep-aiding sound box to execute the current sleep-aiding strategy.
2. The method of claim 1, wherein, The step of predicting the sleep demand degree of the target user based on the activity characteristic information specifically comprises: obtaining activity characteristic information of the target user within a preset time period, the activity characteristic information comprising a work-rest time, an exercise amount and a schedule of the target user; calculating an average sleep duration and a sleep regularity index of the target user according to the work-rest time, the sleep regularity index being determined according to a fluctuation degree of sleep time within the preset time period; calculating a daily physical consumption level of the target user based on the exercise amount; inputting the average sleep duration, the sleep regularity index, the physical consumption level and the next-day activity information into a sleep demand prediction model to obtain the sleep demand degree of the target user.
3. The method of claim 1, wherein, The step of identifying a sleep interference factor based on the environmental characteristic information specifically comprises: collecting environmental parameters of an environment in which the target user is located, the environmental parameters being one or more of a noise signal, an illumination signal, air quality information and temperature information; performing frequency spectrum analysis on the environmental parameters to obtain noise intensities of different frequency bands; matching the noise intensities of different frequency bands based on a preset noise characteristic library to obtain a noise source type; detecting intensity change trends of the environmental parameters to determine whether there is periodic illumination interference within a preset distance of the target user to obtain an illumination interference result; determining an environmental interference level according to the noise source type and the illumination interference result; when the environmental interference level exceeds a preset interference threshold, marking the noise source type or the illumination interference result as a sleep interference factor.
4. The method of claim 1, wherein, After the step of controlling the sleep-aiding sound box to execute the current sleep-aiding strategy, the method further comprises: when the physiological characteristic information, the activity characteristic information or the environmental characteristic information changes, obtaining physiological characteristic change information, activity characteristic change information and environmental characteristic change information of the target user; inputting the physiological characteristic change information, the activity characteristic change information and the environmental characteristic change information as parameters into the strategy selection model to obtain a changed sleep-aiding strategy; controlling the sleep-aiding sound box to execute the changed sleep-aiding strategy.
5. The method of claim 4, wherein, After the step of controlling the sleep-aiding sound box to execute the current sleep-aiding strategy, the method further comprises: obtaining brain wave frequency information of the target user; generating a frequency adjustment scheme based on the brain wave frequency information, the frequency adjustment scheme comprising a target frequency value and a frequency adjustment step; updating the audio parameter in the sleep-aiding strategy according to the frequency adjustment scheme.
6. The method according to any one of claims 1 to 4, characterized in that, After the step of controlling the sleep-aiding sound box to execute the current sleep-aiding strategy, the method further comprises: detecting an audio output channel state of the sleep-aiding sound box; determining an audio channel configuration scheme according to a sleep stage of the target user, the audio channel configuration scheme comprising a volume parameter and an audio definition parameter; adjusting an output of the sleep-aiding sound box according to the audio channel configuration scheme; collecting physiological feature information of the target user in real time; dynamically updating the audio channel configuration scheme according to a change trend of the physiological feature information.
7. The method according to any one of claims 1 to 4, characterized in that, After the step of controlling the sleep-aiding sound box to execute the current sleep-aiding strategy, the method further comprises: obtaining a target wake-up time set by the target user; judging a sleep stage of the target user based on the physiological feature information; generating a wake-up execution scheme according to the sleep stage, the wake-up execution scheme comprising the target wake-up time and a wake-up audio parameter; controlling the sleep-aiding sound box to execute a wake-up operation according to the wake-up execution scheme.
8. The method of claim 1, wherein, After the step of controlling the sleep-aiding sound box to execute the current sleep-aiding strategy, the method further comprises: collecting physiological feature information, activity feature information and environmental feature information of the target user; determining a sleep stage currently experienced by the target user according to the physiological feature information; predicting a sleep demand degree of the target user based on the activity feature information; identifying a sleep interference factor of the target user based on the environmental feature information; inputting the sleep stage, the sleep demand degree and the sleep interference factor as parameters into the strategy selection model to obtain a target sleep-aiding strategy, the target sleep-aiding strategy comprising an audio type, an audio parameter and an anti-interference measure; controlling the sleep-aiding sound box to execute the target sleep-aiding strategy.
9. The method of claim 1, wherein, The hardware configuration of the sleep-aiding sound box comprises: sound volume adjustment, resonance frequency, audio control, sensor and alarm clock.
10. A sleep-aiding soundbar, characterized by, The sleep-aiding sound box comprises one or more processors and a memory; the memory is coupled with the one or more processors, the memory is used to store computer program code or store a calculation result of corresponding computer program code on a user terminal, the computer program code comprises computer instructions, and the one or more processors invoke the computer instructions to enable the sleep-aiding sound box to execute the method according to any one of claims 1-7.