Intelligent sleep-aiding decision-making method and system based on data analysis
Through the intelligent sleep aid decision-making method based on CGAN, personalized sleep state trajectory is generated and sleep aid strategies are dynamically adjusted, which solves the problem of the lack of personalization and intelligence of traditional sleep aid methods, and significantly improves the quality of sleep.
Patent Information
- Application Number
- CN202510287283.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-06-06
AI Technical Summary
Traditional sleep aid methods lack personalization and intelligence, making it difficult to meet the differentiated sleep needs of different users, resulting in poor sleep aid effects.
Using an intelligent sleep-aided decision-making method based on conditional generation adversarial network (CGAN), through big data acquisition and deep learning algorithms, personalized sleep state trajectories are generated, and the user's physiological state and sleep environment parameters are monitored in real time, and the sleep aid strategy is dynamically adjusted.
It significantly improves sleep quality, provides personalized and dynamic sleep-aided decisions, and can customize the optimal sleep plan according to the specific needs and conditions of the user.
Smart Images

Figure CN120093229A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to an intelligent sleep-aiding decision-making method and system based on data analysis. Background Art
[0002] With the increasing social pressure and the accelerated pace of life, insomnia has become an increasingly serious public health problem. Traditional sleep aids, such as drug therapy and music relaxation, often rely on manual settings and one-size-fits-all strategies, lacking personalization and intelligence, and are difficult to meet the differentiated sleep needs of different users.
[0003] In response to the above problems, the present invention proposes a personalized sleep-aiding decision-making method based on trajectory optimization. This method uses the sleep capsule as a carrier, automatically optimizes the user's sleep state trajectory in a predetermined time period through big data collection and deep learning algorithms, and dynamically generates a personalized sleep-aiding strategy, thereby significantly improving sleep quality. Summary of the invention
[0004] In view of the defects existing in the above-mentioned prior art, the present invention provides an intelligent sleep-aiding decision-making method based on data analysis, the method comprising:
[0005] A generative model for training sleep state trajectories based on the Generative Adversarial Network (CGAN);
[0006] According to the user's personal state representation and the scheduled duration of the sleeping cabin, the trained CGAN model is used to generate personalized sleep state trajectories to control the operation of the sleeping cabin environment;
[0007] During sleep, the user's physiological state and sleep environment parameters are monitored in real time and compared with the generated sleep state trajectory. When the deviation exceeds the preset conditions, the sleep state trajectory is regenerated.
[0008] Among them, environmental sensors and physiological signal sensors are arranged in the sleeping capsule cabin.
[0009] Among them, for the time series data in the initial state of each modality, the convolutional neural network CNN and the long short-term memory network LSTM deep learning model are used to extract local and global spatiotemporal features respectively.
[0010] Among them, the attention mechanism is used to perform weighted fusion of the features of different modalities, adaptively adjust the importance weight of each modality, and generate a unified sleep state feature vector;
[0011] User portrait features are introduced and concatenated with the sleep state feature vector to form a user state representation.
[0012] The user's sleep process is represented by a state trajectory [U_1, U_2, ..., U_T], where any point U_t in the state trajectory represents the user state at the t-th time step, including the environmental signal and physiological signal information of the sleeping cabin;
[0013] Fill the state trajectories of all users to a unified maximum length T_max, where T_max is set according to the maximum bookable time period of the sleeping cabin;
[0014] For users whose sleep duration is less than the maximum value, their status trajectory is padded with zeros until the length reaches T_max.
[0015] The effective sleep duration T of the user is used as one of the conditional variables and input into the generator G and the discriminator D together with the user state representation U to generate personalized sleep state trajectories that match the sleep duration of different users.
[0016] Let z represent random noise, which follows the standard normal distribution N(0,1); U represents the user state representation, which is a d-dimensional real-valued vector; T represents the user's scheduled sleep capsule usage time;
[0017] The generator G and discriminator D of CGAN can be expressed as:
[0018] G(z,U,T):R^r×R^d×Z→R^{T×s},
[0019] D(x,U,T):R^{T×s}×R^d×Z→[0,1],
[0020] Among them, G(z,U,T): represents the function mapping of the generator; D(x,U,T): represents the function mapping of the discriminator;
[0021] R represents a real number set, r is the dimension of the noise z, d is the dimension of the user state representation U, and s is the characteristic dimension of the sleep state at each time step; the generator G takes z, U and T as inputs and outputs a sleep state trajectory with a length of T and a characteristic dimension of s; T: represents the user's scheduled sleep capsule usage time, and the sleep duration T belongs to the integer set Z;
[0022] The discriminator D takes the state trajectory x, user state U and sleep duration T as input, and outputs a real value between 0 and 1, indicating the probability that x is the true trajectory.
[0023] Among them, the training goal of the CGAN is to solve the following minimum and maximum problems:
[0024] min_G max_D V(D,G)=E_{xp_data(x|U,T)}[log D(x|U,T)]+
[0025] E_{zp_z(z)}[log(1-D(G(z|U,T)|U,T))],
[0026] in,
[0027] min_G: indicates minimization optimization of the parameters of generator G;
[0028] max_D: indicates maximizing the optimization of the parameters of the discriminator D;
[0029] V(D,G): represents the objective function of the discriminator D and the generator G, also known as the adversarial loss function;
[0030] E_{xp_data(x|U,T)}[log D(x|U,T)]: represents the expected loss of the discriminator under the real data distribution;
[0031] p_data(x|U,T) represents the conditional probability distribution of real data, which is the real distribution of sample x under given conditions (U,T);
[0032] D(x|U,T) represents the probability that the discriminator judges sample x as a true sample under given conditions (U,T);
[0033] log D(x|U,T) represents the logarithmic probability that the discriminator judges the real sample as true;
[0034] E_{zp_z(z)}[log(1-D(G(z|U,T)|U,T))]: represents the expected loss of the discriminator under the generated data distribution;
[0035] p_z(z) represents the prior probability distribution of random noise z, which is usually a simple Gaussian distribution or uniform distribution;
[0036] G(z|U,T) represents the sample generated by the generator under given conditions (U,T) and noise z;
[0037] D(G(z|U,T)|U,T) represents the probability that the discriminator judges the generated sample G(z|U,T) as a true sample under given conditions (U,T);
[0038] log(1-D(G(z|U,T)|U,T)) represents the logarithmic probability that the discriminator judges the generated sample as false; x: represents a real or generated sleep state trajectory;
[0039] U: a d-dimensional real-valued vector that encodes the user's status information;
[0040] T: indicates the sleep time scheduled by the user, in minutes;
[0041] z: represents a random noise vector, which obeys Gaussian distribution or uniform distribution;
[0042] p_data(x|U,T): represents the conditional probability distribution of real data; under given conditions (U,T), describes the probability distribution of real sample x;
[0043] p_z(z): represents the prior probability distribution of random noise z, usually a simple Gaussian distribution or uniform distribution; in the generator G, noise z is sampled from this distribution;
[0044] G(z|U,T): represents the conditional generating function of the generator G; given the condition (U,T) and the random noise z, it generates the corresponding data sample; in the present invention, G(z|U,T) generates a sleep state trajectory of length T that meets the user condition U;
[0045] D(x|U,T): represents the conditional discriminant function of the discriminator D; under given conditions (U,T), it determines the probability that the data sample x is a true sample.
[0046] Among them, the generated sleep state trajectory x_gen is used to control the operation of the sleep cabin environment;
[0047] The sleeping cabin uses PID control to adjust the environmental parameters in the cabin according to the state characteristics of x_gen at each moment, so that the environmental data monitored by the environmental sensors in the sleeping cabin are close to the multi-mode environmental data in x_gen at the corresponding moment.
[0048] Among them, the sleeping cabin monitors the actual sleeping state of the user based on the state trajectory x_gen. When the monitoring system of the sleeping cabin compares the actually collected user sleep state characteristics with the physiological state data at the corresponding time in x_gen, and finds that the deviation between the sampling value of any physiological sensor in actual sleep and the value of the corresponding physiological sensor at the corresponding time in the state trajectory x_gen exceeds the threshold, based on the remaining usage time of the sleeping cabin reserved by the user and the user status representation of the user at the current moment, the personalized sleep state trajectory of the remaining usage time of the sleeping cabin reserved by the user is regenerated.
[0049] The present invention also discloses an intelligent sleep-aiding decision-making system based on data analysis, the system comprising a processor and a memory, the memory storing a computer program, and the processor being used to execute the computer program to implement an intelligent sleep-aiding decision-making method based on data analysis.
[0050] The present invention introduces a conditional generative adversarial network (CGAN) to establish a generative model for personalized sleep state trajectories, and explores the correlation between user status, sleep environment and sleep quality by learning a large number of users' historical sleep data. The present invention generates personalized sleep state trajectories based on the user's personal status representation and scheduled sleep duration using a trained CGAN model as a guide plan for the operation of the sleep cabin. During the sleep process, the user's physiological state and sleep environment parameters are monitored in real time, and compared with the generated sleep state trajectory. When deviations are found, a dynamic adjustment mechanism is triggered to regenerate an optimized sleep plan.
[0051] The present invention provides a personalized and dynamic intelligent sleep-aid decision-making method, which can customize the optimal sleep plan according to the user's specific needs and conditions, and significantly improve the sleep-aid effect and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0053] Figure 1 The present invention is a flowchart showing an intelligent sleep aid decision-making method based on data analysis according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.
[0056] It should be understood that although the terms first, second, third, etc. may be used to describe ... in the embodiments of the present invention, these ... should not be limited to these terms. These terms are only used to distinguish .... For example, without departing from the scope of the embodiments of the present invention, the first ... may also be referred to as the second ..., and similarly, the second ... may also be referred to as the first ....
[0057] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0058] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0059] It should also be noted that the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the commodity or device including the elements.
[0060] Traditional sleep-aiding methods usually use uniform environment settings and sleep plans, but fail to fully consider individual differences and real-time sleep status of users, resulting in poor sleep-aiding effects. Users' sleep preferences, habits, and environmental conditions are diverse and dynamic, and it is difficult to describe and predict the optimal sleep plan through simple rules or models. The user's actual sleep state may deviate from the predetermined sleep plan, which requires timely detection and adjustment to ensure the sleep-aiding effect.
[0061] The purpose of the present invention is to provide a personalized sleep-aid decision-making method based on trajectory optimization, which automatically learns the optimal sleep trajectory by acquiring the user's sleep environment and physiological state data, and dynamically adjusts the sleep-aid strategy to guide the user's actual sleep state to converge to the optimal trajectory.
[0062] like Figure 1 As shown, the present invention discloses an intelligent sleep-aiding decision-making method based on data analysis, which is characterized by including the following operations: data collection and preprocessing, multimodal feature extraction and fusion, sleep state trajectory optimization model training, personalized sleep-aiding strategy generation, and online strategy execution and trajectory tracking.
[0063] The present invention introduces a conditional generative adversarial network (CGAN) to establish a generative model for personalized sleep state trajectories, and explores the correlation between user status, sleep environment and sleep quality by learning a large number of users' historical sleep data. The present invention generates personalized sleep state trajectories based on the user's personal status representation and scheduled sleep duration using a trained CGAN model as a guide plan for the operation of the sleep cabin. During the sleep process, the user's physiological state and sleep environment parameters are monitored in real time, and compared with the generated sleep state trajectory. When deviations are found, a dynamic adjustment mechanism is triggered to regenerate an optimized sleep plan.
[0064] Optionally, the data collection and preprocessing specifically includes arranging temperature, humidity, air pressure, noise, and light environment sensors, as well as heart rate, body movement, breathing and other physiological signal sensors in the sleeping capsule cabin to collect the user's sleeping environment and physiological state data in real time;
[0065] Perform pre-processing operations such as cleaning, denoising, and normalization on the collected raw data to eliminate outliers;
[0066] The preprocessed data are aligned according to timestamps to form a multimodal time series dataset of environmental-physiological states.
[0067] Optionally, for the time series data in the initial state of each modality, a convolutional neural network (CNN) and a long short-term memory network (LSTM) deep learning model are used to extract local and global spatiotemporal features respectively;
[0068] The sensor data of each modality is collected within the initial time period when the user enters the sleeping cabin to form time series data of the initial state of each modality. The initial time period may be a preset time period, such as within 5 minutes or within 3 minutes.
[0069] The attention mechanism is used to perform weighted fusion of features of different modalities, adaptively adjust the importance weight of each modality, and generate a unified sleep state feature vector;
[0070] User portrait features such as age, gender, and weight index are introduced and combined with sleep status features to form a personalized user status representation.
[0071] Among them, CNN can use a one-dimensional convolution kernel to extract the local features and translation invariance of the sequence; LSTM can use a multi-layer bidirectional structure to extract the long-term dependencies and contextual information of the sequence; the attention mechanism uses additive attention or dot product attention to automatically assign modal weights according to task relevance; user portraits are collected through questionnaires or smart bracelets, and user static features are incorporated.
[0072] Specifically, for the time series data of each modality obtained in step 1, a combined model of convolutional neural network (CNN) and long short-term memory network (LSTM) is used to extract the local and global spatiotemporal features of the data respectively.
[0073] Among them, CNN uses a 1D convolution kernel to perform sliding window operations on the data in the time dimension to extract local feature patterns and translation invariance of sequence data. CNN uses multiple convolutional layers and pooling layers to stack alternately to gradually improve the abstract level of features.
[0074] LSTM adopts a multi-layer bidirectional structure to forward and backward propagate the local feature sequence extracted by CNN in the time dimension to mine the long-term dependency and contextual information of the feature sequence. The output of the bidirectional LSTM is merged at the last time step to obtain a global feature vector containing the semantics of the context.
[0075] Among them, the attention mechanism is used to perform adaptive weighted fusion on the feature vectors extracted from different modalities in the above process.
[0076] Specifically, for the local feature matrices L1, L2, ..., Lm and global feature vectors G1, G2, ..., Gm of the m modalities, the importance weights α1, α2, ..., αm of each modality are calculated through the attention mechanism. The weight calculation can use additive attention or dot product attention.
[0077] The attention mechanism adaptively assigns the importance of different features to multiple input features through learned weights, highlights features that are more relevant to the current task or query, and suppresses less relevant features, thereby achieving selective fusion of features.
[0078] In step 2 of the present invention, it is necessary to fuse features extracted from heterogeneous data collected by multiple sensors, such as environmental features (temperature, humidity, etc.) and physiological features (body movement, breathing, heart rate, etc.).
[0079] The attention mechanism automatically learns the importance of features through the following steps to achieve smarter multimodal fusion:
[0080] The local feature matrices L1, L2, ..., Lm and the global feature vectors G1, G2, ..., Gm of the m modes are concatenated by columns to form a large multimodal feature matrix M:
[0081] M=[L1, L2,...,Lm; G1, G2,...,Gm].
[0082] Among them, the number of rows of M is the feature dimension, and the number of columns is the modal number m.
[0083] Select additive attention or dot product attention to calculate the attention score of each column feature, indicating the relevance or importance of the column feature to the fusion task.
[0084] (1) Additive attention:
[0085] The multimodal feature M is linearly transformed through the learnable matrix W1 and the bias vector b1 to map all features to the same space;
[0086] Then, nonlinearity is introduced through the hyperbolic tangent activation function tanh to enhance the expressiveness of the features;
[0087] Next, the activated features are linearly transformed through the learnable matrix W2 and the bias vector b2 to compress them into an m-dimensional attention score vector a;
[0088] Finally, a is exponentially normalized through the softmax function to obtain the attention weights α1, α2, ..., αm of the m modalities.
[0089] The whole process can be expressed as:
[0090] a=W2·tanh(W1·M+b1)+b2,
[0091] α1, α2,..., αm=softmax(a).
[0092] (2) Dot Product Attention:
[0093] Through matrix multiplication, the query vector query (related to the fusion task) is dot-producted with the key vectors key1, key2, ..., keym (feature mapping) of the m modes to obtain the m-dimensional attention score vector a;
[0094] Among them, query and key are both learnable vectors, and the original features are mapped to the same space for comparison.
[0095] In dot product attention, two learnable vectors are introduced: the query vector query and the key vector key. Their function is to map the original features of different modalities into the same semantic space for correlation calculation and importance evaluation.
[0096] Assume that there are m modal eigenvectors f1, f2, ..., fm, and the dimension of each eigenvector is d, that is,
[0097] Query is a d-dimensional learnable vector that represents the fusion task or query semantics and is used to guide the correlation calculation of multimodal features.
[0098] The query can be randomly initialized and learned and optimized together with other parameters during model training to adaptively capture task-related information.
[0099] For example, in the sleep state assessment task, the query can learn semantic representations related to sleep quality, sleep stage, etc.
[0100] For each mode i, design a linear mapping matrix Map the original feature vector fi of the mode to the key vector keyi:
[0101] keyi=Wi-Fi,
[0102] Among them, Wi is a learnable parameter matrix, which transforms the original feature space Mapping to attention computation space
[0103] By learning Wi, features of different modalities can be mapped to the same semantic space, making them comparable.
[0104] Wi can be randomly initialized and learned and optimized together with other parameters during model training to adaptively adjust the mapping function.
[0105] Concatenate query and keyi of m modes by column to form a d×m key matrix K:
[0106] K=[key1,key2,...,keym].
[0107] By matrix multiplication, we perform dot product between query and K to obtain the m-dimensional attention score vector a:
[0108] a=query·K,
[0109] =query·[key1,key2,...,keym],
[0110] =[query·key1,query·key2,...,query·keym],
[0111] Among them, query·keyi represents the inner product of query and the key vector keyi of the i-th modality, that is, they are in the attention calculation space similarity or correlation in .
[0112] The larger the inner product, the more similar the query is to keyi, that is, the more relevant the features of the i-th modality are to the fusion task, and a higher attention weight should be assigned.
[0113] Dot product attention maps the original features of different modalities to the same attention calculation space by learning query and key, and measures their relevance to the fusion task through inner product to obtain the attention score vector a. This mapping and calculation method can adaptively align the features of different modalities, highlight the information related to the task, and improve the effect of multimodal fusion.
[0114] Then, a is exponentially normalized through the softmax function to obtain the attention weights α1, α2, ..., αm of the m modalities.
[0115] The whole process can be expressed as:
[0116] a=query·[key1,key2,...,keym],
[0117] α1, α2,..., αm=softmax(a).
[0118] Among them, the softmax function in the additive attention weight or dot product attention weight is defined as follows:
[0119] softmax(a)=[exp(a1) / sum(exp(a)),exp(a2) / sum(exp(a)),...,exp(am) / sum(exp(a))],
[0120] Among them, exp(.) represents the exponential function with base e, and sum(exp(a)) represents the sum of m exponential values, which is used for normalization.
[0121] The softmax function maps each element ai in a to the interval (0,1), and the sum of the m elements is 1, forming a probability distribution.
[0122] Specifically, the larger the ai value, the larger the exp(ai), and after normalization, the larger the attention weight αi of the i-th modality.
[0123] Finally, according to the obtained additive attention weights or dot product attention weights α1, α2, ..., αm, the local features L1, L2, ..., Lm and the global features G1, G2, ..., Gm of the m modes are weighted summed to obtain the fused sleep state feature vector S:
[0124] S=α1·[L1;G1]+α2·[L2;G2]+...+αm·[Lm;Gm],
[0125] Among them, [L1; G1] means L1 and G1 are concatenated by column.
[0126] Among them, the user's age, gender, weight index and other portrait features are collected through questionnaires, smart bracelets, etc., and recorded as discrete variables or continuous variables. Discrete variables (such as gender) are one-hot encoded, and continuous variables (such as age) are min-max normalized to obtain a standardized user portrait feature vector P.
[0127] The obtained sleep state feature S is concatenated with the user portrait P by column to obtain a personalized user state representation U: U = [S; P].
[0128] The user state U integrates multimodal information such as the environment, physiological parameters, and personal attributes in the initial state of the sleep cabin, and continues to serve as the input basis for subsequent sleep state trajectory optimization and sleep-aid strategy generation.
[0129] Optionally, for each user, the sleep state trajectory optimization model training includes:
[0130] Specifically, according to the sleep duration scheduled by the user, the sleep duration is H hours (for example, the user sets the sleep capsule to use for 8 hours), the sleep duration is discretized into T time steps, each time step represents a state at a moment. The time interval Δt can be flexibly set according to demand, such as Δt = 1 minute, then T = H*60.
[0131] Then the user's complete sleep process can be expressed as a state trajectory:
[0132] U_t:T=[U_1,U_2,...,U_T]
[0133] Among them, any point U_t in the state trajectory represents the user state at the tth time step, including the multimodal environmental signals of the sleeping cabin and various physiological signal information.
[0134] Since the sleep duration H of different users may be different, it is necessary to fill the state trajectories of all users with a unified maximum length T_max to facilitate batch processing and comparison.
[0135] T_max can be set according to the maximum bookable time period of the sleeping cabin, such as 16 hours, then T_max = 1660 = 960.
[0136] For users whose sleep duration H is less than the maximum value, their state trajectory is padded with zeros until the length reaches T_max, that is, [U_1,U_2,...,U_T,0,...,0].
[0137] In this way, we obtain a batch of user sleep state trajectories with a uniform length of T_max but an actual effective length of T.
[0138] During the training process of the generative adversarial network, the user's effective sleep time T is used as one of the conditional variables and input into the generator G and the discriminator D together with the user state representation U: G(z,U,T), D(x,U,T).
[0139] T is the number of minutes expressed as the usage time of the sleeping cabin capsule reserved for the user.
[0140] By introducing sleep duration T as a condition, the generator and discriminator can generate and discriminate personalized sleep state trajectories that match the actual sleep duration of different users.
[0141] In one embodiment, the present invention discloses a method for generating personalized sleep state trajectories based on conditional generative adversarial networks (CGAN). The method uses the effective sleep duration T of the user as one of the conditional variables, and inputs it into the generator G and the discriminator D together with the user state representation U to generate personalized sleep state trajectories that match the sleep duration of different users. The user state U integrates multimodal information such as the environment, physiological parameters, and personal attributes of the sleep cabin in the initial state of use.
[0142] Specifically, let z represent random noise, which obeys the standard normal distribution N(0,1); U represents the user state representation, which is a d-dimensional real-valued vector that encodes the user's sleep preferences, environmental conditions and other personalized information; T represents the user's scheduled sleep capsule usage time, in minutes, which is a positive integer. Then the generator G and discriminator D of CGAN can be expressed as:
[0143] G(z,U,T):R^r×R^d×Z→R^{T×s},
[0144] D(x,U,T):R^{T×s}×R^d×Z→[0,1],
[0145] Where r is the dimension of the noise z, d is the dimension of the user state representation U, and s is the feature dimension of the sleep state at each time step. The generator G takes z, U, and T as inputs and outputs a sleep state trajectory with a length of T and a feature dimension of s. The discriminator D takes the state trajectory x, the user state U, and the sleep duration T as inputs and outputs a real value between 0 and 1, indicating the probability that x is a true trajectory.
[0146] The training goal of CGAN is to solve the following minimum and maximum problems:
[0147] min_G max_D V(D,G)=E_{xp_data(x|U,T)}[log D(x|U,T)]+E_{zp_z(z)}[log(1-D(G(z|U,T)|U,T))],
[0148] Among them, p_data(x|U,T) represents the conditional distribution of the real sleep state trajectory x under the given user state U and sleep duration T. p_z(z) represents the prior distribution of random noise z, which is generally taken as the standard normal distribution N(0,1).
[0149] For the above objective function, the training goal of the conditional generative adversarial network (CGAN) is that the generator G and the discriminator D should play a minimum-maximum game. Specifically, the min_G max_D on the left side of the formula means that a minimum-maximum problem needs to be solved: the generator G should minimize the objective function V(D,G), while the discriminator D should maximize the objective function V(D,G).
[0150] The objective function V(D,G) consists of two terms, corresponding to the loss of the discriminator D and the loss of the generator G:
[0151] The term E_{xp_data(x|U,T)}[log D(x|U,T)] represents the loss of the discriminator D on the real data. Among them, p_data(x|U,T) represents the conditional distribution of the real sleep state trajectory x under the given condition (U,T). E_{xp_data(x|U,T)} represents sampling the real trajectory x from this conditional distribution and calculating its expectation.
[0152] log D(x|U,T) represents the logarithmic probability that the discriminator D identifies the true trajectory x as the true trajectory.
[0153] Therefore, the meaning of this item is that the discriminator D should try its best to identify the true trajectory x as the true trajectory, so as to maximize log D(x|U,T) and improve its ability to distinguish real data.
[0154] The term E_{zp_z(z)}[log(1-D(G(z|U,T)|U,T))] represents the loss of the generator G. Among them, p_z(z) represents the prior distribution of random noise z, which is usually a standard normal distribution N(0,1). E_{zp_z(z)} represents sampling noise z from this prior distribution and calculating its expectation.
[0155] G(z|U,T) means that the generator G takes noise z and condition (U,T) as input to generate a fake sleep state trajectory.
[0156] D(G(z|U,T)|U,T) represents the probability that the discriminator D identifies the false trajectory generated by the generator G as a real trajectory.
[0157] log(1-D(G(z|U,T)|U,T)) represents the logarithmic probability that the discriminator D will identify the false trajectory generated by the generator G as a false trajectory. Therefore, the meaning of this item is that the generator G should generate false trajectories that are as close to the real one as possible and can deceive the discriminator D, thereby minimizing log(1-D(G(z|U,T)|U,T)) and reducing the ability of the discriminator D to identify false trajectories.
[0158] The discriminator D in the objective function V(D,G) should distinguish the real trajectory and the generated trajectory as accurately as possible, that is, maximize the discrimination ability on the real data and minimize the discrimination error rate on the generated data.
[0159] The generator G should generate fake trajectories that are as close to the real ones as possible and can deceive the discriminator D, that is, minimize the ability of the discriminator D to identify fake trajectories.
[0160] Through the mutual game between the generator G and the discriminator D, a Nash equilibrium is finally reached: the false trajectories generated by the generator G are highly similar to the distribution of the real trajectories, and the discriminator D can no longer improve its ability to distinguish the true from the false.
[0161] During the training process, a batch of triplets (x, U, T) are sampled from the real data set, where x is the real sleep state trajectory that matches the condition (U, T). U is the corresponding user state representation, and the user state U integrates multimodal information such as the environment, physiological parameters, and personal attributes in the initial state of the sleep cabin. T is the corresponding sleep duration. The real trajectory x matches the condition (U, T), that is, x is the real trajectory generated under the given user state U and sleep duration T.
[0162] At the same time, a batch of random noise z is sampled from the prior distribution p_z(z), usually from the standard normal distribution N(0,1). The sampled noise z is input into the generator G together with the condition (U,T) to generate the corresponding sleep state trajectory G(z|U,T), where the generator G uses the noise z as the source and (U,T) as the condition to generate a false sleep state trajectory.
[0163] Then, the real trajectory x and the generated trajectory G(z|U,T) are input into the discriminator D respectively to obtain the probability that they are real trajectories. According to the above objective function, the parameters of the generator G and the discriminator D are updated so that the generator G can generate a sleep state trajectory that is as close to the real one as possible and matches the condition (U,T), while the discriminator D can distinguish the real trajectory from the generated trajectory as accurately as possible. For the generated trajectory G(z|U,T), the discriminator D outputs D(G(z|U,T)|U,T), which represents the probability that the false trajectory generated by the generator G is judged as the real trajectory under the given condition (U,T).
[0164] Update the parameters of the discriminator D, including the discriminator loss term according to the objective function: E_{xp_data(x|U,T)}[log D(x|U,T)]+E_{zp_z(z)}[log(1-D(G(z|U,T)|U,T))], and update the parameters θ_D of the discriminator D so that it is updated in the direction of maximizing the loss term.
[0165] Specifically, let θ_G and θ_D represent the parameters of the generator G and the discriminator D respectively, then the parameter update formula is:
[0166]
[0167] Among them, α_D is the learning rate of the discriminator, is the gradient of the objective function V(D,G) with respect to the discriminator parameters θ_D.
[0168] The purpose of this step is to improve the ability of the discriminator D to distinguish between real trajectories and generated trajectories.
[0169] Update the parameters of the generator G. According to the generator loss term of the objective function: E_{z~p_z(z)}[log(1-D(G(z|U,T)|U,T))].
[0170] Update the parameters θ_G of the generator G so that it is updated in the direction of minimizing the loss term.
[0171] Specifically, the parameter update formula is: Among them, α_G is the learning rate of the generator, is the gradient of the objective function V(D,G) with respect to the generator parameters θ_G.
[0172] The above process is iterated repeatedly until the discriminator D and the generator G reach a Nash equilibrium, that is, the discriminator D can no longer improve its ability to distinguish authenticity, and the generator G can no longer improve its ability to generate real trajectories.
[0173] Through continuous iterative training, the capabilities of the generator G and the discriminator D are constantly improving, and finally reach a Nash equilibrium point.
[0174] At the equilibrium point, the discriminator D can no longer improve its ability to distinguish between real trajectories and generated trajectories, and the generator G can no longer improve its ability to generate fake trajectories that are close to the real ones and can deceive the discriminator D.
[0175] In the above process, the parameter definitions used include:
[0176] z:
[0177] Represents random noise, which obeys the standard normal distribution N(0,1).
[0178] Randomness is introduced into the generator G to make the generated sleep state trajectories diverse.
[0179] U:
[0180] Represents the user status representation, which is a d-dimensional real-valued vector.
[0181] It encodes personalized information such as the user's sleep preferences and environmental conditions.
[0182] As a conditional input, the generator G can generate personalized sleep state trajectories according to the characteristics of different users.
[0183] T:
[0184] It indicates the usage time of the sleeping capsule reserved by the user, in minutes, which is a positive integer.
[0185] Determines the length of the generated sleep state trajectory.
[0186] The sleep duration T belongs to the integer set Z.
[0187] G(z,U,T):
[0188] A function map representing a generator.
[0189] Input: random noise z(R^r), user status U(R^d) and sleep duration T.
[0190] Output: A sleep state trajectory (R^{T×s}) with length T and feature dimension s.
[0191] D(x,U,T):
[0192] Represents the function mapping of the discriminator.
[0193] Input: state trajectory x(R^{T×s}), user state U(R^d) and sleep duration T(Z).
[0194] Output: A real value between 0 and 1 ([0,1]), indicating the probability that the input state trajectory x is the true trajectory.
[0195] r:
[0196] Represents the dimension of random noise z, which is a positive integer.
[0197] Determines the degrees of freedom of randomness in the generator G.
[0198] d:
[0199] Represents the dimension of the user state representation U, which is a positive integer.
[0200] Determines the encoding length of user personalized information.
[0201] s:
[0202] Represents the characteristic dimension of the sleep state at each time step, which is a positive integer.
[0203] Determines the feature representation length of the generated sleep state trajectory at each moment.
[0204] R represents the set of real numbers.
[0205] R^r represents r-dimensional real vector space.
[0206] R^d represents a d-dimensional real vector space. For example, if the dimension of the user state representation U is 50, then U∈R^50, indicating that U is a 50-dimensional real-valued vector.
[0207] R^{T×s} represents a real matrix space with T rows and s columns. For example, if the length of the sleep state trajectory is 480 (indicating 8 hours, one time step per minute), and the feature dimension of each time step is 20, then the generated sleep state trajectory x∈R^{480×20} means that x is a real valued matrix with 480 rows and 20 columns.
[0208] p_data(x|U,T):
[0209] Represents the conditional probability distribution of real data.
[0210] Given the user state U and sleep duration T, the true distribution of the sleep state trajectory x.
[0211] During the training process, it is sampled from real data.
[0212] p_z(z):
[0213] Represents the prior probability distribution of random noise z, usually the standard normal distribution N(0,1).
[0214] In the generator G, noise z is sampled from this distribution.
[0215] G(z|U,T):
[0216] Denotes the conditional generating function of the generator G. Given the condition (U, T) and random noise z, the corresponding data sample is generated. In the present invention, G(z|U, T) generates a sleep state trajectory of length T that meets the user condition U.
[0217] D(x|U,T):
[0218] Represents the conditional discriminant function of the discriminator D. Under given conditions (U, T), it is the probability that the data sample x is a true sample.
[0219] V(D,G):
[0220] Represents the objective function of the discriminator D and the generator G, also known as the adversarial loss function.
[0221] The goal of the discriminator D is to maximize V(D,G), that is, to distinguish between real trajectories and generated trajectories.
[0222] The goal of the generator G is to minimize V(D,G), that is, to deceive the discriminator D so that the generated trajectory is judged as true.
[0223] θ_D:
[0224] Represents the parameters of the discriminator D, usually the weights and biases of the neural network.
[0225] It is updated by gradient ascent to maximize the objective function V(D,G).
[0226] θ_G:
[0227] Represents the parameters of the generator G, usually the weights and biases of a neural network.
[0228] It is updated by gradient descent to minimize the objective function V(D,G).
[0229] α_D:
[0230] Represents the learning rate of the discriminator D, which is a positive real number.
[0231] Controls the step size of the discriminator parameter update.
[0232] α_G:
[0233] Represents the learning rate of the generator G, which is a positive real number.
[0234] Controls the step size of the generator parameter updates.
[0235]
[0236] Represents the gradient of the objective function V(D,G) with respect to the discriminator parameters θ_D.
[0237] The discriminator parameters are updated according to the gradient to improve the discriminator's resolution.
[0238]
[0239] Represents the gradient of the objective function V(D,G) with respect to the generator parameters θ_G.
[0240] The generator parameters are updated according to the gradient to improve the generator's deception ability.
[0241] After the training is completed, a condition generator G(z|U,T) is obtained, which can generate a personalized and matching sleep state trajectory x according to the user state U and the scheduled sleep duration T. The generated trajectory can be used to control the environmental parameters in the user's sleep state and track the trajectory of the user state.
[0242] In one embodiment, the generator G and the discriminator D can be implemented using a deep neural network, such as a multi-layer perceptron (MLP), a convolutional neural network (CNN), a recurrent neural network (RNN), etc. The output layer dimension of the generator G is T×s, and the activation function can be tanh or sigmoid. The output layer dimension of the discriminator D is 1, and the activation function can be sigmoid to represent the probability of the true trajectory.
[0243] In one embodiment, the condition generator G(z|U,T) can generate a corresponding personalized sleep state trajectory according to a given user state U and a predetermined sleep duration T. This generator G actually describes the conditional distribution p(x|U,T), that is, the probability distribution of the real sleep state trajectory x under the given condition (U,T).
[0244] Suppose there is a user A, whose user state is represented by U_A. This state encodes the multimodal information of the user, which integrates the environment, physiological parameters, and personal attributes of the user in the initial state of the sleeping cabin.
[0245] Now user A wants to use the sleeping cabin to sleep for 8 hours (480 minutes), and a personalized sleep state track needs to be generated for him to guide the operation of the sleeping cabin.
[0246] The steps to generate sleep state trajectories using the conditional generator G(z|U,T) are as follows:
[0247] Preparation condition (U_A, T_A): The user state indicates that U_A is ready during the initialization phase of the sleeping cabin, where U_A is a d-dimensional real-valued vector.
[0248] Sleeping time T_A=480, indicating that user A has reserved 8 hours of sleep.
[0249] Sample random noise z:
[0250] Sample a random noise vector z from the prior distribution p_z(z), usually z is an r-dimensional standard normal distribution vector.
[0251] The random noise z here introduces randomness. For the same conditions (U_A, T_A), the generator G can also generate diverse sleep state trajectories.
[0252] Generate sleep state trace:
[0253] Input the random noise z and the condition (U_A, T_A) into the generator G to generate the corresponding sleep state trajectory:
[0254] x_gen=G(z|U_A,T_A)
[0255] Here x_gen is a sleep state trajectory with a length of T_A(480) and a feature dimension of s, which represents the sleep state characteristics of user A at each moment during the 8-hour sleep process (including multi-modal physiological parameter data such as body movement, breathing, heart rate, and multi-modal environmental data of the sleeping cabin such as temperature, humidity, air pressure, noise, and lighting environment data).
[0256] Optionally, the online strategy execution and trajectory tracking includes applying the generated sleep state trajectory and monitoring the user's actual sleep state in real time, specifically:
[0257] The generated sleep state trajectory x_gen is used as the personalized sleep plan of user A to guide the operation of the sleeping cabin.
[0258] The sleeping cabin can adjust the environmental parameters (such as temperature, humidity, air pressure, etc.) in the cabin according to the state characteristics of x_gen at each moment, so that the environmental data monitored by the environmental sensors in the sleeping cabin and the multi-mode environmental data at the corresponding moment in x_gen are close. Specifically, the PID control method can be used to calculate the control amount of each regulating device according to the deviation between the actual environmental parameters and the target value, and update it in real time. The sleeping cabin uses PID control to adjust the environmental parameters in the cabin according to the state characteristics of x_gen at each moment, so that the environmental data monitored by the environmental sensors in the sleeping cabin are close to the multi-mode environmental data at the corresponding moment in x_gen, that is, the environmental data monitored by the environmental sensors in the sleeping cabin are controlled to change in the direction of the multi-mode environmental data at the corresponding moment in x_gen, so that the values of the two are as equal as possible.
[0259] At the same time, the sleep cabin can also monitor and evaluate the actual sleep state of user A with reference to x_gen. If a large deviation is found between the actual state and the planned state, such as when the physiological sensor detects a large difference between the actual sleep state of user A and the physiological state data at the corresponding time in x_gen, the monitoring system of the sleep cabin compares the actual collected user sleep state characteristics with the physiological state data at the corresponding time in x_gen to evaluate the actual sleep quality and depth of the user.
[0260] If it is found that there is a large deviation between the actual sleep state and the planned state, for example, the user's body movement times are significantly higher than the planned times, for example, the proportion of times exceeding the plan is higher than the threshold, or the number of times is higher than the threshold, it means that the current sleep plan does not meet the user's actual sleep state.
[0261] Based on the remaining usage time of the sleeping cabin reserved by the user and the user status representation of the user at the current moment, a personalized sleep state trajectory of the remaining usage time of the sleeping cabin reserved by the user is regenerated. The method of regenerating the personalized sleep state trajectory is similar to the method of generating a complete sleep state trajectory, specifically:
[0262] When it is detected that the user's actual sleep state deviates significantly from the planned state, the control system of the sleeping cabin will regenerate the user's personalized sleep state trajectory for the remaining time in the sleeping cabin.
[0263] First, the control system will obtain the remaining usage time T_remain of the sleeping cabin reserved by the user, as well as the user status representation U_current at the current moment.
[0264] Then, the control system will take the remaining time T_remain and the current user state U_current as conditions, input them into the condition generator G, and randomly sample a noise vector z to generate a new sleep state trajectory:
[0265] x_gen_new=G(z|U_current,T_remain)
[0266] The generation process here is exactly the same as the initial generation of the complete sleep state trajectory, except that the condition becomes (U_current, T_remain).
[0267] After generating a new sleep state trajectory, the control system of the sleeping cabin will replace the data of the remaining time period in the original x_gen with x_gen_new to obtain the updated complete sleep state trajectory x_gen_updated.
[0268] Finally, the control system of the sleeping cabin uses the updated sleep state trajectory x_gen_updated as a new guidance plan and repeats the previous environmental parameter control and sleep state monitoring process.
[0269] Through this dynamic adjustment mechanism, the sleeping cabin can adaptively optimize the sleep plan according to the user's actual sleep conditions and provide continuous personalized sleep optimization services.
[0270] In one embodiment, the generated sleep-aid strategy sequence is converted into control instructions and transmitted to the air conditioner, humidifier, oxygen machine, background sound, lighting and other actuators of the sleep capsule cabin to adjust the sleep environment in real time.
[0271] Among them, the control instructions need to be converted into a format recognizable by the actuator, such as modbus protocol, serial port communication, etc.; the trajectory deviation can use indicators such as cumulative deviation or maximum deviation, and the threshold can be dynamically adjusted according to user feedback; the strategy adjustment mechanism can be based on PID control algorithm, reinforcement learning algorithm, etc., with state deviation as input and strategy change as output; offline analysis can count the effects of different strategies, summarize the optimization rules, and use them to update the decision model and rule base.
[0272] The present invention introduces a conditional generative adversarial network (CGAN) to establish a generative model for personalized sleep state trajectories, and explores the correlation between user status, sleep environment and sleep quality by learning a large number of users' historical sleep data. The present invention generates personalized sleep state trajectories based on the user's personal status representation and scheduled sleep duration using a trained CGAN model as a guide plan for the operation of the sleep cabin. During the sleep process, the user's physiological state and sleep environment parameters are monitored in real time, and compared with the generated sleep state trajectory. When deviations are found, a dynamic adjustment mechanism is triggered to regenerate an optimized sleep plan.
[0273] The present invention provides a personalized and dynamic intelligent sleep-aid decision-making method, which can customize the optimal sleep plan according to the user's specific needs and conditions, and significantly improve the sleep-aid effect and user experience.
[0274] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0275] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0276] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0277] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0278] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0279] The above introduces the preferred embodiments of the present invention, which is intended to make the spirit of the present invention clearer and easier to understand, but is not intended to limit the present invention. All modifications, substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection outlined by the claims attached to the present invention.
Claims
1. An intelligent sleep-aiding decision-making method based on data analysis, the method comprising: A generative model for training sleep state trajectories based on the Generative Adversarial Network (CGAN); According to the user's personal state representation and the scheduled duration of the sleeping cabin, the trained CGAN model is used to generate personalized sleep state trajectories to control the operation of the sleeping cabin environment; During sleep, the user's physiological state and sleep environment parameters are monitored in real time and compared with the generated sleep state trajectory. When the deviation exceeds the preset conditions, the sleep state trajectory is regenerated.
2. The intelligent sleep-aiding decision-making method based on data analysis according to claim 1, characterized in that: Environmental sensors and physiological signal sensors are arranged in the sleeping capsule cabin.
3. The intelligent sleep-aiding decision-making method based on data analysis according to claim 1, characterized in that: For the time series data in the initial state of each modality, the convolutional neural network (CNN) and the long short-term memory (LSTM) deep learning model are used to extract local and global spatiotemporal features respectively.
4. The intelligent sleep-aiding decision-making method based on data analysis according to claim 3, characterized in that: The attention mechanism is used to perform weighted fusion of features of different modalities, adaptively adjust the importance weight of each modality, and generate a unified sleep state feature vector; User portrait features are introduced and concatenated with the sleep state feature vector to form a user state representation.
5. The intelligent sleep-aiding decision-making method based on data analysis according to claim 1, characterized in that: The user's sleep process is represented by a state trajectory [U_1, U_2, ..., U_T], where any point U_t in the state trajectory represents the user's state at the t-th time step, including the environmental signal and physiological signal information of the sleeping cabin; Fill the state trajectories of all users to a unified maximum length T_max, where T_max is set according to the maximum bookable time period of the sleeping cabin; For users whose sleep duration is less than the maximum value, their status trajectory is padded with zeros until the length reaches T max.
6. The intelligent sleep-aiding decision-making method based on data analysis according to claim 1, characterized in that: The user's effective sleep duration T is used as one of the conditional variables and input into the generator G and the discriminator D together with the user state representation U to generate personalized sleep state trajectories that match the sleep duration of different users. Let z represent random noise, which follows the standard normal distribution N(0,1); U represents the user state representation, which is a d-dimensional real-valued vector; T represents the user's scheduled sleep capsule usage time; The generator G and discriminator D of CGAN can be expressed as: G(z,U,T):R^r×R^d×Z→R^{T×s}, D(x,U,T):R^{T×s}×R^d×Z→[0,1], Among them, G(z,U,T): represents the function mapping of the generator; D(x,U,T): represents the function mapping of the discriminator; R represents a real number set, r is the dimension of the noise z, d is the dimension of the user state representation U, and s is the characteristic dimension of the sleep state at each time step; the generator G takes z, U and T as inputs and outputs a sleep state trajectory with a length of T and a characteristic dimension of s; T: represents the user's scheduled sleep capsule usage time, and the sleep duration T belongs to the integer set Z; The discriminator D takes the state trajectory x, user state U and sleep duration T as input, and outputs a real value between 0 and 1, indicating the probability that x is the true trajectory.
7. The intelligent sleep-aiding decision-making method based on data analysis according to claim 1, characterized in that: The training goal of the CGAN is to solve the following minimum and maximum problems: min_G max_D V(D,G)=E_{xp_data(x|U,T)}[log D(x|U,T)]+ E_{zp_z(z)}[log(1-D(G(z|U,T)|U,T))], in, min_G: indicates minimization optimization of the parameters of generator G; max_D: indicates maximizing the optimization of the parameters of the discriminator D; V(D,G): represents the objective function of the discriminator D and the generator G, also known as the adversarial loss function; E_{xp_data(x|U,T)}[log D(x|U,T)]: represents the expected loss of the discriminator under the real data distribution; p_data(x|U,T) represents the conditional probability distribution of real data, which is the real distribution of sample x under given conditions (U,T); D(x|U,T) represents the probability that the discriminator judges sample x as a true sample under given conditions (U,T); log D(x|U,T) represents the logarithmic probability that the discriminator judges the real sample as true; E_{zp_z(z)}[log(1-D(G(z|U,T)|U,T))]: represents the expected loss of the discriminator under the generated data distribution; p_z(z) represents the prior probability distribution of random noise z, which is usually a simple Gaussian distribution or uniform distribution; G(z|U,T) represents the sample generated by the generator under given conditions (U,T) and noise z; D(G(z|U,T)|U,T) represents the probability that the discriminator judges the generated sample G(z|U,T) as a true sample under given conditions (U,T); log(1-D(G(z|U,T)|U,T)) represents the logarithmic probability that the discriminator will judge the generated sample as false; x: represents a real or generated sleep state trajectory; U: a d-dimensional real-valued vector that encodes the user's status information; T: indicates the sleep time scheduled by the user, in minutes; z: represents a random noise vector, which obeys Gaussian distribution or uniform distribution; p_data(x|U,T): represents the conditional probability distribution of real data; under given conditions (U,T), describes the probability distribution of real sample x; p_z(z): represents the prior probability distribution of random noise z, usually a simple Gaussian distribution or uniform distribution; in the generator G, noise z is sampled from this distribution; G(z|U,T): represents the conditional generating function of the generator G; given the condition (U,T) and the random noise z, it generates the corresponding data sample; in the present invention, G(z|U,T) generates a sleep state trajectory of length T that meets the user condition U; D(x|U,T): represents the conditional discriminant function of the discriminator D; under given conditions (U,T), it determines the probability that the data sample x is a true sample.
8. The intelligent sleep-aiding decision-making method based on data analysis according to claim 1, characterized in that: The generated sleep state trajectory x_gen is used to control the operation of the sleep cabin environment; The sleeping cabin uses PID control to adjust the environmental parameters in the cabin according to the state characteristics of x_gen at each moment, so that the environmental data monitored by the environmental sensors in the sleeping cabin are close to the multi-mode environmental data in x_gen at the corresponding moment.
9. The intelligent sleep-aiding decision-making method based on data analysis according to claim 8, characterized in that: The sleeping cabin monitors the user's actual sleeping state based on the state trajectory x_gen. When the monitoring system of the sleeping cabin compares the actually collected user sleep state characteristics with the physiological state data at the corresponding time in x_gen, and finds that the deviation between the sampling value of any physiological sensor in actual sleep and the value of the corresponding physiological sensor at the corresponding time in the state trajectory x_gen exceeds the threshold, the personalized sleep state trajectory of the remaining usage time of the sleeping cabin reserved by the user and the user status representation of the user at the current moment is regenerated.
10. An intelligent sleep-aiding decision-making system based on data analysis, the system comprising a processor and a memory, the memory storing a computer program, the processor being configured to execute the computer program to implement the intelligent sleep-aiding decision-making method based on data analysis according to any one of claims 1 to 9.
Citation Information
Cited By
Sleep environment self-adjusting system based on multi-source heterogeneous data
CN121091722A