Sleep light adjusting method, system and device and storage medium
By obtaining the user's sleep data and habit parameters and dynamically adjusting the sleep lights, the problem that existing systems cannot adjust adaptively is solved, and efficiently improves sleep quality and natural wake-up effects are achieved.
Patent Information
- Application Number
- CN202411694855.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing sleep lighting adjustment system cannot adaptively adjust according to the user's real-time sleep state and environment, neglecting the user's sleep habits, resulting in limited sleep quality improvement effect.
By obtaining the user's current sleep data, sleep environment data and sleep habit parameters, the sleep light is dynamically adjusted, and the first sleep light adjustment curve is used to assist sleep and the second sleep light adjustment curve is naturally awakened, and the curve is continuously adjusted in combination with optimization learning to meet personalized needs.
It realizes dynamic adjustment of sleep lights according to the user's real-time sleep state and environment, creates the best sleep environment, improves the user's sleep quality, and simulates the sunrise effect through natural awakening to meet the user's sleep habit needs.
Smart Images

Figure CN119701157A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of sleep regulation technology, and in particular, relates to a sleep light regulation method, system, device and storage medium. Background Art
[0002] Sleep quality directly affects human health and quality of life. Studies have shown that light has a significant impact on human biorhythms, especially the lighting conditions before falling asleep and when waking up, which will have a greater impact on the user's sleep quality. Some existing sleep light adjustment systems often only provide preset lighting scenes, but lack the ability to analyze individual users' sleep data and environmental data and dynamically adjust the lights. This results in the inability of existing sleep light adjustment systems to adaptively adjust according to the user's real-time sleep status and real-time sleep environment, and ignores the user's sleep habits, making the adjustment effect in helping users improve sleep quality and enhance the user's sleep experience extremely limited. Summary of the invention
[0003] The purpose of this application is to provide a sleep light adjustment method, system, device and storage medium, which can dynamically adjust the sleep light in a personalized manner to improve the user's sleep quality.
[0004] In a first aspect, the present application provides a method for adjusting sleep light, the method comprising:
[0005] Obtain the user's current sleep data, sleep environment data, and sleep habit parameters;
[0006] Determine a first sleep light adjustment curve based on the current sleep data and the sleep environment data; the first sleep light adjustment curve is a sleep light change curve for a sleep aid user;
[0007] Determine a second sleep light adjustment curve based on the sleep habit parameter; the second sleep light adjustment curve is a sleep light change curve when waking up the user;
[0008] The sleep light is dynamically adjusted based on the first sleep light adjustment curve and the second sleep light adjustment curve.
[0009] In an implementation of the first aspect, determining a first sleep light adjustment curve based on the current sleep data and the sleep environment data includes:
[0010] Initialize the sleep light parameter value;
[0011] In response to changes in the current sleep data and the sleep environment data, the sleep light parameter value is updated in real time to determine a first sleep light adjustment curve.
[0012] In an implementation of the first aspect, in response to changes in the current sleep data and the sleep environment data, updating the sleep light parameter in real time includes:
[0013] identifying a current sleep stage of the user based on the current sleep data;
[0014] Obtaining a preset sleep environment standard corresponding to the current sleep stage;
[0015] Acquire a sleep environment deviation value based on the sleep environment preset standard and the sleep environment data;
[0016] The sleep light parameter value is updated in real time based on the sleep environment deviation value, so as to adjust the sleep light by the sleep light parameter value so that the sleep environment deviation value approaches zero.
[0017] In an implementation of the first aspect, determining the first sleep light adjustment curve includes:
[0018] Obtaining the change rate of the sleep light parameter value;
[0019] The first sleep light adjustment curve is determined based on the change rate and the sleep light parameter value.
[0020] In an implementation of the first aspect, determining the second sleep light adjustment curve based on the sleep habit parameter includes:
[0021] Obtaining the awake time in the sleep habit parameters;
[0022] determining a wake-up time period of a preset length based on the awake time;
[0023] A plurality of sleep light parameter values are determined during the wake-up time period, and the plurality of sleep light parameter values are gradually increased to form the second sleep light adjustment curve, and the second sleep light adjustment curve reaches a maximum value during the awake time.
[0024] In an implementation of the first aspect, dynamically adjusting the sleep light based on the first sleep light adjustment curve and the second sleep light adjustment curve includes:
[0025] When the wake-up time period has not yet begun, the sleep light is dynamically adjusted based on the first sleep light adjustment curve; when the wake-up time period has begun, the sleep light is dynamically adjusted based on the second sleep light adjustment curve.
[0026] In an implementation of the first aspect, the method further includes:
[0027] Obtain the user's lighting adjustment preference data and sleep feedback data;
[0028] The first sleep light adjustment curve and the second sleep light adjustment curve are optimized and adjusted based on the light adjustment preference data and the sleep feedback data to meet the user's personalized sleep light adjustment needs.
[0029] In a second aspect, the present application provides a sleep light adjustment system, the system comprising:
[0030] An acquisition module is used to acquire the user's current sleep data, sleep environment data, and sleep habit parameters;
[0031] A first curve module, used to determine a first sleep light adjustment curve based on the current sleep data and the sleep environment data; the first sleep light adjustment curve is a sleep light change curve for a sleep aid user;
[0032] A second curve module, used to determine a second sleep light adjustment curve based on the sleep habit parameter; the second sleep light adjustment curve is a sleep light change curve when waking up the user;
[0033] An adjustment module is used to dynamically adjust the sleep light based on the first sleep light adjustment curve and the second sleep light adjustment curve.
[0034] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory, so that the electronic device performs the above-mentioned sleep light adjustment method.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned sleep light adjustment method when executed by an electronic device.
[0036] As described above, the sleep light adjustment method, system, device and storage medium described in the present application have the following beneficial effects: First, the present application determines the first sleep light adjustment curve based on the user's sleep data and sleep environment data, thereby updating the sleep light parameter value in real time, realizing dynamic adjustment of the sleep light, and then being able to achieve the best sleep environment and ensure the user's sleep quality. Secondly, the present application determines the second sleep light adjustment curve based on the user's sleep habit parameters, simulating the effect of a natural sunrise in a dim sleep environment, thereby naturally waking up the user and satisfying the user's sleep habits. Finally, through optimization learning, the present application can continuously adjust the first sleep light adjustment curve and the second sleep light adjustment curve to better meet the sleep needs of different users. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1AShown is a schematic diagram of an application scenario of the sleep light adjustment method described in this application.
[0038] Figure 1B Shown is a schematic diagram of an application scenario of the sleep light adjustment method described in this application.
[0039] Figure 1C Shown are structural diagrams of the client-cloud interaction scenarios in these implementations.
[0040] Figure 2 Shown is a flowchart of a sleep light adjustment method according to an embodiment of the present application.
[0041] Figure 3 Shown is a flowchart of a sleep light adjustment method according to an embodiment of the present application.
[0042] Figure 4 Shown is a flowchart of a sleep light adjustment method according to an embodiment of the present application.
[0043] Figure 5 Shown is a schematic diagram of the principle of a sleep light adjustment method in an embodiment of the present application.
[0044] Figure 6 Shown is a schematic diagram of the structure of a sleep light adjustment system in an embodiment of the present application.
[0045] Figure 7 Shown is a schematic structural diagram of an electronic device of the present application in one embodiment. DETAILED DESCRIPTION
[0046] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0047] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0048] In addition, in this application, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0049] Lighting adjustment during sleep has an important impact on the body's biological clock, mood and sleep quality. Light can affect the secretion of melatonin, which is an important factor in regulating the sleep-wake cycle. Currently, there are some modern smart lighting devices on the market that can adjust the sleep lighting through mobile phones or smart speakers to provide a suitable sleeping environment. However, most current sleep lighting adjustment systems often only provide preset lighting scenes, and cannot be targeted and dynamically adjusted in real time based on the user's sleep conditions and sleep environment. They also ignore the user's sleep habits, and the optimization effect on sleep becomes extremely limited.
[0050] In order to at least solve the above-mentioned problems, an embodiment of the present application provides a sleep light adjustment method, which can dynamically adjust the sleep light in a personalized manner based on the user's sleep data, sleep environment data and sleep habit parameters, thereby improving the user's sleep efficiency and enabling the user to wake up naturally at the best time, thereby effectively improving the user's sleep quality.
[0051] In some embodiments, the sleep light adjustment method provided in the embodiments of the present application can be applied to Figure 1A The sleep light adjustment device shown. Figure 1AAs shown, the sleep light adjustment device 1 includes a collection component 11, a control center 12 and a light component 13. The collection component 11 includes wearable devices or embedded devices such as smart bracelets, smart watches, and mattress sensors to collect the user's current sleep data. This type of device acquires various current sleep data through various built-in sensors (such as heart rate sensors, accelerometers, respiratory rate sensors, etc.), and this application does not impose any restrictions on this. At the same time, the collection component 11 also includes various environmental sensors, such as light sensors, temperature and humidity sensors, noise sensors, etc., to collect various sleep environment data, and this application does not impose any restrictions on this. The collection component 11 transmits the current sleep data and sleep environment data to the control center 12. The control center can be a mobile phone APP software. After receiving the user's sleep data and sleep environment data, it determines the first sleep light adjustment curve based on the current sleep data and the sleep environment data. At the same time, the control center 12 will also obtain sleep habit parameters, and determine a second sleep light adjustment curve based on the sleep habit parameters, so as to control the light component 13 to perform adaptive sleep light adjustment changes based on the first sleep light adjustment curve and the second sleep light adjustment curve, so as to meet the user's personalized sleep needs.
[0052] The lighting assembly 33 includes a smart light bulb or light strip with adjustable color temperature and brightness, etc., and this application does not impose any restrictions on this.
[0053] In some other embodiments, the sleep light adjustment method provided in the embodiment of the present application can also be applied to Figure 1B The sleep light adjustment device shown. Figure 1B As shown, the sleep light adjustment device 1 includes a processor 11 and a database 12. The sleep light adjustment method provided in the embodiment of the present application can be applied to the processor 11.
[0054] in, Figure 1B The processor 11 in the embodiment may be a single processor or a processor cluster or a cloud computing center composed of multiple processors, and the specific details are not limited here. Figure 1B Only one processor 11 and one database 12 are shown, but it should be understood that Figure 1B The examples are only used to understand the present solution, and the specific numbers of processors 11 and databases 12 should be flexibly determined based on actual conditions.
[0055] In some other embodiments, the sleep light adjustment device 1 may not include the database 12, but only include a processor 11 with a storage function. The sleep light adjustment method provided in the embodiment of the present application can be applied to the processor 11. The processor 11 with a storage function may include a computer, a mobile phone, etc., which is not limited here.
[0056] In still other embodiments, the sleep light adjustment method described in the present application can be applied to the end-cloud interaction scenario. Figure 1C The following is a schematic diagram of the structure of the client-cloud interaction scenario in these implementations. Figure 1C As shown, the terminal-cloud interaction system 2 includes a terminal 20 and a cloud server 21. The terminal 20 and the cloud server 21 can communicate with each other, and the communication method is not limited to wired or wireless.
[0057] Among them, the terminal 20 can be mobile or fixed. For example, the terminal 20 can be a wireless terminal or a wired terminal. The wireless terminal can refer to a device with wireless transceiver function, which can be deployed in sleep application scenarios such as bedrooms. The terminal 20 can be a mobile phone, a laptop computer, etc., which is not limited here. The cloud server 21 can include one or more servers, or one or more processing nodes, or one or more virtual machines running on the server. The cloud server 21 can also be called a server cluster, a management platform, a sleep light adjustment center, etc., which is not limited in the embodiments of the present application.
[0058] The technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application.
[0059] The following embodiments of the present application provide a method for adjusting the sleep light, for example, by Figure 1A The sleeping light adjustment device 1 shown, Figure 1B The processor 11 or Figure 1C It is implemented by the cloud server 21 shown. Figure 2 The flowchart of the sleep light adjustment method described in the embodiment of the present application is shown as follows: Figure 2 As shown, the sleep light adjustment method includes steps S1 to S4.
[0060] S1. Obtain the user's current sleep data, sleep environment data, and sleep habit parameters.
[0061] In some embodiments, the user's current sleep data can be collected through wearable devices or embedded devices such as smart bracelets, smart watches, and mattress sensors. Among them, these collection devices can collect the user's current sleep data through built-in sensors, including heart rate data, breathing data, and / or body activity data. For example, heart rate data can be collected through a heart rate sensor, breathing data can be collected through a breathing rate sensor, and body activity data can be collected through an acceleration sensor.
[0062] In some embodiments, the frequency of collecting the current sleep data may be set to once per second.
[0063] Furthermore, the collected sleep data can be pre-processed by filtering, denoising, etc. to improve the signal-to-noise ratio. For example, the heart rate data and breathing data can be filtered by a Butterworth low-pass filter to remove high-frequency noise, thereby enhancing the accuracy of light adjustment.
[0064] Furthermore, after collecting sleep data, you can also extract features from the sleep data. For example, by calculating the heart rate variability (HRV), by calculating the standard deviation (SDNN) or root mean square deviation (RMSSD) of the RR interval (ie, the heart beat interval), the variability data related to the heart rate is extracted, which helps to subsequently identify the user's sleep depth or light sleep stage. For another example, respiratory stability analysis is performed, and the respiratory rate data is analyzed by analyzing its fluctuation amplitude and periodic stability to determine whether the user is in a deep sleep stage. High respiratory stability usually corresponds to a deep sleep stage, while unstable breathing may mean light sleep or rapid eye movement (REM) sleep.
[0065] In some embodiments, a light sensor, a temperature sensor, a humidity sensor, and / or a noise sensor may be used to collect at least one of the following sleep environment data: the light intensity, the temperature, the humidity, and the noise of the sleep environment in real time. When the sleep environment noise data is collected, a Kalman filter is used to process the noise data to remove random noise interference and ensure accurate detection of the noise source.
[0066] In some embodiments, the frequency of collecting sleep environment data may be set to once per second.
[0067] Furthermore, after collecting the user's sleep data and sleep environment data, multi-sensor data fusion is required. For example, data from multiple physiological sensors (heart rate, breathing rate, body activity, etc.) and environmental sensors (temperature, light, humidity, etc.) are integrated, and data fusion algorithms (such as Kalman filtering or Bayesian data fusion) are used to ensure a more accurate judgment of the sleep state and reduce the impact of single sensor errors on sleep light adjustment.
[0068] In some embodiments, when the sleep data and sleep environment data are collected, they can be transmitted to the control center of the lighting system or a main control device such as a mobile phone app via Bluetooth or Wi-Fi, so as to record the user's current sleep data and sleep environment data in real time. In addition, data visualization tools (such as D3.js or Plotly) can be used to present the sleep data in a graphical manner, so that users can understand their sleep conditions more intuitively.
[0069] In addition, the sleep habit parameters refer to the regular physiological changes and behavioral patterns of the user in terms of sleep, including the user's sleeping time and waking time. The embodiment of the present application provides an implementation method for obtaining the sleep habit parameters, including: collecting the user's sleep habit data for a long time, including the sleeping time and waking time, and using the LSTM model to model the sleep habit data. In some embodiments, the long-term collected sleep habit data is input into the LSTM model, trained by supervised learning, and the LSTM model is optimized using the mean square error (MSE) loss function and the Adam optimizer. After the LSTM model training is completed, the model is used to obtain the user's sleep habit parameters. That is, the sleep habit parameters are predicted by the trained LSTM model, and the parameters of the LSTM model can also be adjusted in real time according to the user's feedback, so as to update the model, thereby improving the accuracy of predicting the sleep habit parameters. In other embodiments, the sleep habit parameters can also be set manually. For example, the user can set the sleep habit parameters in the mobile phone app for customization.
[0070] S2. Determine a first sleep light adjustment curve based on the current sleep data and the sleep environment data; the first sleep light adjustment curve is a sleep light change curve for the sleep aid user.
[0071] In order to better help users fall asleep and reduce the number of users' nighttime awakenings, it is necessary to dynamically adjust the sleep light according to the first sleep light adjustment curve to optimize sleep. In some embodiments, determining the first sleep light adjustment curve based on the current sleep data and the sleep environment data includes: initializing the sleep light parameter value; in response to changes in the current sleep data and the sleep environment data, updating the sleep light parameter value in real time to determine the first sleep light adjustment curve. For example, the user can set the sleep light parameter value after going to bed in advance, including the sleep light brightness value and the sleep light color temperature value, to initialize the sleep light parameter value to ensure a comfortable sleeping environment. Afterwards, the sleep light parameter value will be automatically updated in real time according to the changes in the user's current sleep data and the sleep environment data to determine the first sleep light adjustment curve. That is, the sleep light parameter value is adjusted in real time according to the user's sleep condition and sleep environment.
[0072] Figure 3 The flowchart of the sleep light adjustment method described in the embodiment of the present application is shown as follows: Figure 3 As shown, real-time updating of the sleep light parameter value includes step S21 and step S24.
[0073] S21. Identify a user's current sleep stage based on the current sleep data.
[0074] In some embodiments, a convolutional neural network model (CNN) model can be used to identify the current sleep stage of the user based on the current sleep data. The sleep stages generally include Wake stage, N1 stage, N2 stage, N3 stage and REM stage. That is, the current sleep data obtained in step S1 is input into the CNN model, and the CNN model will determine which sleep stage the user is currently in and output the current sleep stage of the user.
[0075] In some embodiments, a data set can be constructed to train the CNN model in batches, and the cross entropy loss function can be used to optimize the model. In addition, the CNN model parameters are adjusted by a gradient descent optimization algorithm (such as Adam or SGD) to finally obtain a trained CNN model. Among them, the implementation method of constructing a data set includes: collecting training data, and the training data can be user sleep data collected for a long time, or sleep data existing in a large database, etc. Afterwards, feature extraction can be performed on the collected training data. For example, the standard deviation (SDNN) or mean difference (RMSSD) of the RR interval can be used as an indicator of heart rate variability, and the stability characteristics of the respiratory frequency and physical activity characteristics can be extracted. Then use a support vector machine (SVM) or a K-nearest neighbor (KNN) algorithm to classify the extracted features to annotate the data features, achieve the correspondence between sleep data and sleep stages, and construct training data to train the CNN model.
[0076] S22: Obtain a preset sleep environment standard corresponding to the current sleep stage.
[0077] In some embodiments, the preset standards of the sleeping environment can be manually adjusted, including the light intensity standard of the sleeping environment, the temperature standard of the sleeping environment, the humidity standard of the sleeping environment, and the noise standard of the sleeping environment. For example, in the Wake period and the N1 period, the user is about to fall asleep or in light sleep, and the user is easily awakened by external stimuli. Therefore, the light intensity standard of the sleeping environment can be set to 0-10Lux, and the temperature of the sleeping environment can be set to 18-22 degrees Celsius. In other embodiments, the user's sleeping environment preferences, sleeping conditions, etc. can also be continuously collected to determine the preset standards of the sleeping environment corresponding to each sleep stage. In addition, users can also set the preset standards of the sleeping environment according to their own sleeping habits. By setting the preset standards of the sleeping environment in advance, the corresponding preset standards of the sleeping environment can be obtained after determining the current sleep stage of the user.
[0078] It should be noted that the preset standards for the sleeping environment corresponding to each sleep stage can be set as needed to meet personalized sleep needs.
[0079] S23: Acquire a sleeping environment deviation value based on the sleeping environment preset standard and the sleeping environment data.
[0080] Specifically, after obtaining the sleep environment data in real time through step S1, the current sleep environment deviation value can be obtained based on the comparison between the obtained sleep environment data and the preset sleep environment standard corresponding to the current sleep stage. In some embodiments, when step S1 obtains the sleep environment light intensity, sleep environment temperature, sleep environment humidity and sleep environment noise in real time, the sleep environment deviation value includes the sleep environment light intensity deviation value, the sleep environment temperature deviation value, the sleep environment humidity deviation value and the sleep environment noise deviation value.
[0081] S24. Update the sleep light parameter value in real time based on the sleep environment deviation value, so as to adjust the sleep light by the sleep light parameter value and make the sleep environment deviation value approach zero.
[0082] Specifically, in order to ensure the user's sleep quality, reduce the number of awakenings at night, and keep the user in the best sleeping environment, it is necessary to adjust the sleep light through the sleep light parameter value so that the sleep environment deviation value tends to zero. That is, when the sleep environment deviation value is not 0, it means that the user is not currently in the best sleeping environment, which will affect the user's sleeping state. Therefore, it is necessary to update the sleep light parameter value in real time to dynamically adjust the sleep light and create the best sleeping environment.
[0083] In some embodiments, for the sleep environment light intensity deviation value, the sleep light brightness value can be updated in real time. For example, when the current light intensity is lower than the sleep environment light intensity standard, the sleep light brightness value can be increased to maintain a comfortable sleep environment. For another example, when the current light intensity is higher than the sleep environment light intensity standard, the sleep light brightness value can be reduced to reduce the impact of light on the user's sleep.
[0084] In some embodiments, for the sleep environment temperature deviation value, the sleep light color temperature value can be updated in real time. For example, when it is detected that the ambient temperature is higher than the sleep environment temperature standard, the sleep light color temperature value can be increased, so that the sleep light is gradually adjusted to a cool color tone to simulate the feeling of a lower temperature, thereby helping the user to fall asleep better. For another example, when it is detected that the ambient temperature is lower than the sleep environment temperature standard, the sleep light color temperature value can be reduced, so that the sleep light is gradually adjusted to a warm color tone to simulate a comfortable warm environment and promote sleep comfort.
[0085] In some embodiments, for the sleep environment humidity deviation value, the sleep light brightness value and the sleep light color temperature value can be updated in real time. For example, when the current environmental humidity is higher than the sleep environment humidity standard, the sleep light brightness value can be reduced or the sleep light color temperature value can be increased, so that the sleep light is gradually adjusted to a cool tone to maintain the user's comfort. For another example, when the current environmental humidity is lower than the sleep environment humidity standard, the sleep light brightness value can be increased or the sleep light color temperature value can be reduced, so that the sleep light is gradually adjusted to a warm tone.
[0086] In some embodiments, for the sleep environment noise deviation value, the sleep light brightness value can be updated in real time. For example, when the current environment noise is higher than the sleep environment noise standard, the sleep light brightness value can be reduced to help the user fall asleep. For another example, when the current environment noise is lower than the sleep environment noise standard, you can choose not to adjust the light. In addition, when the current environment noise is higher than the sleep environment noise standard, you can also remind the user to adjust the noise source in time by personalizing the light flashing.
[0087] In some embodiments, the real-time update of the sleep light parameter value based on the sleep environment deviation value can be achieved through an MLP model with two hidden layers. The MLP model receives the sleep environment data and the current sleep stage, and based on this, obtains the sleep environment deviation value, and predicts and outputs the sleep light brightness value and the sleep light color temperature value. That is, the MLP model can continuously predict the sleep light brightness value and the sleep light color temperature value that can make the sleep environment deviation value approach zero, so as to ensure that the user is in the best sleep environment and improve the user's sleep quality. Among them, the MLP model can be trained using historical data, and the model can be optimized using the mean square error (MSE) loss function and the Adam optimizer.
[0088] Furthermore, after the sleep light brightness value and the sleep light color temperature value are predicted by the MLP model, the sleep light parameter value (the sleep light brightness value and the sleep light color temperature value) can be effectively adjusted by the PID algorithm model to track the preset standard of the sleep environment. That is, the sleep light brightness value and the sleep light color temperature value are dynamically obtained by the PID control algorithm, so that the sleep environment deviation value tends to zero, so as to ensure that the user is in the best sleep environment and improve the user's sleep quality.
[0089] Furthermore, when the sleep light parameter value is updated in real time in response to changes in the current sleep data and the sleep environment data, a first sleep light adjustment curve can be determined.
[0090] Specifically, an embodiment of the present application provides an implementation method for determining the first sleep light adjustment curve, including: obtaining the change rate of the sleep light parameter value; and determining the first sleep light adjustment curve based on the change rate and the sleep light parameter value.
[0091] In some embodiments, when the sleep light parameter value is effectively adjusted through the PID algorithm model to track the preset standard of the sleep environment, since the user's current sleep data and the sleep environment data are changing in real time, the sleep light parameter value is actually also adjusted in real time. This dynamic adjustment mechanism means that in any given time period, a series of continuous parameter values will be generated, such as parameter value 1, parameter value 2, parameter value 3..., and these values actually reflect the changes of the sleep light parameter value over time. At this time, if only the PID algorithm is relied on to quickly respond and adjust the sleep light parameter value, the change of the sleep light may appear abrupt or unnatural, affecting the user's sleep experience. Therefore, in order to ensure that the change of the sleep light is smooth and natural, it is necessary to further obtain and optimize the change rate of the sleep light parameter value through a smooth adjustment curve (Bezier curve or exponential smoothing algorithm), so as to ensure that the sleep light parameter value remains soft and gradual during the change process, avoid the sharp change of the sleep light, and thus achieve the natural transition of the sleep light. At this time, the first sleep light adjustment curve is obtained.
[0092] In some embodiments, a quadratic Bezier curve can be used for smooth adjustment.
[0093] B(t)=(1-t) 2 P0+2(1-t)tP1+t 2 P2
[0094] Among them, P0, P1, and P2 are control points, and t is a parameter with a value range between 0 and 1. When t changes from 0 to 1, B(t) describes a smooth curve from P0 through P1 to P2.
[0095] In the above embodiment, a series of continuous parameter values can be regarded as points on a Bezier curve, and a smooth transition between multiple parameter values can be defined by selecting appropriate control points. For example, parameter value 1, parameter value 2, and parameter value 3 can be regarded as P0, P1, and P2 respectively (or other appropriate control points can be selected), and then a series of smoothly transitioned sleep light parameter values can be obtained by calculating B(t) at different t values. At this time, the first sleep light adjustment curve can be obtained. The first sleep light adjustment curve not only reflects the law of light parameter changes over time, but more importantly, it ensures that such changes are smooth and natural. When the sleep light is dynamically adjusted based on this first sleep light adjustment curve, it can actually fully ensure that the changes in the sleep light not only meet the preset sleep environment standards, but also can be presented in a more user-friendly way, making the light changes more delicate and soft, more in line with human visual perception, thereby helping to improve the user's overall sleep quality and comfort.
[0096] It should be noted that in actual applications, it may be necessary to select Bezier curves of different orders (such as cubic Bezier curves, etc.) and adjust the position and number of control points according to specific needs to achieve the best lighting adjustment effect. This application does not impose any restrictions on this.
[0097] S3. Determine a second sleep light adjustment curve based on the sleep habit parameters; the second sleep light adjustment curve is a sleep light change curve when waking up the user.
[0098] In order to ensure the user's sleep quality, the user's sleep habit parameters should also be taken into consideration when dynamically adjusting the sleep light, so as to ensure that the sleep environment created by the sleep light meets the user's sleep needs. Figure 4 The flowchart of the sleep light adjustment method described in the embodiment of the present application is shown as follows: Figure 4 As shown, determining the second sleep light adjustment curve based on the sleep habit parameters includes steps S31 to S33.
[0099] S31, obtaining the awake time in the sleeping habit parameters.
[0100] Specifically, the sleep habit parameter refers to the regular physiological changes and behavioral patterns of the user in terms of sleep, including the awake time. The awake time refers to the time when the user wakes up naturally from sleep under normal circumstances. As described above, in some embodiments, the awake time can be predicted by the trained LSTM model.
[0101] S32: Determine a wake-up time period of a preset length based on the awake time.
[0102] S33: Determine a plurality of sleep light parameter values within the wake-up time period, wherein the plurality of sleep light parameter values gradually increase to form the second sleep light adjustment curve, and wherein the second sleep light adjustment curve reaches a maximum value during the awake time.
[0103] Specifically, after the awake time is determined, multiple sleep light parameter values can be determined within a preset awake time period. For example, the awake time period can be set to half an hour as needed, and the awake time period can be divided into multiple time intervals, such as one interval every five minutes, and at the end of each time interval, the current sleep light parameter value is recorded, and then the multiple sleep light parameter values within the awake time period will constitute a series of gradually increasing sleep light parameter values, thereby simulating the light changes of a natural sunrise. That is, within the awake time period, multiple sleep light parameter values should gradually increase, reach a maximum value at the awake time, and then maintain for a period of time, thereby achieving the effect of simulating a natural sunrise, helping the user to wake up naturally and feel energetic without strong stimulation. Among them, in some embodiments, multiple sleep light parameter values within the awake time period can be determined by an exponential growth curve, thereby determining the second sleep light adjustment curve, and the second sleep light adjustment curve reaches a maximum value at the awake time.
[0104] In some embodiments, the wake-up time period is set to 6:30 to 7:00. In the wake-up time period, obtaining a plurality of the sleep light brightness values can be expressed as:
[0105]
[0106] Among them, ymin is the minimum parameter value (the sleep light brightness value at the beginning of the wake-up period), ymax is the maximum parameter value (the sleep light brightness value during the awake time), max_time is the total time of the wake-up period (in minutes or seconds), and x is the current time (the time calculated from the beginning of the wake-up period). In fact, ymax can be customized by the user, or it can be set with reference to the local basic sunrise data. In addition, b is a growth factor that needs to be adjusted, which determines the speed at which the sleep light brightness value increases. For example, if we want the sleep light brightness value to increase smoothly and quickly during the wake-up period, we can choose b=1.1 to calculate multiple sleep light brightness values in the wake-up period from 6:30 to 7:00, and these sleep light brightness values will constitute an exponential growth curve, that is, the second sleep light adjustment curve, which is used to simulate the light changes of natural sunrise.
[0107] It should be noted that users can adjust the change speed and target value of sleep light parameter values such as sleep light brightness value and sleep light color temperature value according to their preferences and needs to obtain the best wake-up experience.
[0108] S4. Dynamically adjust the sleep light based on the first sleep light adjustment curve and the second sleep light adjustment curve.
[0109] Specifically, when the wake-up time period has not yet been reached, the sleep light is dynamically adjusted based on the first sleep light adjustment curve; when the wake-up time period has been reached, the sleep light is dynamically adjusted based on the second sleep light adjustment curve. In some embodiments, the user can control the start time of the dynamic adjustment of the sleep light through a mobile phone APP, and the sleep light is dynamically adjusted based on the first sleep light adjustment curve from the start time. When the wake-up time period has been reached, the sleep light is automatically adjusted based on the second sleep light adjustment curve, thereby ensuring that the user is in the best sleeping environment while sleeping, and when awakening is required, the adjustment curve can be automatically switched, and the awakening service can be better provided by simulating the natural sunrise, ensuring that the user can wake up naturally and avoiding the discomfort caused by forced awakening.
[0110] In addition, the sleep light adjustment method provided in the embodiment of the present application can also perform preference learning and adaptive learning, so as to achieve precise light adjustment, actively adapt to user needs, and improve user experience.
[0111] Specifically, the user's lighting adjustment preference data and sleep feedback data are obtained; based on the lighting adjustment preference data and the sleep feedback data, the first sleep light adjustment curve and the second sleep light adjustment curve are optimized and adjusted to meet the user's personalized sleep light adjustment needs and improve the flexibility of dynamic adjustment of sleep light.
[0112] In some embodiments, for the lighting adjustment preference data, the lighting parameters and preference settings manually adjusted by the user each time (such as the preferred sleeping light brightness value and sleeping light color temperature value, sleeping and waking time) are recorded, and the user's preferences are matched with the data of other similar users using a user-based collaborative filtering algorithm to recommend similar lighting adjustment solutions. The recommendation weight of the collaborative filtering model is continuously adjusted according to the user's preference settings, so that the lighting solutions recommended by it are more in line with user needs, thereby achieving optimized learning.
[0113] In some embodiments, for sleep feedback data, a reward function is set based on user feedback (such as whether the user feels that falling asleep is smoother or waking up is more natural through sleep light adjustment), and the reward can be set based on the improvement of the user's sleep quality. In addition, the sleep light adjustment strategy is updated using the Q-learning algorithm. Each time, the Q value is updated after feedback is obtained based on the current state (user sleep stage) and behavior (adjusting the light), so that the Q-learning algorithm is continuously optimized and learned to obtain the optimal sleep light adjustment strategy, so that the sleep light is more in line with the user's sleep habits and personalized sleep light needs.
[0114] In some embodiments, the sleep light adjustment effect can also be recorded and analyzed based on user feedback. For example, an adaptive optimization algorithm (such as particle swarm optimization PSO or genetic algorithm) is used to automatically adjust the light adjustment parameters according to the sleep improvement data to output a first sleep light adjustment curve and a second sleep light adjustment curve that better meet the user's personalized sleep light bar adjustment needs.
[0115] Figure 5 The schematic diagram is a schematic diagram showing the principle of the sleep light adjustment method in one embodiment of the present application. Figure 5 As shown, when the sleep light adjustment starts, it will be determined in real time whether it has entered the wake-up time period. When the wake-up time period has not entered, the user's current sleep data and the sleep environment data are obtained in real time, and the user's current sleep stage is determined based on the current sleep data. After determining the user's current sleep stage, the corresponding sleep environment preset standard will be obtained. After that, the sleep environment deviation value is obtained based on the sleep environment data and the sleep environment preset standard. In this process, the sleep light parameter value will be obtained in real time, so as to control the sleep light so that the sleep environment deviation value tends to zero, thereby obtaining the first sleep light adjustment curve. That is, in fact, before entering the wake-up time period, the sleep light is always in the dynamic adjustment process, and the entire dynamic adjustment will determine a sleep light adjustment curve. When entering the wake-up time period, the user's sleep habit parameters will be automatically obtained, so as to determine multiple sleep light parameter values, thereby obtaining a sleep light adjustment curve, that is, the second sleep light adjustment curve, to achieve a wake-up effect simulating a natural sunrise. In addition, the first sleep light adjustment curve and the second sleep light adjustment curve are actually always dynamic. In other words, the entire dynamic adjustment process of the sleep light is expressed as a curve. As mentioned above, the user can also freely adjust the adjustment curve based on feedback learning.
[0116] Therefore, the sleep light adjustment method provided in the embodiment of the present application can first determine the first sleep light adjustment curve based on the user's sleep data and sleep environment data, thereby updating the sleep light parameter value in real time, realizing dynamic adjustment of the sleep light, and then realizing the best sleep environment to ensure the user's sleep quality. Secondly, the method can determine the second sleep light adjustment curve based on the user's sleep habit parameters, simulating the effect of natural sunrise in a dim sleep environment, thereby naturally waking up the user and satisfying the user's sleep habits. Finally, through optimization learning, the first sleep light adjustment curve and the second sleep light adjustment curve can be continuously adjusted to better meet the personalized sleep light adjustment needs of different users.
[0117] The protection scope of the sleep light adjustment method described in the embodiment of the present application is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0118] The embodiment of the present application also provides a sleep light adjustment system, which can implement the sleep light adjustment method described in the present application. However, the implementation device of the sleep light adjustment system described in the present application includes but is not limited to the structure of the sleep light adjustment system listed in the present embodiment. All structural deformations and replacements of the prior art made according to the principles of the present application are included in the protection scope of the present application.
[0119] Figure 6 The structure diagram of the sleep light adjustment system according to the embodiment of the present application is shown as follows: Figure 6 As shown, the sleep light adjustment system 4 includes an acquisition module 41 , a first curve module 42 , a second curve module 43 and an adjustment module 44 .
[0120] An acquisition module 41 is used to acquire the user's current sleep data, sleep environment data and sleep habit parameters;
[0121] The first curve module 42 is used to determine a first sleep light adjustment curve based on the current sleep data and the sleep environment data; the first sleep light adjustment curve is a sleep light change curve for a sleep aid user;
[0122] A second curve module 43 is used to determine a second sleep light adjustment curve based on the sleep habit parameter; the second sleep light adjustment curve is a sleep light change curve when waking up the user;
[0123] The adjustment module 44 is configured to dynamically adjust the sleep light based on the first sleep light adjustment curve and the second sleep light adjustment curve.
[0124] It should be noted that the structures and principles of the acquisition module 41, the first curve module 42, the second curve module 43 and the adjustment module 44 correspond one to one with the steps in the above-mentioned sleep light adjustment method, so they are not described in detail here.
[0125] In the several embodiments provided in the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules or units, which can be electrical, mechanical or other forms.
[0126] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0127] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0128] The present application embodiment also provides a computer-readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by a program to instruct the processor, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state hard disk (SSD)), etc.
[0129] The embodiment of the present application further provides an electronic device, wherein the electronic device includes a processor and a memory.
[0130] The memory is used to store computer programs.
[0131] The memory includes: ROM, RAM, disk, USB flash drive, memory card or CD and other media that can store program codes.
[0132] The processor is connected to the memory and is used to execute the computer program stored in the memory so that the electronic device executes the above-mentioned sleep light adjustment method.
[0133] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0134] like Figure 7As shown, the electronic device of the present application is in the form of a general computing device. The components of the electronic device may include but are not limited to: one or more processors or processing units 51, a memory 52, and a bus 53 connecting different system components (including the memory 52 and the processing unit 51).
[0135] Bus 53 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0136] Electronic devices typically include a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device, including volatile and non-volatile media, removable and non-removable media.
[0137] The memory 52 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 521 and / or cache memory 522. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 523 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 not shown, usually called a "hard drive"). Although Figure 7 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus 53 via one or more data medium interfaces. The memory 52 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0138] A program / utility 524 having a set (at least one) of program modules 5241 may be stored, for example, in the memory 52, such program modules 5241 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 5241 generally perform the functions and / or methods of the embodiments described herein.
[0139] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, displays, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via input / output (I / O) interface 54. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 55. Figure 7 As shown, the network adapter 55 communicates with other modules of the electronic device via the bus 53. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0140] The present application embodiment may also provide a computer program product, the computer program product including one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer or data center.
[0141] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.
[0142] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0143] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A method for adjusting sleep light, characterized in that: The method comprises: Obtain the user's current sleep data, sleep environment data, and sleep habit parameters; Determine a first sleep light adjustment curve based on the current sleep data and the sleep environment data; the first sleep light adjustment curve is a sleep light change curve for a sleep aid user; Determine a second sleep light adjustment curve based on the sleep habit parameter; the second sleep light adjustment curve is a sleep light change curve when waking up the user; The sleep light is dynamically adjusted based on the first sleep light adjustment curve and the second sleep light adjustment curve.
2. The sleep light adjustment method according to claim 1, characterized in that: Determining a first sleep light adjustment curve based on the current sleep data and the sleep environment data includes: Initialize the sleep light parameter value; In response to changes in the current sleep data and the sleep environment data, the sleep light parameter value is updated in real time to determine a first sleep light adjustment curve.
3. The sleep light adjustment method according to claim 2, characterized in that: In response to changes in the current sleep data and the sleep environment data, updating the sleep light parameter in real time includes: identifying a current sleep stage of the user based on the current sleep data; Obtaining a preset sleep environment standard corresponding to the current sleep stage; Acquire a sleep environment deviation value based on the sleep environment preset standard and the sleep environment data; The sleep light parameter value is updated in real time based on the sleep environment deviation value, so as to adjust the sleep light by the sleep light parameter value so that the sleep environment deviation value approaches zero.
4. The method for adjusting the sleeping light according to claim 2, characterized in that: Determining the first sleep light adjustment curve includes: Obtaining the change rate of the sleep light parameter value; The first sleep light adjustment curve is determined based on the change rate and the sleep light parameter value.
5. The method for adjusting the sleeping light according to claim 1, characterized in that: Determining the second sleep light adjustment curve based on the sleep habit parameter includes: Obtaining the awake time in the sleep habit parameters; determining a wake-up time period of a preset length based on the awake time; A plurality of sleep light parameter values are determined during the wake-up time period, and the plurality of sleep light parameter values are gradually increased to form the second sleep light adjustment curve, and the second sleep light adjustment curve reaches a maximum value during the awake time.
6. The method for adjusting the sleeping light according to claim 5, characterized in that: Dynamically adjusting the sleep light based on the first sleep light adjustment curve and the second sleep light adjustment curve includes: When the wake-up time period has not yet arrived, dynamically adjusting the sleep light based on the first sleep light adjustment curve; When entering the wake-up time period, switch to dynamically adjusting the sleep light based on the second sleep light adjustment curve.
7. The method for adjusting the sleeping light according to claim 1, characterized in that: The method further comprises: Obtain the user's lighting adjustment preference data and sleep feedback data; The first sleep light adjustment curve and the second sleep light adjustment curve are optimized and adjusted based on the light adjustment preference data and the sleep feedback data to meet the user's personalized sleep light adjustment needs.
8. A sleeping light adjustment system, characterized in that: The system comprises: An acquisition module is used to acquire the user's current sleep data, sleep environment data, and sleep habit parameters; A first curve module, used to determine a first sleep light adjustment curve based on the current sleep data and the sleep environment data; the first sleep light adjustment curve is a sleep light change curve for a sleep aid user; A second curve module, used to determine a second sleep light adjustment curve based on the sleep habit parameter; the second sleep light adjustment curve is a sleep light change curve when waking up the user; An adjustment module is used to dynamically adjust the sleep light based on the first sleep light adjustment curve and the second sleep light adjustment curve.
9. A sleeping light adjustment device, characterized in that: include: Processor and memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory, so that the electronic device executes the sleep light adjustment method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by an electronic device, the sleep light adjustment method described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Bio-rhythm light dynamic adjustment method and system
CN116390302A
Sleep environment light self-adjusting system and method based on sleep staging evaluation
CN118059370A
Cited By
Sleep monitoring system and method
CN121694686A