Insomnia data processing method based on artificial intelligence
By constructing a user-personalized causal graph and driving reinforcement learning to train the strategy network, the problem of lack of personalization and interpretability in existing insomnia intervention strategies is solved. This enables the generation of personalized, dynamically adaptive insomnia intervention strategies, improving accuracy and intelligence.
Patent Information
- Application Number
- CN202511750240.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-27
AI Technical Summary
Existing methods for processing insomnia data rely on common patterns in groups or static judgment criteria, which cannot capture and quantify the unique and dynamically changing causal mechanisms of insomnia for individual users. This results in automatically generated insomnia intervention strategies lacking personalization, foresight, and interpretability, and having low accuracy.
By constructing a user-personalized causal graph and using it to drive reinforcement learning decision-making, a system was developed that integrates causal inference and personalized strategy generation. Causal structure learning was performed using a multimodal time-series dataset, and a policy network was trained using a reinforcement learning algorithm to generate personalized insomnia intervention strategies and provide causal explanation information.
It improves the targeting, adaptability, and interpretability of insomnia intervention strategies, enhances the accuracy and intelligence of automatically generated insomnia intervention strategies, and realizes the effectiveness of sleep intervention and user credibility.
Smart Images

Figure CN121583559A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and digital health technology, and particularly to the interdisciplinary fields of time series data analysis, causal discovery and reinforcement learning. Specifically, it relates to an artificial intelligence-based method for processing insomnia data. Background Technology
[0002] Insomnia data processing refers to the technology of collecting and analyzing data related to users' sleep in order to assess sleep status, identify insomnia disorders and generate intervention strategies. It is a key link in achieving insomnia management, precision management of chronic diseases, and especially digital management of sleep health.
[0003] Traditionally, the main methods for processing insomnia data are based on static threshold rules or general machine learning models. Static threshold-based methods compare parameters such as sleep duration and number of awakenings with preset fixed thresholds to determine the type of insomnia and recommend general intervention plans. General machine learning model-based methods use historical population data to train classification or regression models, mapping users' sleep data to insomnia risk scores or standardized improvement suggestions.
[0004] However, the inventors found that because the above methods all rely on common group patterns or static judgment criteria, they cannot capture and quantify the unique and dynamically changing causal mechanisms of insomnia for individual users. As a result, the intervention strategies they generate lack personalization, foresight, and interpretability, leading to low accuracy of automatically generated insomnia intervention strategies.
[0005] Therefore, how to achieve dynamic and explainable insomnia intervention based on user-personalized causal mechanisms, in order to improve the accuracy and intelligence of automatically generated insomnia intervention strategies based on natural language processing, has become a core technical problem that urgently needs to be solved in the field of digital health. Summary of the Invention
[0006] To address the aforementioned problems in traditional technologies, this invention provides an artificial intelligence-based method for processing insomnia data. By constructing a user-personalized causal graph and using it to drive reinforcement learning decisions, it achieves insomnia intervention that integrates causal inference and personalized strategy generation. This effectively improves the targeting, adaptability, and interpretability of insomnia intervention strategies, and enhances the accuracy and intelligence of automatically generated insomnia intervention strategies based on natural language processing, thereby achieving the effectiveness of sleep intervention.
[0007] To address the aforementioned technical problems, this invention provides the following technical solution: an artificial intelligence-based method for processing insomnia data, comprising: 1) a model training phase, comprising: in response to a model training instruction for a target user, acquiring a multimodal time-series dataset associated with the target user within a preset historical time period, wherein the multimodal time-series dataset includes physiological time-series data, behavioral time-series data, and environmental time-series data; based on the multimodal time-series dataset, using a time-series causal discovery model to perform causal structure learning, constructing a user-personalized causal graph; using the user-personalized causal graph as an environmental model, training a policy network based on a reinforcement learning algorithm to obtain a personalized policy network; 2) a policy generation phase, comprising: acquiring the current state data of the target user; inputting the current state data into the personalized policy network to obtain a personalized insomnia intervention strategy; based on the user-personalized causal graph, generating causal explanation information corresponding to the personalized insomnia intervention strategy; and outputting the personalized insomnia intervention strategy and the causal explanation information.
[0008] As a preferred embodiment of the artificial intelligence-based insomnia data processing described in this invention, the step of "using a time-series causal discovery model to learn causal structure based on the multimodal time-series dataset and constructing a user-personalized causal graph" includes: cleaning and aligning the multimodal time-series dataset to remove outlier data points and unify the timestamps of each modality; extracting preset time-domain feature vectors, frequency-domain feature vectors, and nonlinear feature vectors from the cleaned multimodal time-series data to form a joint feature matrix; inputting the joint feature matrix into a time-series causal discovery model based on the NOTEARS algorithm, calculating the weighted adjacency matrix between each time-series data variable by solving a continuous optimization problem with acyclic constraints; setting a causal strength threshold, binarizing the weighted adjacency matrix, and optimizing the sparsity of the obtained directed acyclic graph based on the Akaike information criterion, and finally outputting the user-personalized causal graph.
[0009] The beneficial effects of this invention are as follows: The method constructs a personalized causal graph for each user by using a time-series causal discovery model to learn the causal structure based on a multimodal time-series dataset of the target user; using the personalized causal graph as an environment model, a policy network is trained using a reinforcement learning algorithm to obtain a personalized policy network; the current state data of the target user is acquired; the current state data is input into the personalized policy network to obtain a personalized insomnia intervention strategy and generate corresponding causal explanation information, thereby outputting the personalized insomnia intervention strategy and causal explanation information as a strategy suggestion for intervening in the target user's insomnia. Based on this, by constructing a personalized causal graph for each user and using it as an environment model to drive reinforcement learning to train the personalized policy network, a fundamental breakthrough has been achieved in the field of insomnia intervention. First, the personalized causal graph learns the unique insomnia causal mechanism from the user's historical data, enabling the formulation of intervention strategies to shift from statistical associations based on group commonalities to precise targeting based on individual causal mechanisms, fundamentally improving the scientific nature and pertinence of the intervention. Secondly, by using reinforcement learning to train the policy network within this causal environment model, the system can simulate and evaluate the long-term causal chain consequences of intervention actions, thereby outputting forward-looking optimal decisions and avoiding the short-sighted behavior of static rules. Finally, based on the same causal graph, causal explanations for the intervention strategy are provided, transforming black-box decision-making into user-understandable scientific logic, greatly enhancing the credibility of the intervention and user compliance. In summary, through a closed loop of "causal discovery - reinforcement learning - interpretable output," the deep personalization, dynamic adaptation, and high interpretability of the intervention strategy are comprehensively achieved. This effectively solves the core problems of existing technologies, such as the generality, lag, and lack of scientific basis in intervention measures, and can improve the accuracy and intelligence of automatically generated insomnia intervention strategies based on natural language processing. Attached Figure Description
[0010] Figure 1 A flowchart illustrating an artificial intelligence-based insomnia data processing method provided in an embodiment of the present invention;
[0011] Figure 2 This is a schematic diagram of the first sub-process of the artificial intelligence-based insomnia data processing method provided in an embodiment of the present invention;
[0012] Figure 3 This is a schematic diagram of the second sub-process of the artificial intelligence-based insomnia data processing method provided in an embodiment of the present invention. Detailed Implementation
[0013] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0014] This invention provides an artificial intelligence-based method for processing insomnia data. The method can be applied to devices including but not limited to wearable devices such as smartphones and smartwatches, tablets, desktop computers, servers, and cloud platforms, and is used in scenarios such as insomnia management and precision management of chronic diseases, when processing insomnia data.
[0015] The following detailed description of some embodiments of the present invention is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0016] Example 1, please refer to Figure 1 , Figure 1 This is a flowchart illustrating an artificial intelligence-based insomnia data processing method provided in an embodiment of the present invention. Figure 1 As shown, in this embodiment, the method includes, but is not limited to, the following steps S11-S17:
[0017] S11, Model training phase, including: in response to a model training instruction for a target user, acquiring a multimodal time series dataset associated with the target user within a preset historical time period, wherein the multimodal time series dataset includes physiological time series data, behavioral time series data, and environmental time series data.
[0018] Interpretatively, a multimodal time series dataset represents a collection of various types of data collected from different sources and types of sensors or interaction channels and aligned by timestamps over a continuous period of time (i.e., a preset historical time period, such as 14 consecutive days). Its "multimodal" characteristic is reflected in the fact that the data jointly characterizes the user's sleep state from multiple dimensions such as physiology, behavior, and environment, providing a data foundation for the subsequent construction of a comprehensive causal model.
[0019] Physiological time-series data refers to signal data that characterizes the user's internal bodily functions and changes over time. This data includes, but is not limited to: photoplethysmography (PPG) signals from wrist-worn wearable devices, used to infer heart rate and heart rate variability; and triaxial acceleration signals from the same wrist-worn wearable device, used to identify sleep-wake states and body movement. The sources are primarily medical-grade or consumer-grade physiological signal acquisition devices.
[0020] Behavioral time-series data refers to event or state data that records users' voluntary activities during the day and before bedtime and changes over time. Its content includes, but is not limited to: timestamps of caffeine and alcohol intake events manually recorded or automatically sensed through mobile terminal applications; daytime exercise duration and intensity recorded through mobile terminals or fitness trackers; and nighttime screen usage duration obtained through mobile phone screen usage time statistics functions. Its source is mainly the user's smart terminal devices and their built-in sensors and applications.
[0021] Environmental time-series data refers to data describing the changes in physical environment parameters of a user's sleep environment over time. Its content includes, but is not limited to: a sequence of ambient noise decibel values collected by a bedside decibel meter; and a sequence of ambient light intensity lux values collected by environmental sensors. The source of these data is mainly IoT environmental sensors deployed in the user's bedroom.
[0022] The preset historical time period is the data coverage duration used to build the initial user personalized causal graph. This time period needs to be long enough to capture stable causal patterns of users, but it should not be too long to ensure the timeliness of the model. Its typical value range is 14 days to 90 days, and the preferred implementation is 30 days. This parameter can be adjusted within this range according to the data collection frequency and the stability of user status.
[0023] Based on the above description and settings, in response to model training instructions triggered by the system or user, this method initiates a personalized model building process for a specific target user. First, the system retrieves raw data collected within a preset historical time period from the various data sources mentioned above. Then, it performs key data preprocessing steps: using timestamps in each data record to align all heterogeneous data in time; performing linear interpolation to complete missing short-term data; and finally, using Z-score standardization to eliminate dimensional differences across data dimensions, forming a unified and well-organized standardized multimodal time-series data matrix, preparing data for subsequent causal structure learning. Thus, by acquiring and fusing the aforementioned multimodal time-series data, it not only comprehensively covers all potential factors affecting sleep from the three dimensions of physiology, behavior, and environment, but also preserves the time-series-based dynamic changes and interactions between variables, making it possible to capture the causal chain of "daytime behavior → nighttime physiology → sleep quality." Furthermore, because the data originates from the target user themselves, it ensures that the ultimately learned causal model and intervention strategy are truly individualized and personalized adaptive strategies tailored to them.
[0024] S12. Based on the multimodal time-series dataset, use the time-series causal discovery model to learn the causal structure and construct a user-personalized causal graph.
[0025] Interpretatively, the temporal causal discovery model represents an algorithmic model capable of automatically identifying causal relationships and their time delays between variables from timestamped observation data. It employs the fractional NOTEARS (Non-combinatorial Optimization via Trace Exponential and Augmented lagRangian for Structure learning) algorithm. The core of this model is defining a continuous fractional function to measure the goodness of fit of a directed acyclic graph (DAG) to the data, and introducing a differentiable acyclic constraint based on the matrix exponential trace, thus transforming the discrete structure learning problem into a constrained continuous optimization problem. During training and optimization, the loss function (e.g., negative log-likelihood) is minimized using gradient descent while satisfying the acyclic constraint, and a weighted adjacency matrix representing the causal weights between variables is obtained. To further optimize the model's generalization ability and prevent overfitting, the sparsity of the resulting graph structure needs to be adjusted based on the Akaike Information Criterion (AIC).
[0026] Personalized Causal Graph: This refers to a structured model, presented in the form of a Directed Acyclic Graph (DAG), that quantifies the causal interactions between sleep-related variables of a target user. It includes: nodes representing key variables in a multimodal time-series dataset (e.g., "average nighttime heart rate," "daytime caffeine intake," "sleep efficiency"); directed edges connecting two nodes, with the direction indicating the assumed causal relationship (e.g., "daytime caffeine intake → average nighttime heart rate"); and edge weights, which are real values quantifying the strength of the causal effect of the cause node on the effect node. Functionally, this graph is an initial digital twin of the target individual in the field of sleep health, simulating the internal mechanisms by which the unique physiological, behavioral, and environmental factors of that target user dynamically influence their sleep state.
[0027] Based on the above concept and description, firstly, preset time-domain, frequency-domain, and nonlinear feature vectors are extracted from the preprocessed standardized multimodal time-series data matrix to form a joint feature matrix as model input. Then, the joint feature matrix is input into a time-series causal discovery model built based on the NOTEARS algorithm. This model solves a continuous optimization problem with acyclic constraints and outputs a weighted adjacency matrix. Next, a causal strength threshold is set to binarize the matrix to remove weak or unreliable causal connections, forming an initial directed acyclic graph. Finally, based on the Akaike Information Criterion (AIC), sparsity optimization is performed on the graph, removing edges that do not contribute significantly to the model's interpretability. Ultimately, a concise and robust user-personalized causal graph is output, thus completing the construction of the initial digital twin of the target individual.
[0028] For example, the system acquired multimodal data of user Zhang San over the past 14 days. After learning through a time-series causal discovery model, the constructed personalized causal graph can reveal the following causal relationships: "Caffeine intake after 8 pm" (behavioral data) → "Sleep latency heart rate" (physiological data, weight +0.75); "Daytime stress score" (behavioral data) → "Nighttime awakenings" (physiological data, weight +0.60); "Average nighttime noise in the bedroom" (environmental data) → "Deep sleep rate" (physiological data, weight -0.45). This graph clearly quantifies the individualized causal patterns affecting Zhang San's sleep, which is quite different from the general model based on population averages.
[0029] Therefore, by directly learning the causal structure from users' personal data, a cognitive leap from "correlation" to "causal mechanism" has been achieved. Its beneficial effects are: 1) Scientificity: It provides the causal basis for intervention and avoids misjudgment based solely on correlation; 2) Individualization: The constructed causal graph reflects the unique physiological and behavioral patterns of the target user, which is the fundamental premise for achieving precise intervention; 3) Explainability: The graph provides a transparent logical framework and core basis for generating understandable intervention suggestions.
[0030] S13. Using the user-personalized causal graph as the environment model, the policy network is trained based on the reinforcement learning algorithm to obtain the personalized policy network.
[0031] Explained, reinforcement learning algorithms represent a machine learning paradigm whose core lies in an agent continuously interacting with the environment and learning optimal decision sequences based on reward signals from the environment. This embodiment of the invention employs a value-based deep Q-learning algorithm. This algorithm is constructed based on a Markov decision process framework, and its training objective is to learn an optimal action value function. This function accurately assesses the expected long-term cumulative reward obtained by performing a certain action under a given environmental state. Furthermore, to achieve stable and efficient training and optimization, this embodiment of the invention specifically adopts an experience replay mechanism, randomly sampling historical interaction data to break the correlation between data; simultaneously, it employs target network technology, periodically updating independent network parameters used to calculate the target Q-value to alleviate instability and divergence problems during training.
[0032] A policy network is a core component for decision-making in a reinforcement learning agent. Its function is to map an optimal action or a probability distribution of actions based on the current environmental state. In this embodiment of the invention, the policy network is implemented through a deep Q-network, which is constructed as follows: the node dimension of its input layer is consistent with the dimension of the state vector; the hidden layer consists of two fully connected layers, used to abstract state features layer by layer; the number of nodes in the output layer is equal to the number of executable intervention actions, and the output value of each node represents the Q-value of performing the corresponding action in the current state. The goal of training is to iteratively update the weight parameters of this deep Q-network so that its output Q-value can accurately reflect the long-term benefits of different actions.
[0033] Based on the above concept and setup, this step aims to train a personalized policy network capable of making optimal intervention decisions for the target user. First, environment modeling is performed, using the "user-personalized causal graph" constructed in step S12 as the environment model for reinforcement learning. This causal graph defines the dynamic evolution rules between state variables, allowing the agent to infer the long-term impact of its actions within this simulated environment. Second, space definition is performed, with the state space consisting of recent statistical feature vectors of the key variable set in the aforementioned causal graph, and the action space consisting of a predefined set of insomnia intervention actions. Then, network training is performed, initializing a deep Q-network. The agent engages in multiple rounds of simulated interaction within the aforementioned causal graph environment. At each step, the agent selects an action based on its current state, and the environment updates the state according to the causal graph rules and returns a reward value. This interaction experience is stored in a replay buffer. During training, batches of data are randomly sampled from the buffer, and the parameters of the deep Q-network are iteratively updated by minimizing the temporal difference error loss function until the network converges. The resulting network with fixed parameters is the personalized policy network.
[0034] For example, continuing from the previous example, for a personalized causal graph for user Zhang San, at the start of training, the policy network might randomly suggest "increasing evening exercise." The simulated environment (causal graph) will infer from this action that Zhang San's "sleep depth" might decrease due to an increase in "nighttime core body temperature," thus generating a negative reward. After a large number of such trial-and-error learning sessions, the policy network gradually learns to avoid ineffective or harmful actions and eventually discovers that for Zhang San, "avoiding caffeine after 4 PM" can significantly improve "sleep efficiency" by reducing "sleep latency heart rate," thereby obtaining a high reward. After training is complete, the network internalizes the optimal decision-making knowledge for Zhang San.
[0035] Therefore, by deeply integrating personalized causal graphs with reinforcement learning, intervention strategies are deeply personalized and forward-looking optimized. The beneficial effects are: 1) Dynamic decision-making: the policy network can provide the optimal response in real time when the user's state changes; 2) Long-term benefits: reinforcement learning avoids short-sighted decision-making by considering the long-term causal chain consequences of actions; 3) Individual optimization: the final policy network is a "private sleep decision center" exclusively for the target user, and its decisions are based on the target user's own unique causal model, achieving truly precise intervention.
[0036] S14, Strategy generation stage, including: obtaining the current state data of the target user.
[0037] Interpretatively, current state data refers to the instantaneous or short-cycle data set collected from the target user within the latest time window (e.g., the last 24 hours or the current moment) that characterizes their recent physiological, behavioral, and environmental conditions, within which the policy generation request was triggered. This data differs from the "historical time-series dataset" used in the model training phase. Its core characteristic is timeliness, aiming to capture the user's latest state as input for generating immediate intervention strategies. Its content shares the same source as the training data but differs in time scale, primarily including: 1) Physiological state data, such as the average heart rate and heart rate variability at the current moment or during last night's sleep, and recent sleep structure (proportion of deep sleep, light sleep, and REM sleep) estimated by wearable devices; 2) Behavioral state data, such as caffeine and alcohol intake recorded up to the present day, daytime exercise duration and intensity, and screen time over the past few hours; 3) Environmental state data, such as the real-time noise level in decibels and the light intensity in lux in the current bedroom environment. The sources of current state data are consistent with those in the training phase, including the wearable devices, mobile terminal applications, and bedroom environment sensors bound to the target user.
[0038] Based on the above concept and description, in the strategy generation phase, the system first responds to the user's intervention request or preset trigger conditions (such as a fixed time each day); then, the system retrieves or receives multimodal data generated within the "current" defined time window from the aforementioned data source in real time; next, the system performs a standardized preprocessing procedure on these newly collected raw data that is consistent with the training phase (e.g., using the same Z-score standardization parameters), transforming them into a current state feature vector with the same distribution and dimensions as the training data. This vector accurately quantifies the target user's overall state at the time of the request, providing standardized input for subsequent personalized decision-making.
[0039] Therefore, by acquiring and standardizing the latest user data, the real-time nature and context-relevance of the intervention strategy are ensured. Its core benefits are: 1) Dynamic adaptability, which enables the system to generate intervention suggestions based on the user's constantly changing situation, rather than relying on outdated historical information; 2) Decision accuracy, which provides accurate and reliable instantaneous input to the trained personalized strategy network, and is the primary technical guarantee to ensure that the final output intervention strategy is effective and meets the user's current needs.
[0040] S15. Input the current state data into the personalized strategy network to obtain a personalized insomnia intervention strategy.
[0041] Interpretatively, the system uses the standardized feature vector representing the user's latest state, generated in step S14, as input data and feeds it into the trained and solidified personalized policy network. This network then performs a forward propagation calculation: the input data passes sequentially through the network's input layer and hidden layers, ultimately generating a Q-value vector at the output layer. Each Q-value in this vector corresponds to the long-term expected benefit assessment of a specific intervention action in the action space. The system compares all output Q-values and selects and outputs the intervention action with the highest Q-value as the current optimal personalized insomnia intervention strategy. The personalized insomnia intervention strategy is a specific, executable sleep improvement instruction calculated by the personalized policy network for the target user in their current specific state; it is a discrete, optimized action selection.
[0042] For example, continuing from the previous example, assume that user Zhang San's personalized strategy network has been trained, and the system obtains Zhang San's current state data, generates a feature vector after standardization, in which the values of "daytime stress score" and "evening screen time" are relatively high. After inputting this vector into the network, the output layer calculates Q values of 85, 70, and 60 for actions in the action space such as "recommend performing bedtime breathing training", "suggest reducing evening screen time", and "adjust tomorrow's caffeine intake" respectively. The system selects the action with the highest Q value, "recommend performing bedtime breathing training", which is the personalized insomnia intervention strategy generated for Zhang San's current high stress and high screen time state.
[0043] Thus, an intelligent transformation from data to decision-making is achieved, with the core benefits being: 1) Real-time decision-making, which can output the optimal intervention strategy within milliseconds based on the user's rapidly changing state, ensuring the timeliness of the intervention; 2) Individual optimization, where the output strategy originates from a personalized strategy network trained specifically for the user, and its decision-making fully considers the user's unique causal model and behavioral patterns, achieving precise "one person, one policy", significantly improving the pertinence and effectiveness of the intervention.
[0044] S16. Based on the user-personalized causal graph, generate causal explanation information corresponding to the personalized insomnia intervention strategy.
[0045] Explained, this step aims to provide the scientific basis behind the personalized insomnia intervention strategy output by S15, namely causal explanatory information. Causal explanatory information refers to text described in natural language, the content of which is used to reveal the causal logic chain that exists in the user's personalized causal graph, which is targeted by the personalized insomnia intervention strategy.
[0046] The generation process is briefly described as follows: First, the system identifies the target sleep variable node (such as "sleep efficiency") that the personalized insomnia intervention strategy intends to improve; then, it extracts the key causal path connecting the key variable node mapped by the current state data to the target node from the user's personalized causal graph; subsequently, it converts the nodes and causal relationships involved in this path into text descriptions that are easy for users to understand through predefined natural language templates, and finally generates the causal explanation information.
[0047] For example, continuing from the previous example, suppose the personalized intervention strategy recommended by the system for user Zhang San is "It is recommended to stop consuming caffeine this afternoon." To generate the corresponding explanation, the system performs the following operations: 1) Identify the target and determine that the strategy target is to improve "nighttime sleep depth"; 2) Extract the path and extract the key path from Zhang San's personalized causal graph: "Daytime caffeine intake" → (leads to) → "Nighttime average heart rate" → (affects) → "Nighttime sleep depth"; 3) Generate the explanation and substitute the above path into the template "Because your [daytime caffeine intake] level is high, this will lead to an increase in your [nighttime average heart rate], which in turn affects your [nighttime sleep depth]. Therefore, it is recommended that you [stop consuming caffeine this afternoon] to break this chain." The final output causal explanation information is this text.
[0048] Therefore, by tracing personalized insomnia intervention strategies back to a clear causal graph model, the above intervention strategies are endowed with strong interpretability and credibility, thereby enhancing system transparency, breaking the "black box" decision-making of AI models, making the entire reasoning process visible to users, and establishing users' trust in the intelligent system.
[0049] S17. Output the personalized insomnia intervention strategy and the causal explanation information.
[0050] Explained, the system logically binds the personalized insomnia intervention strategy generated in step S15 with the causal explanation information generated in step S16, forming a complete output unit that combines "action instructions" and "scientific evidence." Subsequently, through a predefined application programming interface, the output unit is sent to the target user's client device, where the application presents and broadcasts it synchronously or asynchronously in a preset visual form (e.g., in a specific area of the graphical user interface as a card, pop-up window, or voice broadcast), thus completing the final delivery of information. This achieves the effective transmission and value transformation of decision results. By synchronously providing the strategy and its causal explanation, users understand "why to do it" while knowing "what to do," forming a complete and reliable solution and improving the accuracy and intelligence of automatically generated insomnia intervention strategies based on natural language processing.
[0051] This invention achieves a fundamental breakthrough in the field of insomnia intervention by constructing a user-personalized causal graph and using it as an environment model to drive reinforcement learning to train a personalized strategy network. First, the personalized causal graph learns the unique insomnia-causing mechanisms from the user's historical data, shifting the formulation of intervention strategies from statistical associations based on group commonalities to precise targeting based on individual causal mechanisms, fundamentally improving the scientific rigor and relevance of interventions. Second, by using reinforcement learning to train the strategy network within this causal environment model, the system can simulate and evaluate the long-term causal chain consequences of intervention actions, thereby outputting forward-looking optimal decisions and avoiding the short-sightedness of static rules. Finally, based on the same causal graph, causal explanation information is provided for the intervention strategy, transforming black-box decision-making into scientific logic understandable to users, greatly enhancing the credibility of the intervention and user compliance. In summary, through a closed loop of "causal discovery - reinforcement learning - interpretable output," the invention comprehensively achieves deep personalization, dynamic adaptation, and high interpretability of intervention strategies, effectively solving the core problems of generic, lagging, and scientifically unfounded intervention measures in existing technologies. It can improve the accuracy and intelligence of automatically generated insomnia intervention strategies based on natural language processing.
[0052] In one embodiment, please refer to Figure 2 , Figure 2 This is a schematic diagram of the first sub-process of the artificial intelligence-based insomnia data processing method provided in an embodiment of the present invention. Figure 2 As shown, in this embodiment, the step of "using a time-series causal discovery model to learn causal structure based on the multimodal time-series dataset to construct a user-personalized causal graph" includes:
[0053] S21. Perform data cleaning and alignment on the multimodal time series dataset to remove abnormal data points and unify the timestamps of each modality.
[0054] S22. Extract preset time-domain feature vectors, frequency-domain feature vectors, and nonlinear feature vectors from the cleaned multimodal time-series data to form a joint feature matrix;
[0055] S23. Input the joint feature matrix into the time-series causal discovery model based on the NOTEARS algorithm, and calculate the weighted adjacency matrix between each time-series data variable by solving a continuous optimization problem with acyclic constraints.
[0056] S24. Set a causal strength threshold, binarize the weighted adjacency matrix, optimize the sparsity of the resulting directed acyclic graph based on the Akaike information criterion, and finally output the user-personalized causal graph.
[0057] Interpretationally, time-domain eigenvectors, frequency-domain eigenvectors, and nonlinear eigenvectors are numerical representations extracted from the original time-series signal to quantify its different statistical properties.
[0058] The time-domain feature vector describes the statistical characteristics of a signal over time, including but not limited to: mean (reflecting average activity level), standard deviation (reflecting the degree of fluctuation), and root mean square (reflecting energy level). For example, the nighttime mean and standard deviation can be extracted from a heart rate signal.
[0059] Frequency domain eigenvectors reveal the energy distribution of a signal along the frequency dimension, including but not limited to the power spectral density of each frequency band (such as low frequency and high frequency) calculated by Fast Fourier Transform. For example, the ratio of low-frequency to high-frequency power can be extracted from a heart rate variability signal to quantify the autonomic nervous system's balance.
[0060] Nonlinear eigenvectors characterize the complexity and irregularity in signal dynamics, including but not limited to: sample entropy (quantifying signal complexity; higher values indicate greater irregularity) and fractal dimension (describing the self-similarity structure of a signal). For example, calculating the sample entropy of "body movement" signals can be used to assess sleep stability.
[0061] NOTEARS, or score-based causal discovery algorithm, transforms the discrete graph structure search problem into a continuous optimization problem. Compared to constraint-based PC algorithms, NOTEARS learns causal graphs from data more efficiently and stably. Its algorithm is built upon defining a differentiable loss function to measure the goodness of fit of a directed acyclic graph (DAG) to the data and introducing a differentiable acyclic constraint based on the matrix exponential trace. (W is the weighted adjacency matrix, and d is the number of variables), ensuring that the optimization result always satisfies the acyclicity constraint. The training process is implemented through an optimization algorithm, specifically: using an optimizer such as gradient descent (e.g., Adam), minimizing the loss function L(W) = [data fitting loss term] + α *h(W) which combines goodness of fit and acyclicity constraint, where α is the penalty coefficient, thereby directly solving for the weighted adjacency matrix W that reflects the causal strength between variables.
[0062] The causal strength threshold is used to binarize the weighted adjacency matrix to remove weak or unreliable causal connections. The logic for setting this threshold is to take the median or third quartile of the absolute values of all non-zero elements in the weighted adjacency matrix. This logic can adaptively filter out edges with low strength, ensuring the robustness of the resulting causal graph.
[0063] The Akaike Information Criterion (AIC) is a criterion for measuring the goodness of fit and complexity of a statistical model. It is defined as AIC = 2k - 2ln(L), where k is the number of model parameters and L is the maximum value of the model's likelihood function. AIC encourages good data fit while penalizing model complexity, and is used to seek the best balance between model fit and simplicity to avoid overfitting.
[0064] Based on the above concept and description, the embodiments of the present invention aim to robustly construct user-personalized causal graphs from multimodal data, and the implementation path is as follows:
[0065] First, data preprocessing and feature engineering (i.e., steps S21 and S22) clean, align, and interpolate the raw data to form regularized time-series data. Then, the aforementioned time-domain, frequency-domain, and nonlinear feature vectors are extracted in parallel from each regularized time-series data, and all features are concatenated into a high-dimensional joint feature matrix. This step transforms the raw, redundant time-series signal into an information-rich feature representation that can be used for machine learning.
[0066] Secondly, causal structure learning (i.e., step S23) involves inputting the joint feature matrix into a model based on the NOTEARS algorithm. This model directly outputs a weighted adjacency matrix by solving the aforementioned continuous optimization problem with acyclic constraints. Each element W_ij in this matrix represents the causal strength of variable i on variable j. By transforming graph learning into differentiable optimization, it ensures that the potential causal direction and strength between variables can be identified stably and efficiently with data support, providing core evidence for building scientific personalized models.
[0067] Finally, in the graph structure optimization and output (i.e., step S24), a causal strength threshold (e.g., 0.1) is set, and the weighted adjacency matrix is binarized to remove weak connections, forming an initial directed acyclic graph. Subsequently, based on the Akaike Information Criterion (AIC), different edges are removed and the AIC value of the graph is calculated. The graph structure with the smallest AIC value is finally selected as the optimal model. This step automatically removes redundant connections that do not contribute much to the model's interpretability through the objective statistical standard of AIC, ensuring that the final output user-personalized causal graph can not only fully capture the causal patterns in the data but also has good generalization ability and interpretability, avoiding the overfitting problem common in complex models.
[0068] This invention, through the construction of a precise and robust personalized causal graph, achieves individualized and quantifiable insights into the mechanisms of insomnia. Its core improvement lies in shifting from fuzzy association analysis based on group statistics to explicit causal structure learning driven by individual data. Specifically, firstly, by extracting time-domain, frequency-domain, and nonlinear features to construct a joint feature matrix, the dynamic patterns and complex dynamic information contained in time-series data are fully explored from multiple perspectives. This provides information-rich and noise-reduced input for subsequent causal discovery, overcoming the limitation of "incomplete feature representation" in traditional methods and laying the foundation for model accuracy. Secondly, by employing the NOTEARS algorithm to transform causal graph learning into a continuous optimization problem with acyclic constraints, the causal direction and strength between variables can be learned stably and efficiently directly from the data. This solves the fundamental defects of traditional methods (such as the PC algorithm) in poor stability when estimating causal direction, or inability to distinguish between causation and correlation based methods, providing a reliable basis for generating scientific intervention strategies. Finally, by optimizing the sparsity of the initial graph based on the Akaike information criterion, redundant connections with statistically insignificant meaning are automatically eliminated, ensuring the simplicity and generalization ability of the final causal graph, effectively preventing model overfitting, and improving its clinical interpretive value and application robustness. In summary, the embodiments of the present invention effectively solve the technical problems of insomnia models that are inaccurate and unreliable due to the lack of individualization, robustness and causal inference ability in the prior art through a complete technical chain of "comprehensive feature extraction → robust causal discovery → automatic model optimization". This provides a crucial scientific model foundation for the subsequent realization of highly personalized and precise intervention, thereby improving the accuracy and intelligence of automatically generated insomnia intervention strategies based on natural language processing.
[0069] In one embodiment, after constructing the user-personalized causal graph, the method further includes a step of extracting critical paths from the user-personalized causal graph:
[0070] In the user-personalized causal graph, the variable node representing sleep efficiency and the variable node representing total sleep duration are set as target variable nodes;
[0071] From all directed paths pointing to the target variable node, calculate the overall causal flow strength of each path, which is obtained by multiplying the causal weight coefficients of each edge on the path.
[0072] All paths are sorted in descending order based on the overall causal flow intensity, and the top K paths with the highest intensity are selected. All non-target variable nodes contained in these paths are marked as key causal variables, forming a set of key variables for the subsequent reinforcement learning state space, where K is a natural number.
[0073] Explained, after constructing a personalized causal graph for each user, embodiments of the present invention aim to identify a few core variables that have a decisive impact on sleep quality from a complex causal network by performing key information extraction steps. Specific technical means include the following:
[0074] First, the target variable nodes were set. This operation is based on a clear clinical medical consensus: sleep efficiency (total sleep time / total time in bed) and total sleep duration are internationally recognized as the two most core and objective gold standard indicators for quantifying sleep quality. Therefore, setting these two variables as target variable nodes in the causal diagram is not arbitrary, but rather anchors the technical approach to solid medical knowledge, ensuring the clinical significance and effectiveness of subsequent path extraction, and focusing the entire analysis on improving fundamental sleep outcomes.
[0075] Secondly, the overall causal flow strength is calculated. For each directed path from any source node to the target variable node, its overall causal flow strength is obtained by multiplying the causal weight coefficients of all edges along the path. This technique is based on the "path effect" principle in causal theory, which states that the total effect of a cause variable on an outcome variable through a multi-step causal chain can be approximated by the product of the local causal effects along the path. The multiplication operation (rather than addition or other operations) mathematically simulates the transmission and amplification (when the absolute value of the weight is less than 1) or reduction (when the absolute value of the weight is greater than 1) of this effect along the causal chain. For example, if the path is A -> B -> C, its strength is W_AB * W_BC. This provides quantitative evidence that this calculation method can truly reflect the theoretical potential impact of different causal paths on the final sleep outcome, making path selection based on objective and quantifiable mathematical foundations, rather than subjective assumptions.
[0076] Finally, the calculated overall causal flow strength is sorted, and the top K strongest paths are selected. All non-target variable nodes (i.e., causal variables) contained in these paths are marked as key causal variables, forming a set of key variables. This step achieves feature selection and dimensionality reduction from a complex full graph, accurately extracting the set of core influencing factors that contribute most to the target user's sleep problems. Here, K is a natural number, and its value is determined by balancing the complexity of the state space with the completeness of information. The logic for determining the value of K is as follows: First, calculate the overall causal flow strength of all paths pointing to the target variable nodes, then sort them in descending order of strength, and select the minimum number of paths required for the cumulative strength contribution to reach 60% to 80% of the total strength as the K value. K is usually no more than 10. In a preferred simplified implementation, K is directly set to 5.
[0077] For example, continuing from the previous example, suppose the structure of user Zhang San's personalized causal graph is as follows, where the numbers on the edges represent causal weights:
[0078] [Daytime stress (0.7)] -> [Nighttime heart rate (0.6)] -> [Sleep efficiency];
[0079] [Caffeine intake (0.8)] -> [Sleep latency (0.9)] -> [Total sleep duration];
[0080] [Bedroom noise (0.5)] -> [Number of awakenings (0.7)] -> [Sleep efficiency];
[0081] Target setting: Set "sleep efficiency" and "total sleep duration" as target nodes.
[0082] Path and intensity calculation:
[0083] Path 1 (Daytime Stress -> Sleep Efficiency): Intensity = 0.7 * 0.6 = 0.42;
[0084] Pathway 2 (Caffeine Intake -> Total Sleep Duration): Intensity = 0.8 * 0.9 = 0.72;
[0085] Path 3 (Bedroom Noise -> Sleep Efficiency): Intensity = 0.5 * 0.7 = 0.35;
[0086] Key variable extraction: If K=2, then path 2 and path 1 are selected. The set of key causal variables is: {daytime stress, nighttime heart rate, caffeine intake, sleep latency}.
[0087] This invention, through the automated extraction of key paths and variables from a user's personalized causal graph, achieves precise dimensionality reduction and focusing on the complex causes of insomnia. Its core benefits are: 1) Improved decision-making efficiency: providing a highly condensed state space for subsequent reinforcement learning, significantly reducing the training difficulty and computational overhead of the policy network, and accelerating convergence; 2) Enhanced intervention targeting: by identifying the few key variables that have the greatest impact on the user's sleep quality, the subsequently generated intervention strategies can directly address the root causes, avoiding wasting resources on secondary factors, thereby significantly improving the accuracy and efficiency of personalized intervention.
[0088] In one embodiment, the step of "using the user-personalized causal graph as an environment model, training the policy network based on a reinforcement learning algorithm to obtain a personalized policy network" includes:
[0089] Construct a state space, which is composed of the statistical feature vectors of each variable in the set of key variables within the most recent preset time window. The statistical feature vectors include the mean, standard deviation, and first-order difference slope.
[0090] Construct an action space, which is a discrete set of intervention actions, including suggestions for adjusting caffeine intake, suggestions for adjusting daytime exercise intensity, recommendations for performing a bedtime relaxation program, and instructions for adjusting bedroom environment parameters;
[0091] A deep Q-network is used as the value function approximator of the policy network. The network structure of the deep Q-network includes an input layer, two fully connected hidden layers, and an output layer, wherein the number of nodes in the output layer is equal to the dimension of the action space.
[0092] The state transition samples are stored using an experience replay mechanism, and the training process is stabilized by periodically updating the target network and using double Q learning techniques. The weight parameters of the deep Q network are iteratively updated by minimizing the temporal difference error loss function until the network converges, thus obtaining the personalized policy network.
[0093] Furthermore, the reward function in the reinforcement learning algorithm is defined by the following formula:
[0094] R(t) = w1 * ΔSE + w2 * ΔTST - w3 * ΔWASO - w4 * C;
[0095] Where R(t) represents the reward value obtained at time step t; ΔSE, ΔTST, and ΔWASO represent the changes in sleep efficiency, total sleep duration, and wakefulness after falling asleep, respectively, compared to the previous sleep cycle; w1, w2, w3, and w4 are preset positive weighting coefficients; and C is the compliance cost estimated based on historical user compliance data for performing the current intervention action.
[0096] Interpretatively, the state space represents the mathematical representation of an agent's response to all possible environmental states in reinforcement learning. It originates from a set of key variables extracted in previous steps, and its content consists of a statistical feature vector for each variable within the most recent predefined time window (e.g., 24 hours). This vector includes: mean (reflecting average level), standard deviation (reflecting volatility), and first-order difference slope (reflecting trend). For example, the state of the "daytime stress" node might be (mean = 65, standard deviation = 8, slope = +2), quantifying the user's recent overall state. The most recent predefined time window, used to extract statistical features from the set of key variables to construct the state vector, should reflect the user's recent dynamics; its typical value is 24 hours to cover a complete behavioral cycle (i.e., one day and one night).
[0097] Action space represents the set of all executable operations of an agent. In this embodiment of the invention, it is defined as a discrete set of intervention actions, including: "adjusting caffeine intake recommendations", "adjusting daytime exercise intensity recommendations", "recommending the execution of a bedtime relaxation program", and "adjusting bedroom environment parameters instructions". This ensures that the output of the policy network is a clear and executable clinical intervention.
[0098] Deep Q-Networks (DQNs) are reinforcement learning algorithms that use deep neural networks to approximate the Q-function (action value function). Deep Q-Networks were chosen because they are suitable for decision-making problems in this embodiment of the invention where the state space is continuous and the action space is discrete. Its structure includes: an input layer (the number of nodes equals the dimension of the state vector), two fully connected hidden layers (used to abstract state features layer by layer, learning the complex nonlinear relationship between state and action value), and an output layer (the number of nodes equals the dimension of the action space, with each node outputting the Q-value of the corresponding action).
[0099] The experience replay mechanism is a training technique that stores state transition samples (i.e., (state S_t, action A_t, reward R_t, next state S_{t+1}) quadruples) of the agent's interaction with the environment in a fixed-size replay buffer.
[0100] A state transition sample is the basic unit for recording the consequences of an agent's decision. It means "to perform action A_t in state S_t, obtain reward R_t, and transition to state S_{t+1}".
[0101] Based on the above concept and description, the embodiments of the present invention aim to train a "personalized policy network" capable of making optimal sequence decisions for specific individual target users, and the specific technical path is as follows:
[0102] First, a state space and an action space are constructed. The state space is built based on a set of key variables, ensuring that the state representation includes information on all causally verified variables that have a major impact on sleep, providing the agent with comprehensive and accurate environmental perception. Defining a discrete set of intervention actions as the action space confines the learning problem to a clinically meaningful and feasible scope.
[0103] Secondly, network training and optimization include the following: 1) Using a deep Q-network as a function approximator, its multi-layered nonlinear structure enables it to learn complex decision functions and understand the complex mapping between states, actions, and long-term rewards. 2) Utilizing an experience replay mechanism, the network is updated by randomly sampling historical samples from the buffer, breaking the temporal correlation between data, effectively solving the training instability and oscillation problems caused by data sequence correlation, and improving data efficiency. 3) Employing a periodically updated target network and double Q-learning technology. The target network (a network with the same structure as the online network but with delayed parameter updates) is used to calculate a stable Q-learning target value, while double Q-learning effectively overcomes the problem of overestimation of Q-values commonly found in traditional Q-learning under function approximation by decoupling action selection and value evaluation. These two techniques together constitute the key technical guarantee for a stable training process. 4) The core of its training is to iteratively update network parameters by minimizing the temporal difference error loss function. This loss function measures the difference between the Q-value predicted by the current network and the more stable target Q-value calculated based on the target network. 5) This error is minimized through gradient descent, driving network parameter updates so that its Q-value predictions increasingly accurately reflect the long-term true value of actions, until the network converges. The resulting network is a personalized policy network that internalizes the optimal decision-making strategy.
[0104] Furthermore, the reward function R(t) = w1 * ΔSE + w2 * ΔTST - w3 * ΔWASO - w4 *C is the "command stick" for training. By improving the weighted core sleep indicators (SE, TST) and worsening the poor sleep indicator (WASO), it transforms the abstract goal of "improving sleep" into a quantifiable optimization goal, guiding the agent to learn truly effective strategies. The introduction of compliance cost C forces the agent to weigh the effectiveness of the strategy against the feasibility for the user. The learned strategy is not only effective but also more likely to be executed by the user, thus improving the practicality of the solution.
[0105] For example, suppose the state vector shows that the user's "nighttime heart rate" has a high mean and a large standard deviation (drastic fluctuations), and that "caffeine intake" is on the rise. In the early stages of training, the policy network may randomly choose the action "increase evening exercise," which leads to a further increase in heart rate, worse sleep, and negative rewards. After a lot of trial and error and learning by replaying experience, the network gradually discovers that choosing "recommended pre-sleep breathing relaxation" in the current state can more effectively reduce heart rate and improve sleep, thereby obtaining high rewards. Finally, the converged network learns to map the high heart rate and high caffeine state to the optimal action of "recommended pre-sleep breathing relaxation."
[0106] This invention, through the use of a personalized causal graph as an environmental model and training it using an advanced deep reinforcement learning framework, achieves automatic optimization and high personalization of intervention strategies. Its core benefits are: 1) Foresight in decision-making: By learning through trial and error in a causal graph simulation environment, the policy network can assess the long-term causal consequences of actions, avoiding the short-sightedness of static rules; 2) High personalization: The final policy network is trained on the user's unique causal model, and its decisions are fully adapted to the user's physiological behavior patterns; 3) Robustness and practicality: Through a series of techniques such as experience replay, target networks, double-Q learning, and reward functions incorporating compliance costs, the training process is ensured to be stable and efficient, and the final strategy is both effective and feasible. In summary, through the synergy of the above techniques, the core problems of traditional general intervention programs—lack of dynamic planning, poor individual adaptability, and low user compliance—are jointly solved.
[0107] In one embodiment, please refer to Figure 3 , Figure 3 This is a schematic diagram of the second sub-process of the artificial intelligence-based insomnia data processing method provided in an embodiment of the present invention. Figure 3 As shown, in this embodiment, the step of "generating causal explanation information corresponding to the personalized insomnia intervention strategy based on the user's personalized causal graph" includes:
[0108] S31. Map the current state data to the corresponding variable node in the key variable set, and determine and mark its state level as "high", "medium" or "low" according to a preset threshold.
[0109] S32. Determine the target sleep variable node that the personalized insomnia intervention strategy intends to optimize;
[0110] S33. Extract all directed causal paths connecting the marked current state nodes to the target sleep variable node from the user-personalized causal graph.
[0111] S34. Calculate the overall causal impact strength of each path, and select at least one key causal path based on this strength;
[0112] S35. Convert the variable nodes and causal directions involved in the key causal path into text descriptions using a predefined natural language template to generate the causal explanation information.
[0113] Interpretatively, the overall causal influence strength is used to quantify the combined impact potential of a causal path on the final outcome. It is derived from the causal weight coefficients of each edge in a user-personalized causal graph. Defined as follows, for a directed path connecting the current state node and the target sleep variable node, the overall causal influence strength is characterized by the product of the causal weight coefficients of all edges along that path. This calculation method simulates the theoretical total effect of the causal variable on the final target variable through this multi-step causal chain. For example, for the path "daytime stress → nighttime heart rate → sleep efficiency," if the weights of the two edges are 0.7 and 0.6 respectively, then its overall causal influence strength is 0.7 * 0.6 = 0.42. This method provides a quantifiable and unified benchmark for objectively comparing the importance of different paths.
[0114] Predefined natural language templates are rules for converting causal paths into text. For example, for a causal path containing three nodes, "Variable A → Variable B → Target Variable C", a possible template is: "The system detects that your [Variable A] is at a [high / medium / low] level, which will cause your [Variable B] to change [increase / decrease], thus negatively affecting your [Target Variable C]. Therefore, it is recommended that you implement a [personalized insomnia intervention strategy] to improve this situation." It should be noted that those skilled in the art can adaptively adjust the wording in the above template according to the actual causal direction (positive or negative) and node names.
[0115] Based on the above concept and description, the embodiments of the present invention aim to provide a transparent and credible scientific explanation for personalized insomnia intervention strategies, and the specific technical path is as follows:
[0116] First, the target sleep variable node is identified (i.e., step S32). This step maps the action intent of the personalized insomnia intervention strategy back to the core sleep indicator node in the causal graph above by analyzing the action intent. For example, if the strategy is "recommending a pre-sleep relaxation procedure," its intent is usually to reduce physiological arousal to improve "sleep efficiency"; if the strategy is "adjusting bedtime," its intent is more directly related to "total sleep duration." Based on this, this technique establishes a precise mapping from "intervention action" to "target in the causal model," ensuring that subsequent path search and interpretation generation always revolve around the core intervention target of the strategy, thus fundamentally guaranteeing the relevance and accuracy of the interpretation.
[0117] Secondly, the overall causal influence strength is calculated (i.e., step S34). After extracting all directed paths connecting the current state and the target node from the causal graph, the strength of each path is calculated by multiplying the causal weight coefficients along the paths. This technique is based on path analysis theory in causal inference. This theory states that the total indirect effect of a variable through an intermediate path can be approximated as the product of the direct effects along the path. Using multiplication, rather than summation or averaging, this method strictly adheres to the aforementioned theory mathematically, providing objective quantitative evidence with statistical theoretical support for assessing the relative importance of different paths. This allows the system to abandon subjective judgment and automatically select the key causal paths that contribute the most to the current problem, thus ensuring the scientific rigor and core relevance of the generated explanation.
[0118] Finally, by converting key causal paths into text using predefined natural language templates (i.e., step S35), the transformation from machine-readable graph structures to human-understandable logical statements is achieved, completing the final step in interpretability.
[0119] For example, suppose the intervention strategy generated by the system for user Zhang San is "It is recommended to stop consuming caffeine in the afternoon," and the current status data shows that his "caffeine intake" level is "high." Based on this, the corresponding causal explanation information is generated, including the following steps: 1) Identify the target node. The system infers that the goal of this strategy is to optimize "sleep efficiency"; 2) Extract the path. From Zhang San's personalized causal graph, the path "caffeine intake (high)" is extracted; 3) Calculate the strength and filter. The strength of this path is calculated as "0.8 (caffeine -> sleep latency) * 0.6 (sleep latency -> sleep efficiency) = 0.48," and it is assumed that this strength is the highest and is selected as the critical path; 4) Generate the explanation. Substitute the path into the template and generate the following corresponding explanation: "Because your [caffeine intake] level is [high], this will lead to an increase in [sleep latency], which in turn reduces your [sleep efficiency]. Therefore, it is recommended that you [stop consuming caffeine in the afternoon] to block this effect."
[0120] This invention, through a rigorous process based on a quantitative causal model, generates scientifically grounded natural language explanations for personalized insomnia intervention strategies based on AI decision-making. Its core benefits are: 1) Decision transparency: It traces the black-box strategy network decision-making back to a transparent, user-specific causal graph, making the decision-making process visible to the user and effectively solving the "trustworthiness" problem of AI systems; 2) User compliance: By providing clear and understandable scientific logic of "why to do it this way," rather than rigid instructions, it greatly enhances users' understanding and acceptance of the intervention strategy, thereby significantly increasing their willingness and likelihood to implement the recommendations; 3) Explanation accuracy: By anchoring the intervention target to nodes in the causal graph and employing theoretically supported path strength calculation rules, it ensures that the explanation is not only easy to understand but also scientifically accurate and personalized, unlike generic and vague explanations.
[0121] In one embodiment, before performing the model training phase for the first time, the method further includes a model initialization step:
[0122] A general temporal causal discovery model pre-trained on a large anonymous user sleep dataset is loaded, and the general temporal causal discovery model has learned universal causal prior knowledge between sleep-related variables;
[0123] Using the multimodal time-series dataset as a fine-tuning dataset, transfer learning techniques are employed to fine-tune the network parameters of the general time-series causal discovery model by minimizing the negative log-likelihood loss on the fine-tuning dataset, so that it can be adapted to the personalized characteristics of the target user and used to perform the step of "constructing a user-personalized causal graph".
[0124] Interpretatively, the generalized temporal causal discovery model refers to a temporal causal discovery model pre-trained on a large, diverse, anonymized user sleep dataset. The training data comes from a large-scale dataset containing multimodal time-series data on physiological, behavioral, and environmental factors from a broad population. Its construction and training are similar to the aforementioned personalized model construction process, employing the same algorithms (such as NOTEARS), but the training data comes from the population. Furthermore, by minimizing the loss function (such as negative log-likelihood) on this large dataset, the model learns common and stable causal patterns among sleep variables, aiming to give it good generalization ability and make it a powerful foundational model.
[0125] Causal prior knowledge refers to the structural information about prevalent causal relationships between sleep variables that a general model learns from population data and internalizes into its network parameters. This information includes, but is not limited to: common causal directions (e.g., "daytime caffeine intake" typically leads to changes in "nighttime heart rate," rather than the other way around), typical ranges of causal strength, and common connection patterns between variables (e.g., which variables are more likely to be directly linked). For example, this prior knowledge might indicate a high probability of a negative causal relationship between "bedroom light exposure" and "sleep latency."
[0126] Based on the above concept and setup, the embodiments of the present invention aim to solve the "cold start" problem when building a high-quality causal model for a single target user, that is, the small amount of individual data leads to unstable model training or failure to converge. The specific technical path for its implementation is as follows:
[0127] The core of the initialization steps for the general temporal causal discovery model is the use of transfer learning techniques. Specifically, a pre-trained general temporal causal discovery model is first loaded, which already contains causal prior knowledge learned from massive amounts of data. Then, a relatively small amount of multimodal time-series data from the target users is used as a fine-tuning dataset. The network parameters of the general model are fine-tuned by minimizing the negative log-likelihood loss on this fine-tuning dataset. Based on this, the following technical effects can be achieved: 1) Utilizing prior knowledge reduces data requirements. Specifically, the causal prior knowledge provided by the general model serves as a high-quality initialization starting point, greatly constraining the hypothesis space of the model search. This means that the model does not need to learn all possible causal relationships from random states, but only needs to make local adjustments to the "skeleton" of prior knowledge to adapt to individual characteristics. This effectively demonstrates that this method can significantly reduce the amount of data required to build a personalized model, making it possible to obtain a stable and reliable model even with limited user data. 2) Fine-tuning optimization to achieve individual adaptation. Specifically, the optimization objective of "minimizing the negative log-likelihood loss on the fine-tuning dataset" drives the model parameters to make subtle adjustments in the direction of maximizing the fit to the target user's personal data while maintaining the common knowledge of the group. The negative log-likelihood loss function directly measures the goodness of fit of the model to the user data. Optimizing this loss through gradient descent provides a clear mathematical path and evidence that the model can learn the unique causal patterns that distinguish the user from the group (for example, it may find that "noise" which is not sensitive to most people has a significant impact on the user's sleep), thereby achieving a precise adaptation from "general" to "personalized".
[0128] This invention, through transfer learning technology, cleverly resolves the contradiction between limited data and the need for personalized models by fine-tuning pre-trained models. Its core benefits are: overcoming cold start, enabling the system to generate relatively reliable personalized causal graphs for new users in the early stages of data accumulation, greatly improving system usability and user experience; enhancing model robustness by using causal priors learned from large datasets as regularization, effectively preventing overfitting on small sample data and ensuring the generalization ability of the personalized model; and accelerating the personalization process by providing a superior starting point for model initialization, significantly reducing the time and amount of data required for the model to converge to satisfactory performance compared to training from scratch. These factors collectively ensure that the solution of this invention can quickly and stably provide high-quality personalized services to each user.
[0129] In one embodiment, the method further includes the step of updating the personalized policy network online:
[0130] Continuously monitor the newly generated multimodal time-series data after the target user implements the personalized insomnia intervention strategy;
[0131] At a preset update cycle, new multimodal time series data is added to the historical dataset, and the model training phase is re-executed to update the user-personalized causal graph and the personalized policy network.
[0132] Calculate the average reward value of the policy network before and after the update on the validation set. If the increase in average reward exceeds a preset threshold, deploy the updated policy network as the current model.
[0133] Interpretatively, the historical dataset, in the context of this online update, is a dynamically growing collection of data representing the complete dataset that expands over time for retraining (updating) the user's personalized causal graph and policy network. It originates from two sources: the multimodal time-series dataset used during the initial model training phase, and newly generated multimodal time-series data acquired through continuous monitoring during the online update phase after the target user implements the intervention policy. It records the user's entire history from the initial state to the current state, ensuring the model can learn based on the most comprehensive information.
[0134] A preset magnitude threshold is used to determine whether the policy network update is effective. This threshold reflects the minimum significant level of model performance improvement, and its typical value range is 5% to 15% of the average reward value. In a preferred embodiment, the threshold is set to 10%, that is, the new model is deployed only when the average reward value of the updated network is improved by more than 10% compared with that before the update.
[0135] Based on the above concept and description, the embodiments of this invention aim to enable the system to adapt to the long-term evolution of user states and achieve self-evolution of the model. The specific technical path of its implementation is as follows: The core of the online update mechanism lies in forming a closed loop of "execution-monitoring-learning-evaluation-deployment." The system continuously monitors user behavior and its results, adds new data to the historical dataset, and re-executes the model training phase. This process ensures that the causal graph and policy network can capture the user's latest lifestyle patterns and physiological changes. For example, a user may develop tolerance to a certain intervention, or the old causal model may become invalid due to changes in their lifestyle. The key technical means lies in the decision-making mechanism during updates: "calculating the average reward value of the policy network before and after the update on the validation set."
[0136] Based on this, the following technical effects can be achieved: 1) Objective performance measurement: The "average reward value" is the most direct and comprehensive quantitative indicator of the policy network's performance. The reward function R(t) itself is designed to comprehensively reflect the core indicators of sleep improvement (ΔSE, ΔTST) and user compliance (C). Therefore, the average reward value calculated on the validation set (e.g., a reserved portion of recent data) can objectively measure the overall performance of the policy network in a scenario close to reality, rather than just focusing on the model's fit on the training set. 2) Reliable basis for update decisions: By comparing the average reward value of the policy network before and after the update on the same validation set, it is possible to effectively evaluate whether the newly trained network has brought about a substantial performance improvement. The condition of "the improvement exceeds the preset threshold" sets a strict and quantitative entry threshold, providing clear evidence that this technique can effectively prevent model performance regression or invalid updates caused by small data fluctuations or training randomness, ensuring that only new models that have been proven to be better will be deployed. This guarantees that the system's performance will monotonically improve or at least remain stable during the dynamic update process, avoiding the risks introduced by blind updates.
[0137] This invention, through the establishment of an online update mechanism based on rigorous performance evaluation, endows the system with continuous self-optimization capabilities. Its core beneficial effects are: 1) Dynamic adaptability: enabling the system to continuously evolve in response to long-term changes in user status, solving the problem of static models gradually becoming ineffective over time; 2) Update robustness: through quantitative comparison and threshold judgment based on the average reward of the validation set, it ensures that each model update is prudent and beneficial, effectively avoiding damage to user experience caused by model oscillations or performance degradation; 3) System vitality: making the entire insomnia intervention system a "lifelong learning" intelligent agent, maintaining the effectiveness and accuracy of its intervention in the long term, ultimately providing users with continuous, reliable, and personalized health management services.
[0138] In one embodiment, the method further includes a step of result visualization and interaction:
[0139] On the user interface, the user-personalized causal graph is visualized in the form of a dynamic and interactive directed graph, where the size of the nodes maps the importance of variables and the thickness of the edges maps the causal strength.
[0140] When outputting the personalized insomnia intervention strategy, the key causal path corresponding to the causal explanation information is simultaneously highlighted on the visualized user-personalized causal graph;
[0141] A user feedback interface is provided to receive the target user's subjective rating of the effectiveness of the insomnia intervention strategy, and the subjective rating is used as an additional input signal for the reward function in subsequent reinforcement learning training.
[0142] Interpretatively, a dynamically interactive directed graph form represents a human-computer interface used to visualize complex network structures. It utilizes graphics libraries (such as D3.js and ECharts) to draw a user-personalized causal graph on the screen, where variables are displayed as nodes and causal relationships as directed edges. "Dynamically interactive" means, but is not limited to: 1) users can drag and drop nodes to rearrange them; 2) hovering over nodes or edges displays detailed information (such as variable names and causal weights); 3) clicking on a node allows users to focus on or filter related connections. This form transforms static data structures into visual models that users can actively explore.
[0143] Additional input signals, in the reinforcement learning framework, refer to data introduced into the reward function beyond the native environmental state to influence the agent's decisions. These signals originate from subjective ratings submitted by the target user through a feedback interface. Their content and meaning involve quantifying the target user's subjective feelings (such as satisfaction with the effectiveness of the intervention strategy, rated on a scale of 1-5) and introducing them as a new term into the reward function. For example, the reward function can be extended to R(t) = w1 * ΔSE + ... + w5 * U, where U represents the user's rating. This directly transforms the user's subjective experience into a computable signal driving model optimization.
[0144] The embodiments of this invention aim to improve the transparency, credibility, and user experience of the system, and introduce a user feedback loop to further optimize the strategy. The specific implementation technical path is as follows:
[0145] First, causal graph visualization: On the user interface, the causal graph is rendered by mapping variable importance to node size and causal strength to edge thickness. This technique transforms the abstract numerical information in the model into an intuitive and hierarchical visual representation through dual encoding of the visual channel (size and thickness), which greatly reduces the cognitive load for users to understand their personalized causal model and allows them to quickly focus on key influencing factors.
[0146] Secondly, the strategy and explanation are highlighted simultaneously. When the intervention strategy is output, the corresponding key causal path is highlighted on the visualized causal graph. This establishes a direct and synchronous visual connection between "what to do" (strategy) and "why to do it" (causal path). This provides clear evidence that the technology can present the aforementioned explained information to users in the most intuitive way, thereby effectively solving the "black box" problem of AI decision-making and enhancing users' trust in the system's decision-making through visual evidence.
[0147] Finally, a user feedback loop is established, providing a feedback interface to collect user subjective ratings and using them as additional input signals to the reward function. The core of this approach lies in structurally integrating user subjective feedback into the optimization objective of the AI model. As mentioned above, when the reward function is modified to R(t) = ... + w5 * U and subsequent training is performed, a clear mathematical path and optimization direction are provided for the policy network's learning process. This drives it to find intervention strategies that not only improve objective sleep indicators but also provide greater subjective satisfaction to users. This effectively demonstrates that this technique can achieve co-evolution between the system and the user, enabling the system strategy to continuously adapt to users' personalized preferences, thereby improving long-term intervention compliance and satisfaction.
[0148] For example, user Zhang San sees his personalized causal graph on the app, where the "daytime caffeine intake" node is large and connected to "sleep efficiency" by a thick line. When the system recommends the strategy "don't drink coffee after 3 pm," this path is highlighted in red. After implementing this strategy, Zhang San's sleep efficiency improves slightly, but he feels less energetic during the day. He gives the strategy a score of 2 out of 5 on the feedback screen. In the next online model update, this low score U=2 is entered into the reward function as a negative signal, guiding the policy network to be more cautious when recommending similar strategies to Zhang San in the future, or to explore other alternatives (such as "keeping caffeine intake below 100mg").
[0149] This invention, through its embodiment, deeply integrates complex AI models with user interaction to construct a transparent, trustworthy, and continuously optimizing intelligent system. Its core benefits are: 1) System transparency and user trust: Visualization and highlighting enable users to intuitively understand the AI's decision-making logic, greatly enhancing the system's credibility and acceptability; 2) Implementation of decision interpretability: Causal explanations are seamlessly integrated into the interaction visually, making interpretability no longer an abstract concept but a concrete user experience; 3) Further enhancement of personalization: By introducing a closed loop of user subjective feedback, the reinforcement learning model can simultaneously optimize objective indicators and subjective experience, achieving a leap from "machine-perceived effectiveness" to "user-perceived effectiveness," thereby significantly improving the long-term applicability and user stickiness of the intervention strategy.
[0150] In one embodiment, the step of "obtaining a multimodal time-series dataset associated with the target user within a preset historical time period" includes:
[0151] Physiological time-series data, including photoplethysmography (PPG) signals and triaxial acceleration signals, are collected from a wearable device bound to the target user at a first preset sampling frequency.
[0152] Behavioral time-series data is collected from the mobile terminal application bound to the target user. The behavioral time-series data includes caffeine intake timestamps, daytime exercise logs, and nighttime screen usage time.
[0153] Environmental time-series data is collected from IoT sensors deployed in the user's bedroom. The environmental time-series data includes a sequence of ambient noise decibel values and a sequence of ambient light intensity lux values.
[0154] The collected physiological time-series data, behavioral time-series data, and environmental time-series data are time-aligned and interpolated, and then normalized using the Z-score standardization method to form a unified standardized multimodal time-series data matrix, thus obtaining the multimodal time-series dataset.
[0155] Explained, wearable devices and their corresponding physiological time-series data refer to devices worn by target users that have built-in multiple sensors, such as smart bracelets and smartwatches. Wearable devices are hardware platforms that continuously and imperceptibly collect user bodily signals. Physiological time-series data refers to time-series signals reflecting the state of bodily functions recorded by such devices at a first preset sampling frequency (e.g., heart rate once per second, acceleration 32 times per second). Its content includes, but is not limited to: 1) photoplethysmography (PPG) signals, which use the periodic changes in blood's absorption characteristics of green light to infer heart rate and heart rate variability, and are a core indicator for assessing autonomic nervous system activity and stress response. 2) triaxial acceleration signals, which record the device's motion acceleration in three spatial dimensions, used to accurately identify sleep-wake states, body movement events, and estimate daytime activity intensity.
[0156] Mobile terminal applications and their corresponding behavioral time-series data refer to specific applications installed on target users' smartphones and other mobile devices. Mobile terminal applications are software interfaces used to record users' subjective input or automatically sense their behavioral events. Behavioral time-series data refers to voluntary user activity events recorded through the aforementioned applications. Its content includes, but is not limited to: 1) Caffeine intake timestamps: specific times when users manually enter or record the intake of coffee, tea, etc., by scanning product barcodes. 2) Daytime activity logs: structured activity records manually entered through applications or obtained by synchronization with fitness trackers. 3) Nighttime screen usage time: total screen activation time during specific nighttime periods, automatically calculated by interfaces provided by the mobile operating system.
[0157] IoT sensors and their corresponding environmental time-series data refer to sensing devices deployed in the target user's bedroom to monitor physical environmental parameters. IoT sensors are environmental parameter acquisition modules connected to a network. Environmental time-series data refers to the time-series parameters recorded by such devices that describe the sleep microenvironment. This data includes, but is not limited to: 1) Ambient noise decibel value sequences, sound pressure level data recorded in decibels at a frequency of seconds or minutes, used to quantify the noise level of the sleep environment; 2) Ambient light intensity lux value sequences, illuminance data recorded in lux at a frequency of seconds or minutes, used to assess the impact of light on sleep initiation and maintenance.
[0158] Based on the above concept and setup, the embodiments of the present invention aim to construct a high-quality, standardized multimodal dataset that can be used for subsequent causal discovery. The specific implementation technical path is as follows:
[0159] First, multi-source data acquisition involves parallel data collection from three independent sources. Specifically, "collecting physiological time-series data recorded at a first preset sampling frequency" ensures that physiological signals can capture their dynamic details with sufficiently high temporal resolution, providing data fidelity for subsequent extraction of meaningful time-domain and frequency-domain features. "Collecting behavioral time-series data" utilizes the convenient channel of a mobile application to obtain key subjective behavioral information that directly affects sleep but is difficult to measure directly with sensors. "Collecting environmental time-series data" supplements the objective external factors affecting sleep. The collection of these three types of data together constitutes a comprehensive, three-dimensional sleep profile, encompassing internal physiology, external behavior, and the surrounding environment, laying a solid data foundation for constructing a comprehensive causal model.
[0160] Secondly, data preprocessing and standardization: This involves performing "time alignment and interpolation, followed by Z-score normalization." Time alignment and interpolation address the issue that due to differences in device clocks and sampling frequencies, the original data is asynchronous and may contain gaps. This step utilizes a unified timeline and linear or spline interpolation algorithms to fill in the missing short-segment data, while also standardizing the timestamps of each data point. This technique provides clear evidence that it effectively solves the core problem of "time inconsistency" in multi-source heterogeneous data fusion, generating a strictly aligned and complete data sequence in the time dimension, thus clearing the way for accurate time-series correlation and causal analysis. Z-score normalization involves applying a formula to the aligned data... (Where x is the original value, μ is the mean, and σ is the standard deviation) is normalized. This method transforms various types of data with different dimensions and numerical ranges (such as heart rate in "beats / minute", noise in "decibels", and screen time in "minutes") into standardized scores with a mean of 0 and a standard deviation of 1. This provides crucial mathematical evidence that the processing completely eliminates the dimensional differences and baseline differences between the various modal data, prevents certain variables with large numerical ranges from occupying an unreasonable dominant position in subsequent machine learning models (such as NOTEARS), and ensures that the model can fairly learn the relationships between all variables, thereby directly improving the fairness, stability, and reliability of the causal discovery process.
[0161] Ultimately, these processed data are constructed into a unified, standardized multimodal time series data matrix, with rows representing time points and columns representing all standardized feature variables.
[0162] This invention provides high-quality, standardized data input through standardized multi-source data acquisition and rigorous preprocessing. Its core benefits are: 1) Data comprehensiveness: By integrating physiological, behavioral, and environmental data, it ensures that subsequent causal models can cover most potential factors affecting sleep, avoiding model bias caused by missing data; 2) Data quality and usability: Through time alignment, interpolation, and Z-score standardization, it overcomes the core technical obstacles of multi-source heterogeneous data fusion, generating a clean, well-organized dataset that can be directly used in complex machine learning models, providing the most fundamental data quality guarantee for subsequently building accurate and reliable user-personalized causal graphs and policy networks.
[0163] It should be noted that the artificial intelligence-based insomnia data processing methods described in the above embodiments can be recombined as needed to obtain combined implementation schemes, but all are within the protection scope claimed by this invention.
[0164] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0165] The software tools, components, or models not belonging to our company that appear in the embodiments of this invention are merely illustrative examples and do not represent actual use.
[0166] The data collection in this embodiment of the invention complies with the requirements of relevant laws and regulations, such as China's Personal Information Protection Law, GDPR (General Data Protection Regulation of the European Union), or information security standards of other countries and regions.
[0167] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. An artificial intelligence-based insomnia data processing method, characterized by, The method comprises: a model training stage, comprising: in response to a model training instruction for a target user, obtaining a multi-modal time series data set associated with the target user within a preset historical time period, the multi-modal time series data set comprising physiological time series data, behavioral time series data and environmental time series data; based on the multi-modal time series data set, using a time series causal discovery model to perform causal structure learning, and constructing a user personalized causal graph; using the user personalized causal graph as an environment model, training a strategy network based on a reinforcement learning algorithm to obtain a personalized strategy network; a strategy generation stage, comprising: obtaining current state data of the target user; inputting the current state data into the personalized strategy network to obtain a personalized insomnia intervention strategy; based on the user personalized causal graph, generating causal explanation information corresponding to the personalized insomnia intervention strategy; outputting the personalized insomnia intervention strategy and the causal explanation information.
2. The insomnia data processing method based on artificial intelligence according to claim 1, wherein, The step of "based on the multi-modal time series data set, using a time series causal discovery model to perform causal structure learning, and constructing a user personalized causal graph" comprises: performing data cleaning and alignment processing on the multi-modal time series data set to eliminate abnormal data points and unify the timestamps of each modality data; from the cleaned multi-modal time series data, extracting preset time domain feature vectors, frequency domain feature vectors and nonlinear feature vectors to form a joint feature matrix; inputting the joint feature matrix into a time series causal discovery model based on the NOTEARS algorithm, and calculating a weighted adjacency matrix between each time series data variable by solving a continuous optimization problem with a loop constraint; setting a causal strength threshold, binarizing the weighted adjacency matrix, and optimizing the sparsity of the obtained directed acyclic graph based on the Akaike information criterion, and finally outputting the user personalized causal graph. 3.The insomnia data processing method based on artificial intelligence according to claim 2, wherein, After constructing the user personalized causal graph, the method further comprises a step of extracting a key path from the user personalized causal graph: in the user personalized causal graph, set the variable node representing sleep efficiency and the variable node representing total sleep duration as target variable nodes; from all directed paths pointing to the target variable nodes, calculate the overall causal flow strength of each path, which is obtained by multiplying the causal weight coefficients of each edge on the path; sort all paths in descending order according to the overall causal flow strength, and select the top K paths with the highest strength, mark all non-target variable nodes contained in the top K paths as key causal variables, and construct a key variable set for subsequent reinforcement learning state space, wherein K is a natural number. 4.The insomnia data processing method based on artificial intelligence of claim 3, wherein, The step of "using the user personalized causal graph as an environment model, training a strategy network based on a reinforcement learning algorithm to obtain a personalized strategy network" comprises: constructing a state space, the state space being composed of statistical feature vectors of each variable in the key variable set within a latest preset time window, the statistical feature vectors including mean, standard deviation and first-order difference slope; constructing an action space, the action space being a discrete set of intervention actions, the set of intervention actions comprising adjusting caffeine intake recommendation, adjusting daytime exercise intensity recommendation, recommending performing a pre-sleep relaxation procedure, and adjusting bedroom environment parameter instruction; adopting a deep Q-network as a value function approximator of the policy network, the network structure of the deep Q-network comprising an input layer, two fully connected hidden layers, and an output layer, wherein the number of nodes of the output layer equals to the dimension of the action space; storing state transition samples by using an experience replay mechanism, and adopting a periodically updated target network and double Q-learning technique to stabilize the training process, iteratively updating the weight parameters of the deep Q-network by minimizing a temporal difference error loss function until the network converges, to obtain the personalized policy network. 5.The insomnia data processing method based on artificial intelligence according to claim 4, wherein, The reward function in the reinforcement learning algorithm is defined by the following formula: R(t) = w1 * ΔSE + w2 * ΔTST - w3 * ΔWASO - w4 * C; wherein R(t) represents the reward value obtained at time step t; ΔSE, ΔTST, and ΔWASO represent the change in sleep efficiency, total sleep time, and wake after sleep onset, respectively, compared with the previous sleep cycle; w1, w2, w3, and w4 are preset positive weight coefficients; and C is the compliance cost paid for performing the current intervention action, which is estimated according to historical user compliance data. 6.The insomnia data processing method based on artificial intelligence according to claim 3, wherein, The step of "generating causal explanation information corresponding to the personalized insomnia intervention strategy based on the user personalized causal graph" comprises: mapping the current state data to the corresponding variable node in the set of key variables, and judging and marking the state level as "high", "medium", or "low" according to a preset threshold; determining the target sleep variable node intended to be optimized by the personalized insomnia intervention strategy; extracting, from the user personalized causal graph, all directed causal paths connecting the marked current state node and the target sleep variable node; calculating the overall causal influence strength of each path, and filtering out at least one key causal path according to the strength; converting the variable nodes and causal directions involved in the key causal path into text descriptions through a predefined natural language template, to generate the causal explanation information. 7.The artificial intelligence-based insomnia data processing method of claim 1, wherein Before performing the model training phase for the first time, the method further comprises a model initialization step: loading a general temporal causal discovery model pre-trained on a large set of anonymized user sleep data, the general temporal causal discovery model having learned causal prior knowledge between sleep-related variables that are universal; using a transfer learning technique, fine-tuning the network parameters of the general temporal causal discovery model by minimizing the negative log-likelihood loss on the fine-tuning dataset, so that it is adapted to the personalized features of the target user, and used to perform the step of "constructing a user personalized causal graph". 8.The artificial intelligence-based insomnia data processing method of claim 1, wherein The method further comprises a step of online updating the personalized policy network: continuously monitoring the multi-modal time series data newly generated after the target user performs the personalized insomnia intervention strategy; The new multi-modal time-series data is added to the historical data set with a preset update period, and the model training stage is re-executed to update the user personalized causal graph and the personalized policy network; The average reward values of the policy networks before and after the update on the validation set are calculated, and if the improvement amplitude of the average reward exceeds a preset amplitude threshold, the updated policy network is deployed as the current use model. 9.The artificial intelligence-based insomnia data processing method of claim 1, wherein The method further includes the steps of result visualization and interaction: The user personalized causal graph is visualized and displayed in the form of a dynamic and interactive directed graph on the user interface, wherein the size of the node maps the variable importance and the thickness of the edge maps the causal strength. When outputting the personalized insomnia intervention strategy, the key causal path corresponding to the causal explanation information is highlighted on the visualized user personalized causal graph; A user feedback interface is provided to receive the target user's subjective score on the effectiveness of the insomnia intervention strategy, and the subjective score is used as an additional input signal of the reward function in subsequent reinforcement learning training. 10.The artificial intelligence-based insomnia data processing method of claim 1, wherein The step of "obtaining a multi-modal time-series data set associated with the target user within a preset historical time period" includes: From the wearable device bound to the target user, physiological time-series data recorded at a first preset sampling frequency is collected, including photoplethysmography signals and three-axis acceleration signals; From the mobile terminal application bound to the target user, behavioral time-series data is collected, including caffeine intake timestamps, daytime exercise logs, and nighttime screen use time; From the Internet of Things sensors deployed in the user's bedroom, environmental time-series data is collected, including environmental noise decibel value sequences and environmental light intensity lux value sequences; The collected physiological time-series data, behavioral time-series data, and environmental time-series data are time-aligned and interpolated, and normalized using the Z-score standardization method to form a unified standardized multi-modal time-series data matrix, obtaining the multi-modal time-series data set.