Emotion guidance report generation method and system based on behavior data and interaction data

By combining multi-dimensional user behavior data with large language model interaction data, personalized emotion guidance reports are generated, which solves the problems of single data source and insufficient privacy protection in existing technologies. It achieves comprehensive emotion recognition and effective emotion guidance, and supports long-term tracking and analysis.

CN122290852APending Publication Date: 2026-06-26XIDIAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIDIAN UNIV
Filing Date
2026-03-25
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies mainly rely on subjective questionnaire data and single behavior recognition, which cannot comprehensively and accurately judge users' emotional problems. The generated reports lack specific suggestions and have problems such as insufficient data privacy protection and difficulty in tracking and evaluating the effect of emotional guidance.

Method used

By collecting multi-dimensional user behavior data and interaction data from a large language model, a comprehensive analysis is conducted to generate emotion assessment results. An access control mechanism is set up to protect privacy, and personalized emotion guidance suggestions are automatically generated, while continuously recording the user's emotional state.

Benefits of technology

It enables comprehensive and accurate identification and personalized guidance of user emotions, improves data security and the effectiveness of emotion guidance, supports long-term tracking and analysis, and provides continuous data support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122290852A_ABST
    Figure CN122290852A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for generating emotion guidance reports based on behavioral and interaction data. The method integrates multidimensional heterogeneous behavioral features with large-scale chat interaction data, utilizing a LoRA-tuned Qwen model for deep semantic analysis and cross-modal feature fusion to achieve accurate identification and anomaly quantification of psychological states. This invention constructs a multidimensional context-driven Prompt model to output structured JSON indicators and incorporates a permission management mechanism to ensure privacy and security. This invention overcomes the evaluation bias of single data sources, achieving a dynamic closed loop and personalized intervention for emotion guidance through continuous tracking of historical reports. This invention generates targeted psychological guidance reports based on the user's actual situation, improving the effectiveness of mental health management. It also continuously monitors user emotion change trends and provides data support.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of information processing technology, and more specifically relates to a method and system for generating emotion guidance reports based on the interaction between user behavior data and a large model, within the field of user behavior data processing technology. This invention integrates user behavior data with interaction information from a large model to provide accurate and effective emotion guidance reports for users' psychological problems. Background Technology

[0002] As society increasingly values ​​user mental health, timely and accurate identification of users' emotional issues and effective guidance have become crucial issues in mental health. For example, students' behavioral data during their school years (such as GPA, class absences, late-night internet usage, and physical fitness test data) can reflect their psychological state to some extent. Excessive class absences may indicate a student's aversion to learning or low mood, while frequent late-night internet use may reflect insomnia or anxiety. Meanwhile, the rapid development of artificial intelligence technology, especially the widespread application of large language models in human-computer interaction, provides new avenues for understanding users' inner thoughts and guiding their emotions. Against this backdrop, integrating user behavior data with large-scale model interaction information to generate accurate and effective emotional guidance reports has become a key direction for addressing users' emotional problems.

[0003] Chen Kezhen disclosed a management method based on AI to identify student behavior in her patent application, "A Management Method and System Based on AI to Recognize Student Behavior" (Application Date: 2021-08-02, Application No.: 202110883045.8, Publication No.: CN 113592685 A). This method includes: acquiring students' facial expressions and behavioral actions to identify the students in question; analyzing the acquired facial expressions and behavioral actions to determine the student's mood state; acquiring the student's academic performance and obtaining the student's personality traits by accessing psychological assessment data; analyzing the mood state, academic performance, and personality traits to derive a reasonable way to interact and communicate with the student; and pushing this reasonable approach to communication to the student's parents and teachers, providing them with reasonable suggestions for communicating and interacting with the student. A management system was also proposed to implement the above method, which has the advantage of being able to accurately grasp students' psychological states and improving communication between students, schools, and parents. However, this method still has shortcomings. It primarily identifies students' moods by collecting facial expressions and behavioral data, relying heavily on visual behavioral data and static psychological assessment results. This data source is relatively limited and cannot comprehensively reflect students' true states regarding academic pressure, changes in daily routines, and subjective emotional expression. Furthermore, this method lacks long-term, continuous monitoring of students' daily behavioral data, such as class attendance, changes in daily routines, and physical health status. Therefore, it remains limited in analyzing emotional change trends and providing early warnings of psychological risks. In addition, this method does not incorporate deep semantic analysis of natural language interaction data between students and the intelligent system, failing to further explore the specific types and causes of students' emotional problems through their proactive expressions. Consequently, it remains insufficient in the accuracy of emotional problem identification and the generation of subsequent personalized intervention suggestions.

[0004] Wenzhou Vocational and Technical College disclosed a method and system for testing the career personality of college graduates in its patent application, "A Method and System for Testing the Career Personality of College Graduates" (application date: 2024-10-11, application number: 202411417647.4, publication number: CN 118919005 A). By integrating big data analysis and graph neural networks, the method significantly improves the accuracy and scientific rigor of the test. It utilizes advanced data processing technology to conduct in-depth analysis of the psychological and career inclination data of college graduates. The collected data is encrypted using a polynomial-based homomorphic encryption algorithm to ensure data security during storage and transmission. This method allows processing of encrypted data without decryption, thereby reducing the risk of data leakage. Through real-time analysis and model prediction, subsequent test questions are dynamically adjusted based on the graduates' answers and behavioral characteristics. This personalized testing process better adapts to the characteristics of different graduates, improving the accuracy and effectiveness of the test. The dynamically adjusted questions can more accurately assess the graduates' personality traits and career inclinations. However, this method still has shortcomings. It primarily relies on questionnaire responses from graduates during career personality tests, resulting in a relatively singular data source and a lack of comprehensive utilization of students' actual behavioral data during their school years. This makes it difficult to fully reflect students' actual psychological state and behavioral characteristics. Furthermore, this method is mainly used for one-time career personality assessments and lacks the ability to continuously monitor and dynamically analyze students' daily behavioral data and emotional changes. In addition, while existing technologies utilize graph neural networks and homomorphic encryption to improve data analysis capabilities and security, they do not combine students' daily behavioral data with natural language interaction data for joint analysis. This prevents in-depth exploration of the root causes of emotional changes and psychological problems through the interaction between students and the intelligent system, thus limiting its ability to generate personalized psychological counseling suggestions. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of the existing technology by proposing a method and system for generating emotion guidance reports based on behavioral and interaction data, aiming to solve the following problems:

[0006] (1) Using only subjective questionnaire data ignores user behavior and makes it impossible to comprehensively and accurately judge user emotional issues, resulting in a large bias in the assessment of user emotional state in the generated report;

[0007] (2) The data collection process puts a lot of psychological pressure on users and there are insufficient privacy protection technologies;

[0008] (3) Most of the emotional counseling reports generated by existing technologies only contain simple emotional judgment results and lack specific and actionable targeted suggestions. They are not very helpful in guiding users' emotional counseling and cannot effectively help users alleviate emotional problems.

[0009] (4) The reports generated by existing technologies are mostly fragmented emotion judgments or simple suggestions. They do not form a complete reporting system that includes modules such as user emotion indicators, root cause analysis of problems, and targeted suggestions. This is not conducive to relevant parties fully understanding the user's emotional situation, nor is it convenient to follow up and evaluate the effect of user emotion management.

[0010] The technical approach to achieving the objectives of this invention is as follows: This invention employs a fusion analysis technique combining user behavior data and large-scale model interaction data. It collects multi-dimensional user behavior data, including consumption records, GPA, absences, late-night internet browsing records, and physical fitness test data. Simultaneously, it collects chat interaction data between users and a large language model, comprehensively analyzing users' daily behaviors, lifestyle habits, and emotional expressions. First, the collected behavior data is cleaned and standardized. Then, text processing technology is used to perform semantic analysis and sentiment recognition on the chat content, thereby identifying the types and severity of potential emotional problems the user may have. Based on this, a comprehensive scoring mapping is performed between the behavior data indicators and the chat sentiment analysis results to generate a user's emotional assessment result. This is then combined with the semantic understanding capabilities of the large-scale model to automatically generate an emotional guidance report. Furthermore, this invention establishes a permission management mechanism, ensuring that user behavior data and chat data are only accessible to the user and authorized supervisors, thus guaranteeing the privacy and security of user data. Because this invention employs an analytical approach that combines behavioral data with natural language interaction data, and utilizes a large-scale model for semantic understanding and emotion recognition, it overcomes the information deficiencies inherent in existing technologies that rely solely on questionnaires or single behavioral recognition methods. This allows for a more comprehensive and accurate reflection of the user's true psychological state and the generation of targeted emotional guidance suggestions. Furthermore, by continuously recording user behavioral data and historical report information, this invention enables long-term tracking and analysis of changes in the user's emotional state, thus providing continuous data support for mental health management.

[0011] To achieve the above objectives, the specific implementation steps of the emotion guidance report generation method of the present invention include the following:

[0012] Step 1: Set up a data access permission management mechanism;

[0013] Step 2: Collection and anonymization preprocessing of multidimensional heterogeneous data;

[0014] Step 3: Time series extraction of behavioral features and quantification of anomaly indicators;

[0015] Step 4: Fine-tuning and constructing a multi-dimensional context prompt based on a large language model;

[0016] Step 5: Sentiment index calculation and structured report rendering;

[0017] Step 6: Close the loop of report output and tracking based on access control.

[0018] Furthermore, the data access permission management mechanism refers to setting permission levels (right) based on the registrant's identity during account registration: right=0 for ordinary users, who are only allowed basic conversation functions; right=1 for the user themselves, who are authorized to generate and view personal visual reports; and right=2 for personnel with management qualifications, who are allowed to view the list of psychological reports of users within their permissions across different users. A request interceptor is configured in the Java backend service. When the backend receives a request, it verifies the right parameter in the request and filters out requests without the required permissions, thus dynamically controlling interface access permissions.

[0019] Furthermore, the steps for collecting and anonymizing the multidimensional heterogeneous data are as follows:

[0020] The first step is to collect multi-dimensional behavioral data: Deploy a MySQL database locally, configure and establish a connection in the data platform, and set the frequency of scheduled crawling tasks; use the data interface to batch crawl users' daily consumption records, GPA data, absence counts, late-night internet browsing timestamps, and physical fitness test data.

[0021] The second step is to collect interaction data: record the scores of the user's psychological state questionnaire into the database; simultaneously record the user's dialogue with the local large language model to obtain the user's raw behavioral data.

[0022] The third step is desensitization preprocessing: missing value imputation and outlier removal are performed on the original behavioral data to map the real identity identifier to anonymization.

[0023] Furthermore, the steps for extracting the time series of the behavioral features are as follows:

[0024] The first step, feature extraction: A sliding time window is used to calculate the variance of consumption frequency, resulting in the daily consumption frequency sequence within the window:

[0025] ;

[0026] Where t represents the date of consumption, w represents the length of the sliding window, and i x t-w+i This represents the number of transactions on day i.

[0027] The second step is to mark any deviation from the historical average exceeding a preset threshold as "abnormal consumption patterns":

[0028] ;

[0029] in, thresholdThis represents the preset consumption fluctuation threshold, when F abnormal When = 1, the large language model quantifies it as the feature label of "abnormal consumption patterns".

[0030] Furthermore, the steps for quantifying the abnormal indicators are as follows:

[0031] For GPA data and physical fitness test scores, the rate of change R is used for quantification to calculate the deviation of the current period from the historical mean:

[0032] ;

[0033] in, Indicates the rate of change of GPA. This represents the user's GPA data for the current period. Represents historical GPA data; sets the first preset threshold. 1 is -0.15, the second preset threshold. =-0.30; if, Quantified as "risk under pressure"; if, This is quantified as "high pressure and high risk";

[0034] For physical fitness test data, the rate of change R is used for quantification:

[0035] ;

[0036] Among them, R i V represents the rate of change in a user's physical fitness test data for the 50m, standing long jump, 800m / 1000m, and vital capacity. current V represents the user's current physical fitness test data. history This represents the user's physical fitness test data from the previous period, with the corresponding threshold being: ; ; ; ; For R BMI ,like If so, it is marked as an exception;

[0037] For the number of absences N absent Quantization is performed using the absolute threshold method:

[0038] ;

[0039] in, This represents the absence threshold within a set period. If N absent If the value is greater than K, it is mapped to an "attitude abnormality coefficient" based on the excess ratio; this coefficient increases linearly with the number of absences.

[0040] For late-night internet browsing data, calculate the network request density D of users during their core sleep period. night Define the historical average sleep onset time as T. avg If the current active time point is Shift > T avg + This is quantified as "rhythm disorder". Take 2 hours.

[0041] Furthermore, the fine-tuning based on the large language model refers to using LoRA lightweight fine-tuning technology to fine-tune the Qwen series large language models; the fine-tuning parameters use the default configuration, where the rank is set to 8 and the alpha is set to 16; a multi-turn dialogue corpus containing professional paradigms of psychological counseling and structured output examples is constructed, enabling the model to autonomously infer psychological states based on text semantics and behavioral indicators.

[0042] Furthermore, the construction of the multidimensional context Prompt refers to guiding the large language model to conduct a comprehensive evaluation based on the PHQ-9 evaluation results and user chat text, from five dimensions: health score, emotion data, factor index, health dimension, and suggestions; the Prompt limits the model output to JSON data with a specific structure to ensure that the data format returned to the front end is uniform and stable.

[0043] Furthermore, the steps for calculating the sentiment index and rendering the structured report are as follows:

[0044] The first step involves using a large language model to understand the semantics of chat texts and the questionnaire results, performing inference calculations, and generating core indicators such as health scores and emotion distribution according to preset rules.

[0045] The second step is to combine user behavior tags with dialogue context to map psychological characteristics into factor indices and quantitative scores for health dimensions.

[0046] The third step is structured data output: The model assembles the calculated numerical indicators, text analysis content, and guidance suggestions according to the preset key-value pair structure, and outputs standard JSON format string data for front-end rendering and display.

[0047] Furthermore, the steps of the report output and tracking closed loop based on access control are as follows:

[0048] The first step is report output: The system parses the JSON data output by the large language model and renders it into a visual chart to display to the user;

[0049] The second step is storage and looping: the generated full report data is serialized and stored in a list in the database as a reference for the next evaluation.

[0050] The system of the present invention includes the following modules:

[0051] The data acquisition module is used to periodically capture consumption records, GPA scores, number of absences, and late-night internet browsing timestamps through the data interface, and simultaneously acquire behavioral data such as users' psychological state questionnaire scores and dialogue text records.

[0052] The data preprocessing module is used to fill in missing values ​​and remove outliers from the collected behavioral data.

[0053] The large model interaction analysis module is used to construct a multi-dimensional context Prompt containing abnormal feature labels, psychological state questionnaire scores, dialogue text and historical report strings, and input it into a pre-fine-tuned large language model to perform semantic reasoning.

[0054] The emotion index calculation module uses the large language model to calculate the values ​​of emotion distribution data and factor index based on the indicator definition in the Prompt and the distribution of dialogue context. It also generates targeted guidance suggestions based on user behavior data and chat data.

[0055] The report generation module receives structured data output by the model and performs serialization processing. On the one hand, it stores historical report strings into a list in the database; on the other hand, it parses the string and renders it into a visual chart report for display.

[0056] Compared with the prior art, the present invention has the following advantages:

[0057] First, because this invention uses a fusion analysis technology of user behavior data and large-scale model chat data, it overcomes the problem of single data sources caused by relying solely on questionnaires or single behavior recognition methods in existing technologies. This allows the invention to comprehensively analyze users' living habits and emotional expressions, thereby improving the comprehensiveness of user emotion recognition and the accuracy of analysis results.

[0058] Secondly, because the present invention sets up a data access permission management mechanism, user behavior data and chat data are only open to the user and authorized supervisors, overcoming the data privacy leakage problem that may exist in the management of user psychological data in the prior art, thereby improving the security and privacy protection level in the process of using user data.

[0059] Third, because this invention utilizes a large language model to perform semantic understanding and sentiment analysis on user chat content and automatically generates personalized emotional guidance suggestions, it overcomes the shortcomings of existing technologies that are unable to provide targeted psychological intervention suggestions based on the specific circumstances of users. This enables the invention to generate targeted psychological guidance reports based on the actual situation of users, thereby improving the effectiveness of mental health management.

[0060] Fourth, because this invention continuously records user behavior data and historical emotion report information, it enables long-term tracking and analysis of user emotional states, overcoming the shortcomings of existing technologies where user psychological assessments are mostly phased or one-time analyses. This allows the invention to continuously monitor trends in user emotional changes, thereby providing long-term and stable data support for managers. Attached Figure Description

[0061] Figure 1 This is a flowchart of the method of the present invention;

[0062] Figure 2 This is a schematic diagram of the system framework of the present invention;

[0063] Figure 3 , 4 This is a diagram of the report interface of the present invention. Detailed Implementation

[0064] The present invention will now be further described with reference to the accompanying drawings and embodiments.

[0065] Reference Figure 1 and Figure 2 The implementation steps of generating an emotional guidance report for students based on behavioral data and interaction data in the embodiments of the present invention are further described.

[0066] Step 1: Collection and anonymization preprocessing of multidimensional heterogeneous data.

[0067] This step is completed in the data acquisition module, which aims to stream student behavior data and chat interaction data from the campus multi-source system and perform standardized cleaning while ensuring data privacy.

[0068] Step 1.1, Student Behavior Data Collection. A secure connection is established with the school's data platform via a scheduled system task to collect multi-dimensional behavioral data from 22,575 students during their time at school, at a preset period (monthly). This includes: cafeteria card transaction records, historical GPA scores and class absences from the academic affairs system, late-night internet access timestamps on the campus network, and national physical fitness test data from the sports management system. All data is streamed into the corresponding tables in the local MySQL database. The data is shown in the table below:

[0069]

[0070] Step 1.2, Chat Interaction Data Collection. The system front-end provides a web-based interactive interface to record multi-turn natural language psychological dialogues between students and a locally deployed large language model. Each dialogue has a unique dialogue ID, and data is stored according to these IDs. Data from the student's most recently completed PHQ-9 psychological state questionnaire is also recorded and synchronously stored in the tbl_history table of the database.

[0071] Step 1.3, Data Cleaning and De-identification. Missing and outlier values ​​are handled for the original behavioral data. For missing numerical data such as consumption records, zero-value filling is used; the first quartile Q1 and the third quartile Q3 of the numerical sequence are calculated, and values ​​falling on the boundaries are considered:

[0072] Extreme values ​​other than those specified are marked as dirty data and removed. Meanwhile, to protect student privacy, the system performs irreversible hash encryption (SHA-256 algorithm) before the data enters the analysis process, mapping real student IDs, names, and other identity identifiers to anonymous unique IDs (User IDs), ensuring that subsequent large language models perform inference only based on anonymous features.

[0073] Step 2: Time series extraction of behavioral features and quantification of anomaly indicators.

[0074] This step is completed in the data preprocessing module, aiming to transform isolated student behavior data into quantifiable emotional influencing factors, providing an objective basis for model judgment.

[0075] Step 2.1, Extraction of lifestyle patterns.

[0076] For cafeteria consumption data, a sliding time window (7 consecutive days) is used to calculate the variance of consumption frequency and amount. If the consumption frequency drops sharply or the amount deviates from the historical average by more than a preset threshold, it is marked as an "abnormal eating pattern". For online behavior, the activity frequency from 23:00 to 06:00 the next day is counted. When the frequency exceeds the normal threshold, an "irregular sleep schedule" abnormality flag is triggered.

[0077] Step 2.2, Quantification of academic stress characteristics.

[0078] The formula for calculating the rate of change between a student's current semester GPA and their historical semester GPA is as follows:

[0079] ;

[0080] in, Indicates the rate of change of GPA. This indicates the student's GPA for the current semester. Represents historical GPA. When R gpaWhen a significant negative value is displayed (i.e., a sharp decline in grades) or when the class attendance rate is lower than the preset 70% threshold, the system quantifies it as a "high risk of academic pressure" characteristic.

[0081] Step 3: Fine-tuning based on the large language model and construction of multi-dimensional context Prompt.

[0082] This step is completed in the large model interactive analysis module, aiming to integrate the objective quantitative features extracted in step 2 with long-term historical tracking data to construct Prompt data with a complete semantic structure, so as to drive the large model to generate standard evaluation.

[0083] Step 3.1: Fine-tuning the large-scale psychological counseling model.

[0084] Using Qwen2.5-7B as the base language model, and under the guidance of professional psychologists, a set of over a thousand multi-turn dialogue instructions for psychological counseling was constructed, in the following format:

[0085] {

[0086] "scenario": "Psychological counseling for students who fail their final exams",

[0087] "participants": {

[0088] "teacher": "Teacher Lin (facilitator / supporter)",

[0089] "student": "Light rain (feeling frustrated / anxious)"

[0090] },

[0091] "dialogue_flow": [

[0092] {

[0093] "round": 1,

[0094] "role": "teacher",

[0095] "content": "Seeing your results must have felt like falling into an ice cave, right? I can feel your frustration. Would you like to sit down and tell me what the first thought that popped into your mind right now is?"

[0096] "technique": "Empathy and Reflection"

[0097] "goal": "Build a sense of security and identify automatic thoughts"

[0098] },

[0099] {

[0100] "round": 2,

[0101] "role": "student",

[0102] "content": "My first thought was, 'I'm doomed.' I felt like a failure; I couldn't even pass such a basic course. My parents would definitely be very disappointed in me."

[0103] "state": "Catastrophic thinking"

[0104] },

[0105] {

[0106] "round": 3,

[0107] "role": "teacher",

[0108] "content": "So, in your perception, failing this subject is equivalent to the failure of your entire life and the collapse of your parents' entire understanding of you, right?"

[0109] "technique": "Facial Confrontation and Cognitive Clarification"

[0110] "goal": "To concretize vague fears and expose irrational logic."

[0111] },

[0112] {

[0113] "round": 4,

[0114] "role": "student",

[0115] "content": "...It might sound a bit exaggerated, but right now it really feels like the sky is falling."

[0116] "state": Signs of loosening

[0117] },

[0118] {

[0119] "round": 5,

[0120] "role": "teacher",

[0121] "content": "Let's try to break down the 'sky is falling' scenario. Besides this report card, what other parts of your life remain stable? For example, your social life, your other hobbies, or the exams you've passed before?"

[0122] "technique": "Decatastrophizing"

[0123] "goal": "Narrow down the scope of the problem and find a realistic basis for support."

[0124] },

[0125] {

[0126] "round": 6,

[0127] "role": "student",

[0128] "content": "I passed all the other courses, and I did quite well in the art club activities. But it's a fact that I failed this subject; I just didn't do well on the test."

[0129] "state": "Return to reality"

[0130] },

[0131] {

[0132] "round": 7,

[0133] "role": "teacher",

[0134] "content": "That's right, that's a fact. Let's analyze it like detectives: What happened during your review period? Was it a problem with your study methods, or did your state of mind during the exam affect you?"

[0135] "technique": "Objective Attribution"

[0136] "goal": "Shifting from 'personality assessment' to 'specific behavior analysis' of failure"

[0137] },

[0138] {

[0139] "round": 8,

[0140] "role": "student",

[0141] "content": "When I was reviewing, I always felt like I couldn't remember the knowledge points. The more anxious I became, the less I could concentrate, and in the end, my mind went completely blank during the exam."

[0142] "state": "Core problem identified"

[0143] },

[0144] {

[0145] "round": 9,

[0146] "role": "teacher",

[0147] "content": "It sounds like failing this course is more like a signal, reminding you that your previous anxiety management and study rhythm need adjustment. If you consider it a 'stress test report,' what do you think it's trying to tell you?"

[0148] "technique": "Cognitive Reframing"

[0149] "goal": "To imbue negative events with positive growth potential."

[0150] },

[0151] {

[0152] "round": 10,

[0153] "role": "student",

[0154] "content": "It's probably trying to tell me that I can't rely on rote memorization anymore. Teacher, I feel a little better now, although I'm still a little sad, but it seems like I know where to go next."

[0155] "state": "Gaining insight and the will to act"

[0156] }

[0157] ],

[0158] "closure": {

[0159] Summary: "Through 10 rounds of dialogue, students transitioned from initial self-doubt to objective analysis of the problem and developed preliminary coping strategies."

[0160] "next_step_advice": "Students are advised to develop a specific study plan for the make-up exam and to practice appropriate stress management."

[0161] }

[0162] }

[0163] The LoRA (Low-Rank Adaptation) method is used to fine-tune the model's parameters and inject cognitive reconstruction.

[0164] These psychological intervention techniques enable it to possess professional emotional guidance and semantic understanding capabilities.

[0165] Step 3.2, historical tracking information fusion.

[0166] In order to achieve long-term tracking and trend analysis of students' emotional states, the system retrieves and extracts the text of the student's most recent N historical emotional guidance reports from the tbl_record table in the database. In this embodiment of the invention, N=3 is used, and the reports are directly concatenated into the context of the current dialogue according to the chronological sequence, giving the model a "long-term memory" of the student's psychological evolution trajectory.

[0167] Step 3.3, generating a structured Prompt.

[0168] The system's backend logic assembles the "student behavior anomaly labels output in step 2," the "current PHQ-9 questionnaire and chat interaction history," and the "N historical reports assembled in step 3.2" into a structured Prompt using a natural language template, which is then fed into the fine-tuned large model. The Prompt format is as follows:

[0169] # Task

[0170] Based on the provided PHQ-9 assessment results and user chat text, please conduct a comprehensive evaluation of the user's psychological state. All analyses and scores must be output strictly according to the specified JSON format and must not contain any additional text.

[0171] # Scoring Criteria

[0172] You must rate the following five aspects, even if the content is insufficient, and provide an overall textual analysis:

[0173] 1. **Health Score:**

[0174] * **Fraction range:** Integers from 0 to 27.

[0175] * **Definition:** 0-9 (no or mild depression), 10-14 (moderate), 15-27 (moderate to severe).

[0176] * **Basis:** It must be directly equal to the user's total score on the questionnaire and define the user's level of depression.

[0177] 2. **Emotion Data:**

[0178] * **Fraction range:** Integers from 0 to 100.

[0179] * **Definition:** Emotional data is divided into positive emotions, negative emotions, and neutral emotions, with the sum of these three being 100.

[0180] * **Basis:** Based on the user's PHQ-9 assessment results and user text, the score distribution for each emotion is objectively presented.

[0181] 3. **Factor Index:**

[0182] * **Score range:** Integers from 0 to 100 (each item is scored independently).

[0183] * **Definition:** The factor index is divided into five categories: compulsive, depression, hostility, paranoia, and others (including anxiety, interpersonal relationships, fear index, somatization, and sleep quality). Each of these five factor indices has a score range of 0-100, with 10 indicating mild, 50 indicating moderate, and 80 indicating severe. Higher scores indicate a more significant factor.

[0184] * **Basis:** Based on the user's PHQ-9 assessment results and user text, objectively provide the score for each factor index.

[0185] 4. **Health Dimensions:**

[0186] * **Score range:** Integers from 0 to 100 (each item is scored independently).

[0187] * **Definition:** The health dimensions include four areas: interpersonal relationships, cognitive abilities, emotional management, and physical condition. Each of these four health dimensions has a score range of 0-100, where 10 indicates a low score and poor ability in that area, 50 indicates average, and 80 indicates good. Higher scores indicate better ability in that area.

[0188] * **Basis:** Based on the user's PHQ-9 assessment results and user text, objectively provide the user's score for each health dimension.

[0189] 5. Advice

[0190] * **Score range:** No scoring required.

[0191] * **Definition:** This refers to suggestions provided to users.

[0192] * **Basis:** Based on all the scores and analyses above, specific and actionable recommendations are provided. For example, if the `healthScore` indicates severe depression, the primary recommendation should be to seek professional help; if a health dimension score is low, targeted improvement methods should be provided.

[0193] # Text Analysis Requirements

[0194] * **Textual Analysis:** Based on the user's text, summarize the core reasons for your above scores in 3-5 objective and neutral sentences.

[0195] # Output Format

[0196] Please be sure to return only one complete JSON object, in the following format:

[0197] {

[0198] "timestamp": "Please enter the current ISO 8601 format time here",

[0199] "analysis": "Your text analysis content",

[0200] "healthScore":<your rating>, / / Must be directly equal to the user's total score from the questionnaire.

[0201] "emotionData": {

[0202] "positive": <your rating>,

[0203] "negative": <your rating>,

[0204] "neutral": <Your rating>

[0205] },

[0206] "factorIndex": {

[0207] "compulsive": <your rating>,

[0208] "depression": <your rating>,

[0209] "hostility": <your rating>,

[0210] "paranoia": <your rating>,

[0211] "others": <Your rating>

[0212] },

[0213] "healthDimensions": {

[0214] "interpersonal": <your rating>,

[0215] "cognitive": <your rating>,

[0216] "emotional": <your rating>,

[0217] "physical": <your rating>

[0218] },

[0219] "advice": "Suggestion: <your suggestion>",

[0220] }

[0221] # The user survey results are as follows

[0222] # The user's thought-provoking dialogue record is as follows

[0223] Prompt forces the model to output strictly quantified JSON data.

[0224] Step 4: Calculation of sentiment indicators and rendering of structured reports.

[0225] This step is completed in the mood index calculation and report generation module.

[0226] Step 4.1, Calculate cross-modal sentiment indicators.

[0227] During the inference process, the large language model uses its inherent attention mechanism to logically associate and weight objective deviations at the behavioral level (such as staying up all night or declining grades) with subjective expressions at the text interaction level (such as the frequency of negative words in the dialogue), and finally outputs structured data in JSON format. This data package covers multi-dimensional indicators from emotion factors to comprehensive health scores.

[0228] Step 4.2, Model output parsing.

[0229] The backend service parses the JSON string returned by the large model. In this embodiment, the standard data structure of the output is as follows:

[0230] JSON

[0231] {

[0232] "user_id": "U123456789",

[0233] "conversationId": 1001,

[0234] "healthScore": 12,

[0235] "emotionData": {

[0236] "positive": 60,

[0237] "negative": 10,

[0238] "neutral": 30

[0239] },

[0240] "factorIndex": {

[0241] "compulsive": 20,

[0242] "depression": 15,

[0243] "hostility": 5,

[0244] "paranoia": 10,

[0245] "others": 50

[0246] },

[0247] "healthDimensions": {

[0248] "interpersonal": 80,

[0249] "cognitive": 90,

[0250] "emotional": 75,

[0251] "physical": 85

[0252] },

[0253] "Advice": "1. Given the PHQ-9 score indicating moderate depression and the presence of self-harming thoughts, it is strongly recommended to seek evaluation and intervention from a professional psychologist or psychiatrist as soon as possible. 2. Regarding job-hunting pressure, try viewing interviews as practice opportunities rather than a 'battle you must win.' Record 1-2 small positive things about yourself each day to break free from a completely negative mindset. 3. Insomnia should be taken seriously. It is recommended to establish a regular sleep schedule, stay away from electronic devices for one hour before bed, and try mindful breathing relaxation. 4. Continue to regulate emotions through healthy methods such as watching comedy movies, but avoid bearing stress alone. You can confide in trusted friends or family members to some extent."

[0254] "timestamp": "2026-03-19T09:36:00"

[0255] }

[0256] Among them, the lower the overall mental health score (healthScore), the healthier the mental state; the factorIndex clearly breaks down the severity of emotional factors such as depression and paranoia.

[0257] Step 5: Closed loop of report output and tracking based on access control.

[0258] Step 5.1, Dynamic permission verification.

[0259] A strict request access control mechanism is set up in the Java backend, which intercepts or allows requests based on the right field associated with the requester's account. If right=0 (ordinary users), the system only allows basic dialogue functions and blocks the entry point for report generation and viewing; if right=1 (the student), the system authorizes the current session to generate an emotional guidance report based on the student's behavior data, and the report front end only displays the parsed visualization charts and suggestions; if right=2 (teachers with management qualifications), the system grants advanced permissions, allowing the teacher to view the list of psychological dynamic reports of all students within their user area of ​​responsibility for timely intervention.

[0260] Step 5.2, report storage and system closure.

[0261] The output of the large model is returned to the front end for rendering, and finally presented. Figure 3 , Figure 4The report interface is shown below. Once the report is rendered, the system will include the aforementioned JSON metrics, along with detailed analysis of the causes generated by the large model, psychological guidance text, and other full data. This data will be serialized and archived in the local MySQL table `tbl_record`. This record not only serves as a fixed record of the current emotional state but also as historical evidence to be retrieved the next time the system executes "Step 3.2," thus forming a complete intelligent monitoring closed-loop system encompassing "data collection - intervention and guidance - long-term tracking and recording - feedback and reassessment."

Claims

1. A method for generating emotion guidance reports based on behavioral and interaction data, characterized in that, The steps of this method include the following: Step 1: Set up a data access permission management mechanism; Step 2: Collection and anonymization preprocessing of multidimensional heterogeneous data; Step 3: Time series extraction of behavioral features and quantification of anomaly indicators; Step 4: Fine-tuning and constructing a multi-dimensional context prompt based on a large language model; Step 5: Sentiment index calculation and structured report rendering; Step 6: Close the loop of report output and tracking based on access control.

2. The method for generating an emotion management report according to claim 1, characterized in that, The data access permission management mechanism described in Step 1 refers to setting permission levels (right) based on the registrant's identity during account registration: right=0 for ordinary users, who are only allowed basic conversation functions; right=1 for the user themselves, who are authorized to generate and view personal visualization reports; and right=2 for users with management qualifications, who are allowed to view the list of psychological reports of users within their permissions across different users. A request interceptor is configured in the Java backend service. When the backend receives a request, it verifies the right parameter in the request and filters out requests without the required permissions, thus dynamically controlling interface access permissions.

3. The method for generating an emotion management report according to claim 1, characterized in that, The steps for collecting and anonymizing the multidimensional heterogeneous data in step 2 are as follows: The first step is to collect multi-dimensional behavioral data: Deploy a MySQL database locally, configure and establish a connection in the data platform, and set the frequency of scheduled crawling tasks; use the data interface to batch crawl users' daily consumption records, GPA data, absence counts, late-night internet browsing timestamps, and physical fitness test data. The second step is to collect interaction data: record the scores of the user's psychological state questionnaire into the database; simultaneously record the user's dialogue with the local large language model to obtain the user's raw behavioral data. The third step is desensitization preprocessing: missing value imputation and outlier removal are performed on the original behavioral data to map the real identity identifier to anonymization.

4. The method for generating an emotion management report according to claim 1, characterized in that, The steps for extracting the time series of behavioral features in step 3 are as follows: The first step, feature extraction: A sliding time window is used to calculate the variance of consumption frequency, resulting in the daily consumption frequency sequence within the window: ; Where t represents the date of consumption, w represents the length of the sliding window, and i x t-w+i This represents the number of purchases on day i. The second step is to mark "abnormal consumption patterns" when the deviation from the historical average exceeds a preset threshold: ; in, threshold This represents the preset consumption fluctuation threshold, when F abnormal When = 1, the large language model quantifies it as the feature label of "abnormal consumption patterns".

5. The method for generating an emotion management report according to claim 1, characterized in that, The quantification of abnormal indicators mentioned in step 3 is specifically reflected in: For GPA data and physical fitness test scores, the rate of change R is used for quantification to calculate the deviation of the current period from the historical mean: ; in, Indicates the rate of change of GPA. This represents the user's GPA data for the current period. Represents historical GPA data; sets the first preset threshold. 1 is -0.15, the second preset threshold. =-0.30; if, Quantified as "risk under pressure"; if, This is quantified as "high pressure and high risk"; For physical fitness test data, the rate of change R is used for quantification: ; Among them, R i V represents the rate of change in a user's physical fitness test data for the 50m, standing long jump, 800m / 1000m, and vital capacity. current V represents the user's current physical fitness test data. history This represents the user's physical fitness test data from the previous period, with the corresponding threshold being: ; ; ; ; For R BMI ,like If so, it is marked as an exception; For the number of absences N absent Quantization is performed using the absolute threshold method: ; in, This represents the absence threshold within a set period. If N absent If the value is greater than K, then it is mapped to an "attitude abnormality coefficient" based on the excess ratio; this coefficient increases linearly with the number of absences. For late-night internet browsing data, calculate the network request density D of users during their core sleep period. night Define the historical average sleep onset time as T. avg If the current active time point is Shift > T avg + This is quantified as "rhythm disorder." Take 2 hours.

6. The method for generating an emotion management report according to claim 1, characterized in that, The fine-tuning based on the large language model mentioned in step 4 refers to using LoRA lightweight fine-tuning technology to fine-tune the Qwen series large language models; the fine-tuning parameters use the default configuration, where the rank is set to 8 and the alpha is set to 16; a multi-turn dialogue corpus containing professional paradigms of psychological counseling and structured output examples is constructed to enable the model to autonomously infer psychological states based on text semantics and behavioral indicators.

7. The method for generating an emotion management report according to claim 1, characterized in that, The construction of the multidimensional context Prompt in step 4 refers to guiding the large language model to conduct a comprehensive evaluation based on the PHQ-9 evaluation results and user chat text, from five dimensions: health score, sentiment data, factor index, health dimension, and suggestions. The Prompt limits the model output to JSON data with a specific structure to ensure that the data format returned to the front end is uniform and stable.

8. The method for generating an emotion management report according to claim 1, characterized in that, The steps for calculating sentiment indicators and rendering structured reports described in step 5 are as follows: The first step involves using a large language model to understand the semantics of chat texts and the questionnaire results, performing inference calculations, and generating core indicators such as health scores and emotion distribution according to preset rules. The second step is to combine user behavior tags with dialogue context to map psychological characteristics into factor indices and quantitative scores for health dimensions. The third step is structured data output: The model assembles the calculated numerical indicators, text analysis content, and guidance suggestions according to the preset key-value pair structure, and outputs standard JSON format string data for front-end rendering and display.

9. The method for generating an emotion management report according to claim 1, characterized in that, The tracking loop described in step 6 is specifically implemented as follows: The first step is report output: The system parses the JSON data output by the large language model and renders it into a visual chart to display to the user; The second step is storage and looping: the generated full report data is serialized and stored in a list in the database as a reference for the next evaluation.

10. A system for generating emotion guidance reports based on behavioral and interaction data, characterized in that, A method for generating an emotion management report according to any one of claims 1 to 9 includes the following modules: The data acquisition module is used to periodically capture consumption records, GPA scores, number of absences, and late-night internet browsing timestamps through the data interface, and simultaneously acquire behavioral data such as users' psychological state questionnaire scores and dialogue text records. The data preprocessing module is used to fill in missing values ​​and remove outliers from the collected behavioral data. The large model interaction analysis module is used to construct a multi-dimensional context Prompt containing abnormal feature labels, psychological state questionnaire scores, dialogue text and historical report strings, and input it into a pre-fine-tuned large language model to perform semantic reasoning. The emotion index calculation module uses the large language model to calculate the values ​​of emotion distribution data and factor index based on the indicator definition in the Prompt and the distribution of dialogue context. It also generates targeted guidance suggestions based on user behavior data and chat data. The report generation module receives structured data output by the model and performs serialization processing. On the one hand, it stores historical report strings into a list in the database; on the other hand, it parses the string and renders it into a visual chart report for display.