A method for regulating emotion and sleep based on a large language model and related equipment

Through the emotion and sleep regulation method based on the large language model, using multi-modal materials and reinforcement learning algorithms, the user's emotion and sleep state are optimized in real time, solving the problems of lack of personalization and slow response speed in the existing technology, and achieving high efficiency. sleep and mood management.

CN119075135BActive Publication Date: 2025-01-21PEKING UNIVERSITY THIRD HOSPITAL (THE THIRD CLINICAL MEDICAL SCHOOL OF PEKING UNIVERSITY)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411579983.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-01-21
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

The prior art lacks in-depth customization for individual needs in the treatment of sleep disorders, and the feedback mechanism responds slowly, making it difficult to capture subtle changes in user emotions and sleep state.

Method used

An emotion and sleep regulation method based on a large language model is used to obtain user data from multiple data sources, analyze emotion and sleep information, and generate adjustment factors. Utilize multi-modal materials and reinforcement learning algorithms for real-time cross-intervention to optimize the user's mood and sleep state, and combine positive and negative feedback mechanisms to improve user participation and the effectiveness of the adjustment plan.

Benefits of technology

It realizes personalized real-time management of emotions and sleep, improves the user's overall health status, and enhances the pertinence and efficiency of treatment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119075135B_ABST
    Figure CN119075135B_ABST
Patent Text Reader

Abstract

The present invention provides a method for regulating emotion and sleep based on a large language model and related devices, which are applied to the field of data processing technology. The present application obtains target user data; processes the target user data to generate attribute information of the target user and physiological identification information of the target user; processes the target user's emotion information based on a target large language model to generate first material information; processes the first material information based on the target user's sleep information to generate second material information, wherein the second material information includes audio information, video information and text information; processes the second material information based on the target large language model to generate an adjustment factor, wherein the adjustment factor is used to adjust the target user's emotion information and the target user's sleep information; processes the adjustment factor to generate real-time emotion information of the target user and real-time sleep information of the target user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method for regulating emotions and sleep based on a large language model and related equipment. Background Art

[0002] Sleep disorders refer to various problems that affect sleep, including difficulty falling asleep, interrupted sleep, waking up at night, and insufficient sleep. Sleep disorders may affect a person's physical and mental health and the quality of daily life. The number of people with sleep disorders is large, and many people around the world are affected by sleep disorders. The main existing treatments include drug therapy and non-drug therapy. Drug therapy includes hypnotics, sedatives, etc. These drugs can help improve sleep, but there are risks of side effects and dependence. Non-drug treatments mainly include cognitive behavioral therapy.

[0003] Traditional technologies, such as light therapy, music therapy, and behavioral therapy, are usually designed based on generalized principles and lack deep customization for individual needs. For example, light therapy and music therapy usually use a set of standardized light sources or music. The feedback mechanism in the existing technology often relies on regular manual monitoring and adjustment, which is slow to respond and may have difficulty capturing subtle changes in the user's mood and sleep state. For example, the effects of behavioral therapy usually take a long time to appear, and the feedback on the efficacy mainly depends on the user's subjective report. In addition, traditional therapies usually take a long time to take effect, and the effects may be unstable and affected by multiple factors. Users may give up treatment during the course of treatment because they cannot see the effect in the short term.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of this application is to provide a method and related equipment for regulating emotions and sleep based on a large language model, which at least overcomes the problems of the prior art to a certain extent. Through a large language model and machine learning technology, emotion and sleep information are extracted from user data and adjustment factors are generated. Through multimodal materials and reinforcement learning algorithms, real-time cross-intervention and optimization of the user's emotions and sleep status are carried out. Combined with positive and negative feedback mechanisms, the user's participation and the effectiveness of the adjustment plan are improved, and personalized real-time management of emotions and sleep is achieved to improve the user's overall health.

[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present invention.

[0007] According to one aspect of the present application, a method for regulating emotions and sleep based on a large language model is provided, comprising: obtaining target user data, wherein the target user data is composed of multiple data sources; processing the target user data to generate attribute information of the target user and physiological identification information of the target user, wherein the attribute information of the target user includes the emotional information of the target user and the sleep information of the target user within a preset time period, and the physiological identification information of the target user is used to characterize that the attribute information of the target user is abnormal; obtaining an initial large language model and a training sample set that match the physiological identification information of the target user; processing the training sample set based on preset processing rules to generate a training set and a verification set; and processing the target user data based on the training set and the verification set. The initial large language model is processed to generate a target large language model; the emotional information of the target user is processed based on the target large language model to generate first material information, wherein the first material information includes audio information and video information; the first material information is processed based on the sleep information of the target user to generate second material information, wherein the second material information includes audio information, video information and text information; the second material information is processed based on the target large language model to generate an adjustment factor, wherein the adjustment factor is used to adjust the emotional information of the target user and the sleep information of the target user; the adjustment factor is processed to generate real-time emotional information of the target user and real-time sleep information of the target user.

[0008] Another aspect of the present application is a mood and sleep regulation device based on a large language model, characterized in that it includes: an acquisition module for acquiring target user data, wherein the target user data is composed of multiple data sources; acquiring an initial large language model and a training sample set that match the physiological identification information of the target user; a processing module for processing the target user data to generate attribute information of the target user and physiological identification information of the target user, wherein the attribute information of the target user includes the mood information of the target user and the sleep information of the target user within a preset time period, and the physiological identification information of the target user is used to characterize that the attribute information of the target user is abnormal; processing the training sample set based on preset processing rules to generate a training set and a validation set; processing the training sample set based on the training sample set to generate a training set and a validation set; The training set and the verification set are used to process the initial large language model to generate a target large language model; the emotional information of the target user is processed based on the target large language model to generate first material information, wherein the first material information includes audio information and video information; the first material information is processed based on the sleep information of the target user to generate second material information, wherein the second material information includes audio information, video information and text information; the second material information is processed based on the target large language model to generate an adjustment factor, wherein the adjustment factor is used to adjust the emotional information of the target user and the sleep information of the target user; the adjustment factor is processed to generate real-time emotional information of the target user and real-time sleep information of the target user.

[0009] According to another aspect of the present application, an electronic device is characterized in that it includes: a first processor; and a memory for storing executable instructions of the first processor; wherein the first processor is configured to execute the above-mentioned emotion and sleep regulation method based on a large language model by executing the executable instructions.

[0010] According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a second processor, the above-mentioned emotion and sleep regulation method based on a large language model is implemented.

[0011] According to another aspect of the present application, a computer program product is provided, including a computer program, characterized in that when the computer program is executed by a third processor, the above-mentioned emotion and sleep regulation method based on the large language model is implemented.

[0012] The present application provides a method and related equipment for regulating emotions and sleep based on a large language model, in which a server uses big data and artificial intelligence technology to realize personalized management of user emotions and sleep status. First, user data is obtained from multiple data sources, and attribute information such as emotions, sleep patterns and physiological states is analyzed. Then, a suitable large language model and training samples are selected, and a target model capable of understanding user emotional information is formed through machine learning training. Adjustment factors are further generated to adjust the user's emotions and sleep information in real time, and cross-intervention is performed through multiple modal materials such as audio, video and text. Reinforcement learning algorithms are used to continuously optimize adjustment strategies based on user feedback to ensure the maximization of emotion and sleep regulation effects. In addition, positive and negative feedback mechanisms are used to improve user compliance, and the recommended content is dynamically adjusted by real-time monitoring of the user's physiological signals and behavioral data to achieve personalized and adaptive emotion and sleep management.

[0013] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A flowchart of a method for regulating emotions and sleep based on a large language model provided in one embodiment of the present application is shown;

[0015] Figure 2 A schematic diagram of the structure of a mood and sleep regulation device based on a large language model provided in one embodiment of the present application is shown;

[0016] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present application is shown;

[0017] Figure 4 A schematic diagram of a storage medium provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0018] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0019] Combine the following Figure 1 To describe the emotion and sleep regulation method based on a large language model according to an exemplary embodiment of the present application. It should be noted that the following application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited in this regard. On the contrary, the embodiments of the present application can be applied to any applicable scenario.

[0020] In one implementation, the present application also proposes a method for regulating emotions and sleep based on a large language model and related equipment. Figure 1 The flowchart of a method for regulating emotions and sleep based on a large language model according to an embodiment of the present application is schematically shown. Figure 1 As shown, the method is applied to a server, comprising:

[0021] S101, obtaining target user data.

[0022] In one embodiment, the target user data is composed of multiple data sources, including the integration of multimodal data, such as text, voice, physiological signals, user behavior data, etc. This data integration capability enables the system to fully understand the user's emotions and sleep status, and make more accurate adjustment decisions based on multidimensional data. Voice and text data can reflect the user's emotional state, physiological parameters (such as heart rate, skin conductance, etc.) can provide direct information about the user's physiological state, and user behavior data (such as activity patterns, application usage) can indirectly reflect the user's emotions and sleep status.

[0023] Through cross-modal data association analysis, we can discover potential connections between different data sources. For example, we can combine voice intonation with physiological data to more accurately judge the user's emotional fluctuations and improve the accuracy of regulation.

[0024] S102: Process the target user data to generate attribute information of the target user and physiological identification information of the target user.

[0025] In one implementation, feature extraction processing is performed on target user data to generate text features, voice features, physiological features, and behavioral features, the voice features and text features are processed to generate target user emotional information, the physiological features and behavioral features are processed to generate target user sleep information, and the target user emotional information and target user sleep information are processed to generate target user physiological identification information. The target user's attribute information includes the target user's emotional information and the target user's sleep information within a preset time period, and the target user's physiological identification information is used to characterize that the target user's attribute information is abnormal.

[0026] The collected target user data is preprocessed and feature extracted. Among them, speech analysis can infer emotional state by analyzing features such as intonation, speaking speed, and volume; text data can be analyzed for sentiment tendency through sentiment dictionaries or machine learning models; physiological parameter monitoring technology can extract physiological characteristics related to sleep and emotions; user behavior analysis can infer users' emotions and sleep states by analyzing their behavior patterns in the application.

[0027] Use machine learning or deep learning techniques to build sentiment analysis and sleep state prediction models. For example, use recurrent neural networks (RNN) or long short-term memory networks (LSTM) to capture temporal features in text data, and use deep learning models such as Transformer for sentiment analysis. Use labeled sentiment and sleep state datasets to train the model and optimize it based on the model performance. You can improve the accuracy and generalization of the model by adjusting model parameters and using pre-trained models.

[0028] Apply the trained model to real-time data streams to monitor the user's emotions and sleep status, and provide feedback or suggestions based on the model output. Perform a comprehensive analysis of emotional information and sleep information to identify whether there are abnormal patterns or trends. Use statistical methods or machine learning models to extract physiological marker features from emotional and sleep data to generate physiological marker information for the target user, which can characterize the abnormal state of the user's attribute information.

[0029] Integrate the entire analysis process into applications or services to provide users with personalized emotional support and sleep health management. For example, develop a sleep recording application that monitors the user's physiological parameters and behavioral data, provides sleep quality analysis and improvement suggestions, and can effectively generate user emotional information and sleep status information from multi-source data, and provide users with valuable feedback and suggestions.

[0030] S103, obtaining an initial large language model and a training sample set that match the physiological identification information of the target user.

[0031] In one implementation, first, clarify the type and function of the required large language model (LLM), as well as what features the training sample set needs to include, such as text features, speech features, physiological features, and behavioral features. Collect relevant data sets as needed. For emotional information, text data with emotion annotations may be needed; for sleep information, recorded data of physiological parameters and behavioral patterns may be needed. Perform feature extraction processing on the collected data. For speech data, features such as fundamental frequency, resonance peak, and Mel-frequency cepstral coefficients (MFCC) can be extracted; for text data, features related to the sentiment dictionary can be extracted; physiological and behavioral features may require specific sensor data and behavior logs, which are not limited in this application, and applicants can make choices based on actual needs.

[0032] Next, select a suitable initial large language model architecture. Consider using Transformer-based models because they excel at handling long-distance dependencies. Use the collected training sample set to pre-train the selected model architecture. Pre-training can be unsupervised or semi-supervised, with the goal of allowing the model to learn a common language representation. Based on pre-training, use specific physiological marker information and user attributes to fine-tune the model to adapt to specific application scenarios. Evaluate the performance of the model through methods such as cross-validation, and optimize the model to ensure its accuracy and generalization ability. Continuously iterate the model training and optimization process based on the model's performance and user feedback. This builds a large language model that can process and generate emotional information and sleep information for the target user, as well as a training sample set that matches it.

[0033] S104, processing the training sample set based on preset processing rules to generate a training set and a validation set.

[0034] In one embodiment, other user information matching the physiological identification information of the target user is obtained; feature extraction is performed on the other user information to generate a feature data set; any number of data features in the feature data set are obtained; adjacent features are generated based on the distance between any number of data features and other numbers of data features of the same category, wherein the adjacent features include a preset number of any number of data features; a sampling ratio is determined based on the number of each data feature in a training set; a sampling ratio is determined based on the sampling ratio; adjacent features are sampled based on the sampling ratio to generate a preset number of sampling features; multiple data groups are generated based on any data feature and each sampling feature, wherein each data group includes a preset number of data samples, wherein each data group includes a preset number of data samples, wherein at least one data sample includes physiological identification information; multiple data groups are processed to generate a training set and a validation set, wherein both the training set and the validation set include a number of data features.

[0035] Specifically, in data analysis and machine learning, the sampling ratio and sampling rate are determined based on the number of data features in the training set. By counting the number of each data feature in the training set, the distribution of different features can be understood. The sampling ratio is determined according to the number of data features and the size of the data set. The sampling ratio can help us decide how many samples to extract from each feature. According to the sampling ratio, the specific sampling ratio can be calculated. The sampling ratio is the ratio of the actual number of samples to the total number. The adjacent features are sampled using the sampling ratio to generate a preset number of sampling features. This process ensures the representativeness and diversity of the samples. Through the sampling process, a set of sampling features is generated, which will be used for subsequent data analysis and model training. Multiple data sets are constructed based on any data feature and each sampling feature. Each data set contains a preset number of data samples. It is ensured that the samples in each data set are diverse and contain at least one sample with identification information, which helps the model learn the feature performance in different situations. These data sets are used for model training to evaluate the contribution of different features to the prediction target. The machine learning model is trained using the sampling feature set, and the performance of the model is evaluated through the validation set. According to the results of model training and validation, the sampling ratio and rate may need to be adjusted to optimize the prediction ability of the model. With this approach, large-scale data sets can be processed efficiently while maintaining data quality and model generalization capabilities, helping to identify potential security risks and abnormal behaviors.

[0036] S105 , processing the initial large language model based on the training set and the validation set to generate a target large language model.

[0037] In one implementation, necessary preprocessing is performed on the training set and validation set, including text cleaning, word segmentation, serialization, etc., so that the model can learn better. The initial large language model is trained using the training set, and the model parameters are adjusted through the optimization algorithm so that it can learn the patterns and structures in the data. The performance of the model is evaluated on the validation set, and appropriate evaluation indicators such as accuracy and recall are used to ensure that the model has good generalization ability.

[0038] Fine-tune the model based on the evaluation results, which may include adjusting the model architecture, changing the learning rate, adding regularization and other strategies to improve the performance of the model on specific tasks. Model training is an iterative process that requires continuous optimization of the model based on evaluation feedback until the expected performance is achieved. When the model performs well on the validation set, it can be deployed in practical applications, such as healthy sleep monitoring and other scenarios.

[0039] S106: Process the emotion information of the target user based on the target large language model to generate first material information.

[0040] In one implementation, the first material information includes audio information and video information.

[0041] The target user's emotional information is processed based on the target large language model to generate an emotional tag, and the preset material library is processed based on the emotional tag to generate a first matching value, wherein the first matching value is used to characterize the material content that matches the emotional tag. The target large language model is used to analyze the target user's emotional information, which includes text, voice, behavior and physiological data. According to the analysis results of the large language model, the user's emotional state is assigned a corresponding emotional tag, such as happiness, sadness, anger, relaxation, etc.

[0042] Prepare a library of various materials. These materials should cover different emotional expressions and elements that trigger emotional reactions, such as music, pictures, video clips, and text. Based on the generated emotional tags, search and filter out materials that match the emotional tags in the material library. This step can be achieved through keyword search, tag filtering, or more complex content analysis methods. Evaluate and score the filtered materials to generate the first match value. This value reflects the degree of match between the material and the emotional tag, which can be a similarity-based score, association strength, or other relevance indicators.

[0043] The first matching value is processed to generate initial material information. The first matching value is used to characterize the material content that matches the emotional tag to ensure that the selected material can effectively reflect and correspond to the emotional state of the target user. The matched material is presented to the user and feedback is collected. Based on the user's feedback, the matching process is iteratively optimized to improve the fit between the material and the user's emotions. After multiple iterations, the final material content is selected. These contents are most in line with the user's emotional needs and preferences and can be used for further applications, such as emotional regulation, sleep assistance, etc.

[0044] The initial material information is processed to generate the first feedback value of the target user. The initial material information is processed based on the first feedback value of the target user to generate the first material information. The initial material selected according to the emotional label is presented to the target user. The user's feedback on the initial material is collected through questionnaires, real-time monitoring of the user's physiological response (such as heart rate, skin conductance, etc.), direct feedback on the user interface, etc. The feedback may include emotional response, degree of preference, improvement suggestions, etc. The collected feedback values ​​are analyzed to identify the user's specific needs and preferences. For example, the user may prefer a certain type of music or video style.

[0045] According to the first feedback value, the initial material is adjusted. This may include changing the material, adjusting the volume, modifying the content, changing the rhythm or style, etc. The adjusted material information constitutes the first material information, which is more in line with the user's personalized needs and feedback. According to the continuous feedback of the user, the material is continuously iterated and optimized until the final material information that meets the user's expectations is generated. The feedback of all users is integrated, and the material library and material matching algorithm are continuously optimized to improve the accuracy and personalization of future material recommendations. Ensure that the generated material information not only matches the user's emotional state, but also is personalized based on the user's feedback, to ensure that the generated material can effectively meet the target user's emotional and sleep needs, and provide a personalized sleep assistance experience.

[0046] In another implementation, the target large language model includes a calculation formula for obtaining the first matching value, and the calculation formula is: ;

[0047] Among them, y is the emotion label, s is the style label of the material, is the embedding representation of the sentiment label y, V is the parameter for style selection, is the temperature parameter, is a candidate audio or video style tag, Represents candidate emotional state labels The embedding representation of is a candidate emotional state label;

[0048] Suppose we have three material style labels, namely s1 (lyrical style), s2 (exciting style), s3 (soothing style), and the emotion label y is "happy". is the corresponding embedding representation, V=2, =1.

[0049] First, calculate the numerator: For each material style, calculate .

[0050] For s1: ;

[0051] For s2: ;

[0052] For s3: ;

[0053] Then calculate the denominator: ;

[0054] Final calculation: :

[0055]

[0056] This example shows that under this assumption, the formula calculates that the matching probability of each material style for the "happy" emotion label is equal. Of course, in actual applications, different embedding representations, parameter values, and more material styles will make the results more complex and diverse.

[0057] In another implementation, the target large language model includes a calculation formula for obtaining the first feedback value, and the calculation formula is: ;in, is the effect of audio intervention, is the effect of video intervention, is the fusion weight of the two modalities.

[0058] S107: Process the first material information based on the sleep information of the target user to generate second material information.

[0059] In one implementation, the second material information includes audio information, video information and text information.

[0060] The target user's sleep information is processed based on the target large language model to generate a sleep state label; the first material information is processed based on the sleep state label to generate a second matching value, wherein the second matching value is used to characterize the material content matching the sleep state label; the second matching value is processed to generate preset material information, wherein the preset material information is generated based on the first material information; the preset material information is processed to generate a second feedback value of the target user; the preset material information is processed based on the second feedback value of the target user to generate the second material information.

[0061] Specifically, the target large language model is used to analyze the physiological parameters and behavioral data of the target user, such as heart rate, breathing pattern, activity level, etc., to evaluate the user's sleep quality and state. According to the analysis results, a label is assigned to the user's sleep state, such as deep sleep, light sleep, REM sleep, wakefulness, etc. The first material information generated previously is used as a basis. These materials have been optimized according to the user's emotional feedback. The sleep state label is used to filter or adjust the material content that matches the current sleep state in the first material information. The filtered or adjusted material content is evaluated to generate a second matching value, which represents the degree of matching between the material and the user's current sleep state. According to the second matching value, the material content is further optimized to ensure that it can effectively promote the user's sleep. Based on the optimized material content, preset material information is generated, which is specially designed to promote the current sleep state of the target user. Ensure that the preset material information includes audio information, video information and text information to adapt to the preferences of different users and improve sleep quality. According to the personalized needs and feedback of the user, the preset material information is finally adjusted to ensure the best user experience. The preset material information is provided to the user, and a feedback loop mechanism is established to collect the user's actual response to the material and further improvement suggestions.

[0062] Using the collected feedback, we continuously iterate and optimize the accuracy of sleep state labels and the relevance and effectiveness of material information. After several rounds of iterations, we confirm the final preset material information, which can best meet the needs of target users in specific sleep states. We ensure that the generated material information not only matches the user's sleep state, but is also personalized to provide a more customized and effective sleep assistance experience.

[0063] In another implementation, the target large language model includes a calculation formula for obtaining the second matching value, and the calculation formula is:

[0064] Specifically, t is a sleep state label, which is used to identify different sleep states, such as deep sleep, light sleep, REM sleep, wakefulness, etc. s is a material style label, which is used to describe the style characteristics of the material (such as music, pictures, videos, texts, etc.). is the embedding representation of the sleep state label t, which is a way to mathematically represent the sleep state label so that it can be calculated and processed in the model. V is the style selection parameter, which is used to control the preference for different styles of materials when selecting materials based on sleep state labels. is a temperature parameter used to adjust the "smoothness" of the probability distribution output by the model. c is a constant parameter in the formula, and its specific function needs to be determined in combination with the specific application scenario of the model. In this embodiment, it is mainly used to adjust the sleep state.

[0065] Assume that we have three material style labels, namely s1 (soothing style), s2 (light style), and s3 (calm style), and the sleep state label t is "deep sleep". is the corresponding embedding representation, V=2, c=1. First calculate Value of: For the "deep sleep" state, assume =3 (the value here is only an example, the actual situation needs to be determined based on model training), then =2 +1=7. Then calculate the softmax value:

[0066] s1: =softmax(7), calculated by the softmax function (assuming that the calculation result of the softmax function is to convert the input value into a probability distribution, here assuming the result is 0.3. For s2: , Softmax(7), assuming the result is 0.3. For s3: softmax(7), assuming the result is 0.4 (the sum of the three results here is 1, which is consistent with the probability distribution). This example shows that under this assumption, the matching probability of each material style for the "deep sleep" sleep state label is calculated according to the formula. Different styles of materials may have different matching probabilities, which is used to provide a reference for selecting materials suitable for the "deep sleep" state. Please note that the values ​​in the above examples are all assumptions. In actual applications, the actual values ​​need to be determined based on specific model training and data.

[0067] In another implementation, the target large language model includes a calculation formula for obtaining the second feedback value, and the calculation formula is:

[0068] ;

[0069] in, is the effect of audio intervention, is the effect of video intervention, is the fusion weight of the two modalities.

[0070] S108: Process the second material information based on the target large language model to generate an adjustment factor.

[0071] In one embodiment, the second material information is processed based on the target large language model to generate the target user's estimated sleep information and the target user's estimated emotional information, the target user's sleep information within a preset time period is processed based on the target user's estimated sleep information to generate a first intervention value, and the target user's emotional information within a preset time period is processed based on the target user's estimated emotional information to generate a second intervention value. Specifically, the second material information, including audio, video, and text content, is analyzed using the target large language model to extract features that may affect the user's sleep and emotions, and the user's sleep state, such as possible time to fall asleep, sleep depth, sleep duration, etc., is estimated based on the features in the material information. Similarly, the potential impact of the material information on the user's emotions is analyzed to estimate the user's emotional state, such as relaxation, excitement, calmness, etc.

[0072] Using the estimated sleep information, the target user's sleep information in the preset time period is analyzed, and the user's sleep habits, physiological rhythms and other factors are considered. Based on the analysis results, a first intervention value is generated, which may be a recommendation for the best time to fall asleep, suggestions for adjusting the sleeping environment, or other intervention measures that help improve sleep. Using the estimated emotional information, the target user's emotional information in the preset time period is analyzed, and the user's daily stress, emotional fluctuations and other factors are considered. Based on the emotional analysis results, a second intervention value is generated, which may be suggestions for emotional regulation, guidance for relaxation training, or other intervention measures that help manage emotions.

[0073] Ensure that the generated first and second intervention values ​​meet the personalized needs of the target users, consider the user's living habits, preferences and health conditions, and convert the generated intervention values ​​into specific action plans, such as adjusting the sleeping environment, arranging relaxation activities, emotional expression training, etc. After implementing the intervention measures, continuously monitor the user's reactions and changes to evaluate the effectiveness of the intervention measures.

[0074] If the first intervention value is greater than the preset sleep intervention value or the second intervention value is greater than the preset emotion intervention value, an adjustment factor is generated, and the adjustment factor is used to adjust the target user's emotion information and the target user's sleep information. Determine the preset thresholds for sleep and emotion intervention, which are based on research, user historical data, or expert advice, and compare the first intervention value and the second intervention value with the preset sleep and emotion intervention thresholds. If the first intervention value is greater than the preset sleep intervention value, or the second intervention value is greater than the preset emotion intervention value, generate a corresponding adjustment factor based on the degree of excess, calculate the size and direction of the adjustment factor, and ensure that the adjusted sleep and emotion intervention values ​​return to within the preset thresholds.

[0075] Adjust the target user's emotional information using adjustment factors. This may involve changing the emotion regulation strategy, adjusting the content or duration of relaxation training, etc. Similarly, adjust the target user's sleep information using adjustment factors, which may include changing bedtime habits, adjusting the sleeping environment or sleep aids, etc.

[0076] According to the user's specific situation and preferences, develop a personalized adjustment plan and apply the adjustment plan to the user's daily life, such as reminding the user to relax before bed or adjust the sleeping environment through smart devices. After the adjustment is implemented, the user's sleep and emotional state are continuously monitored to evaluate the adjustment effect. According to the monitoring results and user feedback, the adjustment factors and adjustment plan are further optimized. Through continuous evaluation and adjustment, the user's sleep and emotional management are optimized to achieve the best health state. All adjustment processes and results are recorded, and data is analyzed to improve future intervention measures. Ensure that the user's sleep and emotional intervention remain within a reasonable range, and provide personalized adjustment plans to help users better manage their sleep and emotional health.

[0077] In another implementation, the target large language model includes a calculation formula for obtaining the first intervention value, and the calculation formula is:

[0078] ; Among them, the sleep state before intervention was , the sleep state after intervention was ;

[0079] In another implementation, the target large language model includes a calculation formula for obtaining the second intervention value, and the calculation formula is:

[0080] ; Among them, the emotional state before intervention was , the emotional state after intervention was .

[0081] S109: Process the adjustment factor to generate real-time emotion information and real-time sleep information of the target user.

[0082] In one implementation, the adjustment factors are processed to generate target material information. The adjustment factors are calculated based on the user's physiological marker information and behavioral characteristics, and are used to quantify the degree of deviation or specific needs of the user's emotions and sleep state. These factors reflect the user's specific needs for emotional regulation and sleep improvement. The second material library (including audio, video, text, etc.) is screened and adjusted using the adjustment factors to generate target material information that meets the user's current emotions and sleep needs. For example, if the user needs to relax to promote sleep, calming music or meditation guidance videos in the material library will be given priority. The screened materials are adjusted to better meet the user's personalized needs. Adjustments may include changing the volume, rhythm, brightness, contrast, or certain aspects of the content. The screened and adjusted materials are integrated into target material information, which directly corresponds to the user's emotions and sleep needs.

[0083] Present the target material information to the user and collect user feedback. User feedback will be used to further adjust the material to form a continuous improvement cycle. Considering the complexity of emotions and sleep states, it may be necessary to integrate multiple modal materials to achieve the best effect. For example, combining calming audio and video content with relaxing text guidance. Real-time monitoring of user reactions to the material and dynamically adjusting the material based on the user's emotional and physiological changes to ensure sustained effects. Ensure that the material information received by the user not only matches their current needs, but also becomes more accurate and personalized over time, thereby maximizing the effect of emotional and sleep intervention.

[0084] Based on real-time emotion and sleep information, the system automatically selects or generates new materials or interventions to achieve cross-intervention of emotion and sleep. For example, if the emotional impact value shows that the user is still anxious, the system may recommend more relaxation training or positive emotion guidance materials. Using reinforcement learning algorithms, the cross-intervention strategy is continuously optimized based on user feedback on interventions. Reinforcement learning enables the system to learn which interventions are more effective and adjust the content and timing of future interventions accordingly.

[0085] The interaction between emotions and sleep states is fully utilized, and real-time monitoring and adjustment are used to ensure the maximum intervention effect. For example, improving emotional state may help improve sleep quality, and vice versa. Through this continuous, two-way adjustment process, the user's sleep and emotional health are improved, and ultimately the overall health is improved. Through continuous monitoring, analysis, intervention and optimization, personalized management and improvement of the user's emotions and sleep states are achieved.

[0086] The target user is processed based on the target material information to generate sleep impact values ​​and emotional impact values. The sleep impact values ​​and emotional impact values ​​are processed to generate real-time emotional information and real-time sleep information of the target user. The filtered and adjusted target material information is presented to the user. These materials include audio, video, and text, etc., which are designed to meet the user's current emotional and sleep needs. The user's physiological and behavioral response data after exposure to the material is collected. Physiological data may include heart rate, skin conductance, breathing patterns, etc., while behavioral data may include user interaction, viewing or listening time, etc.

[0087] Analyze user data and evaluate the specific impact of the material on the user's emotions and sleep. Use statistical methods or machine learning models to generate sleep impact values ​​and emotion impact values, which quantify the extent to which the material changes the user's state. Conduct in-depth analysis of the sleep impact values ​​and emotion impact values ​​to identify user response patterns and preferences for the material, for example, analyze which types of material are more likely to cause a relaxation response or improve sleep quality in users. Combine the impact value and user feedback to generate real-time emotional information about the user, which reflects the changes in the user's emotional state after exposure to the material, such as the intensity, type, and stability of the emotion. Similarly, generate real-time sleep information about the user, including the assessment of sleep status (such as deep sleep, light sleep, REM sleep, etc.) and analysis of sleep structure.

[0088] Fusion of data from different modalities to provide more comprehensive analysis, for example, combining physiological monitoring data with user behavioral feedback to obtain more accurate assessment of mood and sleep status. Based on real-time mood and sleep information, further personalized adjustment of material content and presentation methods to better meet the dynamic needs of users.

[0089] Through the dual intervention system based on the large language model, audio, video, and text can be used to simultaneously regulate the user's emotions and sleep status. By identifying emotions and sleep status, selecting appropriate intervention content, integrating multimodal intervention effects, and using reinforcement learning for strategy optimization, cross-intervention of emotions and sleep is achieved, ultimately improving the user's overall health status. This two-way regulation mechanism makes full use of the interaction between emotions and sleep to ensure the maximum intervention effect.

[0090] In addition, positive feedback mechanisms (such as reward mechanisms) are used to encourage users to continue using the app, while negative feedback mechanisms are used to help users recognize adverse conditions and make adjustments. This two-way feedback mechanism effectively improves user compliance, making the long-term effects of the adjustment plan more significant. By monitoring the user's physiological signals, behavioral data, etc. in real time, when changes in emotions or sleep status are detected, the recommended content is adjusted immediately, and the adjustment is continuously optimized through reinforcement learning algorithms.

[0091] In another implementation, the target large language model includes a calculation formula for obtaining the sleep impact value, and the calculation formula is:

[0092] ;in, is the weight parameter, reflecting the target material information and current emotional state Relative impact on sleep status, Represents the final state after a certain sleep-related material affects the sleep state. Represents the starting state when some sleep-related material affects the sleep state.

[0093] Suppose we have a sleep aid audio material, we set Before playing the audio, the user's sleep start state It can be represented by a numerical value, such as 3 (the values ​​here are just examples, representing a certain degree of sleep quantification). After playing the audio for a period of time, the final state is obtained through monitoring and evaluation. (indicating an improvement in sleep quality), the target material information may include relevant information such as the audio rhythm and volume.

[0094] Then according to the formula , we can calculate the corresponding probability value (here we assume can get specific values ​​in some way, for example, , . This result can be used to evaluate the comprehensive probability of the material's impact on sleep status, thus providing a reference for subsequent material selection and adjustment. However, please note that all the values ​​and calculation processes here are based on example assumptions, and in actual applications, the corresponding values ​​need to be determined based on specific monitoring and evaluation methods.

[0095] In another implementation, the target large language model includes a calculation formula for obtaining the emotion impact value, and the calculation formula is:

[0096] ;

[0097] in, and is the weight parameter, reflecting the target material information and current sleep state Relative impact on emotional state, Represents the final state after some emotion-related material affects the emotional state. Represents the starting state when certain emotion-related material affects the emotional state.

[0098] In this application, the server obtains user data from multiple data sources, analyzes and obtains attribute information such as emotions, sleep patterns and physiological states, and then selects a suitable large language model and training samples, and forms a target model that can understand the user's emotional information through machine learning training. Adjustment factors are further generated to adjust the user's emotions and sleep information in real time, and cross-intervention is performed through multiple modal materials such as audio, video and text. Using reinforcement learning algorithms, the adjustment strategy is continuously optimized based on user feedback to ensure the maximization of emotion and sleep regulation effects. In addition, positive and negative feedback mechanisms are used to improve user compliance, and the recommended content is dynamically adjusted by real-time monitoring of the user's physiological signals and behavioral data to achieve personalized and adaptive emotion and sleep management.

[0099] In one embodiment, if Figure 2 As shown, the present application also provides a mood and sleep regulation device based on a large language model, comprising:

[0100] The acquisition module 201 is used to acquire target user data, wherein the target user data is composed of multiple data sources; acquire an initial large language model and a training sample set that match the physiological identification information of the target user;

[0101] The processing module 202 is used to process the target user data to generate attribute information of the target user and physiological identification information of the target user, wherein the attribute information of the target user includes the emotional information of the target user and the sleep information of the target user within a preset time period, and the physiological identification information of the target user is used to characterize that the attribute information of the target user is abnormal; the training sample set is processed based on a preset processing rule to generate a training set and a verification set; the initial large language model is processed based on the training set and the verification set to generate a target large language model; the emotional information of the target user is processed based on the target large language model to generate first material information, wherein the first material information includes audio information and video information; the first material information is processed based on the sleep information of the target user to generate second material information, wherein the second material information includes audio information, video information and text information; the second material information is processed based on the target large language model to generate an adjustment factor, wherein the adjustment factor is used to adjust the emotional information of the target user and the sleep information of the target user; the adjustment factor is processed to generate real-time emotional information of the target user and real-time sleep information of the target user.

[0102] The present application embodiment provides an electronic device, such as Figure 3As shown, the electronic device 3 includes a first processor 300, a memory 301, a bus 302 and a communication interface 303, wherein the first processor 300, the communication interface 303 and the memory 301 are connected via the bus 302; the memory 301 stores a computer program that can be run on the first processor 300, and when the first processor 300 runs the computer program, the emotion and sleep regulation method based on the large language model provided in any of the aforementioned embodiments of the present application is executed.

[0103] The memory 301 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 303 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.

[0104] The bus 302 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 301 is used to store a program, and the first processor 300 executes the program after receiving an execution instruction. The emotion and sleep regulation method based on a large language model disclosed in any implementation of the embodiment of the present application may be applied to the first processor 300, or implemented by the first processor 300.

[0105] The first processor 300 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the first processor 300. The above-mentioned first processor 300 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a readily available programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be embodied as a hardware decoding processor to execute, or a combination of hardware and software modules in the decoding processor to execute. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 301, and the first processor 300 reads the information in the memory 301 and completes the steps of the above method in combination with its hardware.

[0106] The electronic device provided in the above-mentioned embodiments of the present application and the emotion and sleep regulation method based on a large language model provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.

[0107] The present application embodiment provides a computer-readable storage medium, such as Figure 4 As shown, the computer-readable storage medium stores 401 a computer program, and when the computer program is read and executed by the second processor 402, the emotion and sleep regulation method based on the large language model as described above is implemented.

[0108] The technical solution of the embodiment of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling an electronic device (which may be an air conditioner, a refrigeration device, a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in the embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.

[0109] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the emotion and sleep regulation method based on a large language model provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.

[0110] An embodiment of the present application provides a computer program product, including a computer program, wherein the computer program is executed by a third processor to implement the method described above.

[0111] The computer program product provided by the above-mentioned embodiments of the present application and the emotion and sleep regulation method based on a large language model provided by the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.

[0112] It should be noted that, in this application, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or still includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0113] Each embodiment in the present application is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the evaluation of the emotion and sleep regulation method based on the large language model, the electronic device, the electronic device, and the readable storage medium embodiment, since they are basically similar to the emotion and sleep regulation method embodiment based on the large language model described above, the description is relatively simple, and the relevant parts can be referred to the partial description of the emotion and sleep regulation method embodiment based on the large language model described above.

[0114] Although the present application is disclosed as above, the present application is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the protection scope of the present application shall be subject to the scope defined by the claims.

Claims

1. A method for regulating emotions and sleep based on a large language model, characterized in that: include: Acquire target user data, wherein the target user data is composed of multiple data sources; Processing the target user data to generate attribute information of the target user and physiological identification information of the target user, wherein the attribute information of the target user includes emotional information of the target user and sleep information of the target user within a preset time period, and the physiological identification information of the target user is used to indicate that the attribute information of the target user is abnormal; Acquire an initial large language model and a training sample set that match the physiological identification information of the target user; Processing the training sample set based on preset processing rules to generate a training set and a validation set; Processing the initial large language model based on the training set and the validation set to generate a target large language model; Processing the target user's emotion information based on the target large language model to generate first material information, wherein the first material information includes audio information and video information; Processing the first material information based on the sleep information of the target user to generate second material information, wherein the second material information includes audio information, video information and text information; Processing the second material information based on the target large language model to generate an adjustment factor, wherein the adjustment factor is used to adjust the emotion information of the target user and the sleep information of the target user; The adjustment factor is processed to generate real-time emotion information of the target user and real-time sleep information of the target user.

2. The method according to claim 1, characterized in that The target user data is processed to generate attribute information of the target user and physiological identification information of the target user, including: Performing feature extraction processing on the target user data to generate text features, voice features, physiological features and behavioral features; Processing the voice features and text features to generate emotional information of the target user; Processing the physiological characteristics and the behavioral characteristics to generate sleep information of a target user; The emotional information of the target user and the sleep information of the target user are processed to generate physiological identification information of the target user.

3. The method according to claim 1, characterized in that The training sample set is processed based on a preset processing rule to generate a training set and a validation set, including: Acquire other user information that matches the physiological identification information of the target user; Extract features from other user information and generate feature data sets; Obtaining any number of data features in the feature data set; Generate adjacent features based on the distance between the any number of data features and other numbers of data features of the same category, wherein the adjacent features include a preset number of the any number of data features; Determining a sampling ratio based on the number of each data feature in the training set; Based on the sampling ratio, determining a sampling ratio; Sampling the adjacent features based on the sampling ratio to generate a preset number of sampling features; Based on any data feature and each sampling feature, generating a plurality of data groups, wherein each data group includes a preset number of data samples, and at least one data sample includes physiological identification information; The plurality of data sets are processed to generate a training set and a validation set, wherein the training set and the validation set both include a number of data features.

4. The method according to claim 2, characterized in that The emotional information of the target user is processed based on the target large language model to generate first material information, including: Processing the target user's emotion information based on the target large language model to generate an emotion label; Processing a preset material library based on the emotion tag to generate a first matching value, wherein the first matching value is used to represent the material content matching the emotion tag; Processing the first matching value to generate initial material information; Processing the initial material information to generate a first feedback value of a target user; Processing the initial material information based on the first feedback value of the target user to generate first material information; The target large language model includes a calculation formula for obtaining a first matching value, and the calculation formula is: ; Among them, y is the emotion label, s is the style label of the material, is the embedding representation of the sentiment label y, V is the parameter for style selection, τ is the temperature parameter, is a candidate audio or video style tag, Embedding representation representing the candidate emotional state label y', where y' is the candidate emotional state label; The target large language model includes a calculation formula for obtaining a first feedback value, and the calculation formula is: ; in, is the effect of audio intervention, is the effect of video intervention, and α and β are the fusion weights of the two modalities.

5. A mood and sleep regulation device based on a large language model, characterized in that: The device comprises: An acquisition module is used to acquire target user data, wherein the target user data is composed of multiple data sources; and to acquire an initial large language model and a training sample set that match the physiological identification information of the target user; A processing module is used to process the target user data to generate attribute information of the target user and physiological identification information of the target user, wherein the attribute information of the target user includes emotional information of the target user and sleep information of the target user within a preset time period, and the physiological identification information of the target user is used to characterize that the attribute information of the target user is abnormal; the training sample set is processed based on a preset processing rule to generate a training set and a verification set; the initial large language model is processed based on the training set and the verification set to generate a target large language model; the emotional information of the target user is processed based on the target large language model to generate first material information, wherein the first material information includes audio information and video information; the first material information is processed based on the sleep information of the target user to generate second material information, wherein the second material information includes audio information, video information and text information; the second material information is processed based on the target large language model to generate an adjustment factor, wherein the adjustment factor is used to adjust the emotional information of the target user and the sleep information of the target user; the adjustment factor is processed to generate real-time emotional information of the target user and real-time sleep information of the target user.

6. An electronic device, characterized in that: include: a first processor; and a memory for storing executable instructions of the first processor; The first processor is configured to execute the emotion and sleep regulation method based on a large language model as described in any one of claims 1 to 4 by executing the executable instructions.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the second processor, the emotion and sleep regulation method based on the large language model described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Sleep training method and system based on artificial intelligence

    CN113111952A

  • Sleep assisting method, medium and wearable device

    CN114366986A