Multi-level user portrait management method and system based on large language model, electronic device and computer readable storage medium

CN122985990APending Publication Date: 2026-10-27周克强
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611176079.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0004]本申请提出了一种基于大语言模型的多层级用户画像管理方法,旨在解决现有对话记忆画像难以适配用户个性化特征且缺少分层管理机制,难以平衡信息完整性与推理资源消耗的技术问题

Benefits of technology

通过大语言模型生成非结构化自然语言文本的一级画像并进行多级压缩,能够适配不同用户的个性化维度,兼顾信息完整性与资源约束。通过识别变更信息类型并匹配差异化的更新方式,替代了传统关键词匹配模式,使画像更新具备语义理解能力。通过自然语言时态标记融合新旧信息,在更新画像的同时保留历史上下文,避免历史细节丢失。通过依据更新后的一级画像重新压缩多级画像,确保各层级画像内容一致,使常驻注入的三级画像始终反映用户最新状态。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122985990A_ABST
    Figure CN122985990A_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a multi-level user portrait management method and system based on a large language model, an electronic device and a computer readable storage medium. According to the scheme, the large language model generates a first-level user portrait of an unstructured natural language text based on initial dialogue data and compresses the first-level user portrait into multi-level lightweight portraits. The first-level portrait and new dialogue data are input into the large language model to identify the information type of the changed information, the corresponding portrait update mode is matched to update the first-level portrait, and the multi-level lightweight portrait is compressed again according to the updated first-level portrait. In this way, the dynamic update and multi-level compression of the portrait can be realized while the user history context is completely retained, and the richness of personalized expression and the rationality of resource consumption are considered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a multi-level user profile management method, system, electronic device, and computer-readable storage medium based on a large language model. Background Technology

[0002] With the continuous improvement of large language model capabilities, AI agents have been widely used in many long-term interaction scenarios. In these scenarios, the memory system is a core component for maintaining the coherence of AI-user interaction and establishing deep understanding and emotional connection. Its core requirement is to enable AI to continuously accumulate knowledge of users as interaction deepens, thereby achieving personalized services.

[0003] Existing dialogue memory systems mostly use fixed structured fields to carry user profiles, relying on keyword extraction and preset rules to update information. This type of solution pre-defines uniform user attribute fields, extracts information from dialogue content through keyword matching and fills the corresponding fields, and updates the field content according to preset rules when new interaction information is identified. However, this approach has several limitations: the fixed field framework is difficult to adapt to the differentiated cognitive dimensions of different users; the reliance on keyword matching makes it difficult to fully understand the deep semantic changes contained in the dialogue and to properly distinguish different types of user information changes; at the same time, it lacks a hierarchical information management mechanism adapted to different usage needs, making it difficult to achieve a balance between completely retaining user cognitive information and controlling inference resource overhead. Summary of the Invention

[0004] This application proposes a multi-level user profile management method based on a large language model, aiming to solve the technical problems that existing dialogue memory profiles are difficult to adapt to users' personalized characteristics and lack a hierarchical management mechanism, making it difficult to balance information integrity and reasoning resource consumption.

[0005] This application provides a multi-level user profile management method based on a large language model, the method including: The user's initial dialogue data is obtained and input into a large language model to generate a first-level user profile in the form of unstructured natural language text. The first-level user profile is then compressed to obtain a multi-level lightweight user profile. Input the primary user profile and the user's new dialogue data into the large language model to identify the information type corresponding to the change information in the new dialogue data relative to the primary user profile; Based on the information type matching corresponding to the profile update method, different information types correspond to different profile update methods. The profile update method includes at least temporal fusion update, which is: fusing the original historical description and change information of the first-level user profile through natural language temporal tags. The first-level user profile is updated according to the profile update method and the newly added dialogue data to obtain the updated first-level user profile. Based on the updated primary user profile, the multi-level lightweight user profile is recompressed to obtain the updated multi-level lightweight user profile.

[0006] Accordingly, this application also provides a multi-level user profile management system based on a large language model, the system comprising: The raw dialogue storage module is used to collect dialogue data between users and the dialogue system in real time, vectorize the dialogue data, and persistently store the generated semantic vectors in the vector database. The multi-level user profile generation module is used to obtain the user's initial dialogue data and input it into a large language model to generate a first-level user profile in the form of unstructured natural language text. The first-level user profile is then compressed to obtain a multi-level lightweight user profile. The AI ​​autonomous iterative update module is used to input the first-level user profile and the new dialogue data into the big language model after the user generates new dialogue data. The big language model identifies the information type corresponding to the changed information and matches the corresponding profile update method according to the information type to update the first-level user profile. Then, it recompresses and generates lightweight user profiles at all levels based on the updated first-level user profile. The historical information temporal fusion module is used to retain historical information before the change in the profile text through temporal markers in natural language when updating the first-level user profile; The intelligent hierarchical recall module is used to determine the corresponding level of profile information from the multi-level lightweight user profile and inject it into the current dialogue context based on the current dialogue scenario type during the dialogue interaction phase.

[0007] Accordingly, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the program to implement the above-described multi-level user profile management method based on a large language model.

[0008] Accordingly, this application also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute the above-described multi-level user profile management method based on a large language model.

[0009] This application obtains users' initial dialogue data and inputs it into a large language model to generate a first-level user profile in unstructured natural language text form. The first-level user profile is then compressed to obtain a multi-level lightweight user profile. The first-level user profile and the user's new dialogue data are input into the large language model to identify the information types corresponding to the changes in the new dialogue data relative to the first-level user profile. Based on the information types, the corresponding profile update method is matched. The first-level user profile is updated according to the profile update method and the new dialogue data to obtain an updated first-level user profile. Based on the updated first-level user profile, the multi-level lightweight user profile is recompressed to obtain an updated multi-level lightweight user profile. This achieves the following beneficial effects: By generating a first-level profile of unstructured natural language text using a large language model and performing multi-level compression, it can adapt to the personalized dimensions of different users while balancing information integrity and resource constraints. By identifying changed information types and matching differentiated update methods, it replaces the traditional keyword matching mode, enabling profile updates to have semantic understanding capabilities. By fusing new and old information through natural language temporal tagging, it preserves historical context while updating the profile, avoiding the loss of historical details. By recompressing multi-level profiles based on the updated first-level profile, it ensures consistency of content across all levels, ensuring that the permanently injected third-level profile always reflects the user's latest status. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] in: Figure 1 This is a schematic diagram of a multi-level user profile management system based on a large language model, provided as an embodiment of this application.

[0012] Figure 2 This is a flowchart illustrating a multi-level user profile management method based on a large language model, provided as an embodiment of this application.

[0013] Figure 3 This is a schematic diagram of the process for initializing a multi-level image provided in an embodiment of this application.

[0014] Figure 4 This is a flowchart illustrating the intelligent hierarchical recall strategy provided in an embodiment of this application.

[0015] Figure 5 This is a schematic diagram of the incremental iterative update process provided in an embodiment of this application.

[0016] Figure 6 This is a structural block diagram of a multi-level user profile management device based on a large language model, provided in an embodiment of this application.

[0017] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0019] This application provides a method, apparatus, computer-readable storage medium, and electronic device for multi-level user profile management based on a large language model. Specifically, the multi-level user profile management method based on a large language model can be executed by an electronic device, which can be a terminal or a server. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, and big data and artificial intelligence platforms.

[0020] Based on the above problems, embodiments of this application provide a multi-level user profile management method, system, electronic device, and computer-readable storage medium based on a large language model, which can realize dynamic updates and multi-level compression of profiles while fully preserving the user's historical context, taking into account both the richness of personalized expression and the rationality of resource consumption.

[0021] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0022] This application provides a multi-level user profile management system based on a large language model. For example, please refer to... Figure 1 , Figure 1 This diagram illustrates a multi-level user profile management system based on a large language model, provided as an embodiment of this application. The system is suitable for AI agents to continuously recognize and manage users' memories in long-term interaction scenarios. The system includes an original dialogue storage module, a multi-level profile generation module, an AI autonomous iterative update module, a historical information temporal fusion module, and an intelligent hierarchical recall module. The functions of each module are as follows: The raw dialogue storage module is used to collect complete dialogue data (including text content, timestamps, and session identifiers) between the user and the dialogue system in real time. It performs sentence segmentation, noise reduction, and standardization through the built-in text preprocessing unit, and then the vectorization encoding unit inputs the pre-trained text embedding model to generate semantic vectors, which are persistently stored in the vector database as the underlying fact data source of the system.

[0023] The multi-level user profile generation module is triggered at the end of the user's first interaction day. It acquires the initial dialogue data and sends it along with preset profile generation instructions to the large language model, outputting 2000-3000 words of coherent paragraph-style natural language text as the first-level user profile. Subsequently, the first-level profile is used as the first compression input, and the first compression instruction is sent to the large language model to obtain a second-level lightweight profile of 800-1000 words. Then, the second-level profile is used as the second compression input, and the second compression instruction is sent to obtain a third-level lightweight profile of 200-300 words. All profiles at each level are in unstructured natural language text format.

[0024] The AI-driven autonomous iterative update module is triggered after each new user conversation ends. It acquires the complete conversation history for the day as new conversation data, along with the current version of the primary profile and preset update instructions, and inputs it into the large language model. The large language model performs semantic comparison, identifies changes, and categorizes them into one of the following types: permanent change, detail supplementation, judgment correction, temporary state, or no new information. It then matches the corresponding profile update method to update the primary profile and calls the multi-level profile generation module to recompress and generate lightweight profiles at each level based on the updated primary profile.

[0025] The historical information temporal fusion module works in collaboration with the AI ​​autonomous iterative update module. When the information type is a permanent change type, it uses tense words (such as "before", "now", "once") to merge the historical information before the change with the current information after the change into the same narrative paragraph, thus preserving and integrating historical details.

[0026] The intelligent hierarchical recall module determines the corresponding level of profile information to inject into the context based on the current dialogue scenario during the dialogue interaction phase. The module has a built-in scenario judge. If it is a casual chat scenario, the level 3 profile is injected as a resident system prompt word; if it is a historical recall scenario, relevant paragraphs are extracted from the level 1 profile and injected together with the level 3 profile; if it is an important scenario, the entire content of the level 1 profile is injected, and semantically similar historical dialogue fragments are recalled from the vector database and injected together with the current input as the search condition.

[0027] The above modules work together to form a complete closed loop of "storage-generation-update-fusion-recall".

[0028] For further details, please refer to Figure 2 , Figure 2 This is a flowchart illustrating a multi-level user profile management method based on a large language model, provided as an embodiment of this application. The specific flow of this multi-level user profile management method based on a large language model can be as follows: 101. Obtain the user's initial dialogue data and input it into the large language model to generate a first-level user profile in the form of unstructured natural language text. Compress the first-level user profile to obtain a multi-level lightweight user profile.

[0029] Initial dialogue data refers to all dialogue records collected by the system after a user's first interaction with it. A dialogue system is a computer system capable of interacting with users using natural language, implemented based on a large language model, such as an AI agent, intelligent customer service, or virtual assistant. A large language model refers to a deep learning model pre-trained on a large corpus and possessing the ability to understand and generate natural language.

[0030] In some embodiments, the step "acquiring the user's initial dialogue data and inputting it into a large language model to generate a first-level user profile in the form of unstructured natural language text, and compressing the first-level user profile to obtain a multi-level lightweight user profile" may include the following operations: After the user's first conversation ends, a profile initialization task is triggered to obtain the conversation data of the first conversation and obtain the initial conversation data. Input the initial dialogue data and the preset profile generation instructions into the big language model. The big language model outputs coherent paragraph-style natural language text based on semantic understanding, which serves as the first-level user profile. The first-level user profile is used as the first compression input, and the first compression instruction is sent to the large language model to obtain the second-level lightweight user profile. The second-level user profile is used as the second compression input, and the second compression instruction is sent to the large language model to obtain the third-level lightweight user profile. The third-level lightweight user profile retains only the core features of the user.

[0031] After the user's first day of conversation ends, if the day is detected as the first day of interaction, the profile initialization task is automatically triggered to obtain the complete conversation record of that day as the initial conversation data.

[0032] The initial dialogue data, along with the preset profile generation instructions, are sent to the large language model. The profile generation instructions are a natural language prompt used to constrain the output format and content dimensions. In one specific embodiment of this application, the profile generation instructions can be expressed as: "You are an observer skilled at character portrayal. Please read the following complete dialogue record and try to replicate this user's complete profile. Use a coherent natural language text of 2000-3000 words to objectively describe this person... Do not use JSON format, do not use lists, use coherent paragraph text." The large language model analyzes and infers from the dialogue content based on semantic understanding capabilities, outputting a coherent paragraph-style natural language text of 2000-3000 words as the primary user profile. This primary profile uses unstructured natural language text and covers multiple dimensions such as the user's basic information, personality traits, behavioral habits, and recent status.

[0033] The advantages of using natural language text instead of structured fields to store user profiles are: different users have different feature dimensions, and natural language can flexibly adjust the description content according to individual differences; natural language can express temporal semantics (such as "I used to go to the gym often, but I don't go as often now"); and large language models generate and understand natural language text more naturally and accurately.

[0034] Subsequently, the first-level user profile is used as the first compression input, and a first compression instruction is sent to the large language model. Semantic compression is performed while preserving core features and important details, resulting in a second-level lightweight user profile of 800-1000 characters. The second-level profile is then used as the second compression input, and a second compression instruction is sent to extract the most core and stable user features, resulting in a third-level lightweight user profile of 200-300 characters. The third-level profile is then permanently injected into the system prompts in each dialogue, enabling the system to obtain the user's basic understanding in each conversation without needing to load the complete profile.

[0035] All the above-mentioned portraits are in the form of unstructured natural language text, and the word count range can be adaptively adjusted according to the actual application scenario and the size of the context window.

[0036] For example, please see Figure 3 , Figure 3 This is a schematic diagram illustrating the process of initializing a multi-level image according to an embodiment of this application. The multi-level image initialization process may include the following steps: S201: Trigger the portrait initialization task.

[0037] After the user's first day of conversation ends, the system detects that the day is the first interaction day and automatically triggers the profile initialization task.

[0038] S202: Collect the complete dialogue records of the day and input them into the large model.

[0039] The system collects the complete dialogue records of the day from the original dialogue storage module and inputs them into the large language model along with the preset profile generation instructions.

[0040] S203: Generate Level 1 portrait from the large model.

[0041] The large language model analyzes and infers the dialogue records based on semantic understanding, generating a coherent paragraph-style natural language text of 2,000 to 3,000 words as a Level 1 profile (i.e., first-level user profile), which covers multiple dimensions such as the user's basic information, personality traits, behavioral habits and recent status.

[0042] S204: Automatically compress and generate Level 2 profiles based on Level 1.

[0043] The system takes the Level 1 profile as input and sends the first compression instruction to the large language model. While preserving the user's core features and important details, it performs semantic compression to generate a Level 2 profile (i.e., a second-level lightweight user profile) of 800 to 1000 words.

[0044] S205: Automatically compress and generate Level 3 images based on Level 2.

[0045] The system takes the Level 2 profile as input and sends a second compression instruction to the large language model to perform a higher degree of semantic compression, extract the most core and stable user features, and generate a Level 3 profile of 200-300 words (i.e., a three-level lightweight user profile), retaining only the most core feature descriptions of the user.

[0046] S206: Three-layer image storage completed, Level 3 injected into the resident Prompt.

[0047] The system persistently stores the three-layer profile in the profile library, and injects the Level 3 profile as resident information into the system prompts for each conversation. This allows the conversation system to gain a basic understanding of the user with almost no additional context window resources, thereby providing personalized responses.

[0048] The character count range for each level of portrait can be adaptively adjusted according to the actual application scenario and the size of the context window.

[0049] In some embodiments, the method may further include the following steps: During the dialogue interaction phase, user input information is obtained, and scene recognition is performed on the input information to determine the corresponding scene type; If the scenario type is a casual chat scenario, then inject the three-level lightweight user profile into the context of the current conversation; If the scenario type is a historical memory scenario, then extract the paragraphs related to the input information from the first-level user profile, and inject the extracted paragraphs together with the third-level lightweight user profile into the context of the current conversation; If the scenario type is an important scenario, then the entire content of the first-level user profile will be injected into the context of the current conversation.

[0050] The dialogue interaction phase refers to the subsequent dialogue process between the user and the system after the initial profile is initialized, specifically the dialogue rounds after the initial dialogue.

[0051] During the dialogue interaction phase, the system acquires the current information input by the user in real time, and uses a scene determiner to identify the scene type to which the current dialogue belongs. The scene determiner can use a matching method based on preset keyword rules or a prediction method based on a lightweight classification model.

[0052] The scene determiner categorizes the current conversation into one of three scenarios: casual conversation, historical recollection, or important scene, and executes the corresponding profile recall strategy: In casual conversation scenarios, the system injects only a three-level lightweight user profile into the context. This scenario covers ordinary conversations such as daily greetings and casual chats, with low dependence on historical details, providing basic personalized responses with minimal token consumption.

[0053] Historical Recollection Scenario: When the system detects that user input contains historical keywords such as "before," "back then," or "before," or involves past experiences, it extracts narrative paragraphs related to the current input from the primary user profile and injects them into the context along with the secondary user profile. The extraction method involves calculating the semantic similarity between the current input and each paragraph in the primary user profile, and selecting one or more paragraphs with the highest similarity. By extracting on demand rather than loading the full text, sufficient historical detail is provided while avoiding excessive use of the context window.

[0054] Key Scenarios: When the system detects that a user is seeking emotional support, facing a major decision, or engaging in an in-depth discussion, it injects the entire content of the primary profile into the context. Simultaneously, using the current input as a retrieval criterion, it recalls semantically similar historical dialogue fragments from the vector database and injects them as well. The combination of complete primary profile information and original dialogue fragments provides the system with the most comprehensive foundation for user understanding, thereby generating more accurate and empathetic high-quality responses.

[0055] For example, please see Figure 4 , Figure 4 This is a flowchart illustrating the intelligent tiered recall strategy provided in this application embodiment. The intelligent tiered recall strategy process may include the following steps: During the dialogue interaction phase, the user's current dialogue input is acquired in real time, and the dialogue intent and complexity of the input are analyzed by the scene judge to determine the scene type to which the current dialogue belongs.

[0056] When the scenario detector determines that the current conversation is a casual chat, the system loads a three-level lightweight user profile and injects it into the current conversation context as a persistent system prompt. This is suitable for most ordinary conversation scenarios and can provide basic personalized responses with minimal token consumption.

[0057] When the scene detector detects that the user input contains historical keywords such as "before," "back then," "before," or "do you remember," or identifies that the current topic involves the user's past experiences, the system determines it to be a historical recollection scene. The system extracts the narrative paragraph corresponding to the current input information from the primary user profile and injects it into the current dialogue context along with the secondary lightweight user profile.

[0058] When the scenario determiner identifies that a user is seeking emotional support, facing a major decision, or engaging in an in-depth discussion, the system classifies it as an important scenario. The system loads the entire content of the primary user profile and, using the current input information as search criteria, retrieves semantically similar historical dialogue fragments from the vector database. Both are then injected into the current dialogue context, providing the dialogue system with the most comprehensive foundation for user understanding.

[0059] Based on the corresponding hierarchical profile information injected under the different scenarios described above, high-quality Agent response output is generated. Through the layered on-demand invocation of the above three strategies, the system can achieve a dynamic balance between response quality and inference cost.

[0060] In some embodiments, the method may further include the following steps: Real-time acquisition of dialogue data between users and the dialogue system; preprocessing of the dialogue data, including at least one of sentence segmentation, noise reduction and standardization. The preprocessed dialogue data is input into a pre-trained text embedding model to generate corresponding semantic vectors; Persist the semantic vectors to a vector database; In important scenarios, the system retrieves historical dialogue fragments that are semantically similar to the input information from the vector database using the input information as the retrieval criteria, and injects the historical dialogue fragments along with all the content of the first-level user profile into the current dialogue context.

[0061] The system collects complete dialogue data between the user and the dialogue system in real time through the raw dialogue storage module, including text content, timestamps, and session identifiers, and permanently stores it as the underlying data source of facts.

[0062] After data acquisition, the dialogue text undergoes preprocessing, including at least one of sentence segmentation, denoising, and standardization. Sentence segmentation divides long texts into sentence fragments based on semantic units; denoising removes irrelevant characters or redundant expressions; and standardization unifies the text format. The preprocessed dialogue text has a unified format, facilitating subsequent vectorization encoding.

[0063] The preprocessed dialogue text is input into a pre-trained text embedding model and converted into high-dimensional semantic vectors, representing the deep semantic features of the text as floating-point arrays. The generated semantic vectors are persistently stored in a vector database, which supports approximate nearest neighbor search based on cosine similarity or Euclidean distance, providing efficient retrieval capabilities for historical dialogue recall.

[0064] During the dialogue interaction phase, when the scene judge identifies the current dialogue as an important scene, it generates a query vector using the user's current input information as the retrieval condition and performs semantic similarity retrieval in the vector database. This retrieves semantically similar historical dialogue fragments and injects them into the current dialogue context along with all the content of the first-level user profile. This allows the dialogue system to simultaneously obtain the user's complete profile cognition and original historical interaction facts, achieving the most comprehensive and accurate user understanding and response generation.

[0065] 102. Input the primary user profile and the user's new dialogue data into the large language model to identify the information type corresponding to the change information of the new dialogue data relative to the primary user profile.

[0066] In some embodiments, the primary user profile and the user's new dialogue data are input into a large language model to identify the information type corresponding to the changes in the new dialogue data relative to the primary user profile, including: After a user finishes a new conversation, an incremental update task is triggered to obtain the new conversation data. The new conversation data, the first-level user profile, and the preset profile update instructions are then input into the large language model. The big language model is used to semantically compare each piece of information in the new dialogue data with the first-level user profile, and the change information is determined based on the comparison results. Identify the information type of the changed information.

[0067] After each new conversation ends, the system automatically triggers an incremental update task. A new conversation refers to a complete dialogue record newly generated between the user and the conversation system since the last profile update. After each new conversation ends, the system automatically triggers an incremental update task to retrieve the complete dialogue record generated since the last update as the new conversation data.

[0068] The system inputs the newly added dialogue data, the current version of the primary user profile, and the preset profile update instructions into the large language model. The current version of the primary user profile is the complete text of the profile after the most recent update; the profile update instruction is a natural language prompt used to instruct the large language model to perform semantic analysis on the newly added dialogue data and determine whether and how to update the profile.

[0069] In one specific embodiment of this application, the profile update instruction can be expressed as: "You are an observer skilled at character portrayal. You currently have: [Yesterday's User Profile] [Today's Conversation Record]. Your task: Carefully read today's conversation and determine whether any descriptions in yesterday's profile need to be updated. Update principles: 1. If the user's basic information changes, update it in the corresponding paragraph while retaining historical information using tense; 2. If new personality traits, habits, or preferences are discovered, add them to the corresponding paragraph; 3. If a judgment from yesterday was inaccurate, correct the description; 4. If today's conversation does not provide new information, keep the profile unchanged. Output: The updated complete Level 1 profile." The large language model performs a semantic comparison of each piece of information in the newly added dialogue data with the current version of the primary user profile, determining whether each piece of new information constitutes a change to the profile—that is, whether there has been a substantial change or supplement relative to the existing description. If so, it is identified as change information. The large language model further identifies the type of each change information, classifying it into one of the following five types: Permanent change type: Permanent changes to the user's basic information, such as moving, changing jobs, getting married, etc.

[0070] Additional details: Discovering new user habits, preferences, opinions, and other information.

[0071] Correction type: It was found that a previous judgment about the user was not accurate enough.

[0072] Temporary state type: Short-term emotions or temporary states expressed by users.

[0073] No new information type: The new dialogue did not provide any new information that can be used to update the profile.

[0074] Through the semantic comparison and type recognition described above, the large language model can accurately determine the change attributes of each piece of information relative to the profile and the corresponding information type, providing a basis for subsequent differentiated profile update operations.

[0075] 103. Profile update method based on information type matching.

[0076] Different information types correspond to different profile update methods. The profile update method includes at least temporal fusion update, which is: fusing the original historical description and change information of the first-level user profile through natural language temporal tags.

[0077] In some embodiments, the step "matching the corresponding profile update method based on information type" may include the following operations: If the information type is a permanent change type, then the corresponding profile update method is determined to be temporal fusion update; If the information type is the detail supplement type, then the corresponding profile update method is determined to be paragraph append update. Paragraph append update means: adding new user feature information to the corresponding narrative paragraph of the profile to improve the user feature description. If the information type is a judgment correction type, then the corresponding profile update method is determined to be feature correction update. Feature correction update is: modifying the original user feature descriptions that have deviations in the profile. If the information type is a temporary state type, then the corresponding profile update method is determined to be short-term state archiving update. Short-term state archiving update is: writing the user's stage state information into the profile's exclusive recent state narrative area, and retaining the long-term feature description in the profile without adjustment. If the information type is "no new information type", then the corresponding profile update method is determined to be "no change retention". "No change retention" means that all content of the first-level user profile is maintained without modification.

[0078] Among them, permanent change type refers to a persistent change in a user's basic information, such as moving, changing jobs, getting married, or breaking up. Temporal fusion update refers to the large language model integrating change information with the original historical description in the same narrative paragraph when updating the first-level user profile, using tense words. This naturally preserves historical details while updating the main description, rather than directly overwriting or deleting the original information.

[0079] Detail supplementation refers to the discovery of new user habits, preferences, or opinions. Paragraph appending updates refer to adding new user characteristic information to the corresponding narrative paragraphs in the primary user profile to improve the user characteristic description.

[0080] Judgment correction type refers to discovering that a previous judgment about a user was inaccurate. For example, the user was previously judged to be "introverted," but today's conversation shows that the user is actually "selectively social." Feature correction update refers to modifying the original user feature descriptions in the profile that contain biases, making them more in line with the user's actual situation.

[0081] Temporary status types refer to short-term emotions or phased states expressed by users, such as "I'm really tired these days" or "I've been rushing to finish a project lately." Short-term status archiving updates refer to writing users' phased status information into the recent status narrative area dedicated to the primary user profile, while retaining the long-term feature descriptions in the profile without adjustment, thus achieving separate management of temporary statuses and long-term features.

[0082] "No new information type" means that the newly added dialogue data does not provide any new information that can be used to update the Level 1 user profile. "No change retention" means that the entire content of the Level 1 user profile is maintained without any modification to save computing resources.

[0083] In some embodiments, when the identified information type is a permanent change type, the system updates the primary user profile through a historical information temporal fusion module. This mechanism is used to handle situations where user basic information undergoes persistent changes.

[0084] Specifically, when the large language model detects a permanent change in a user's basic information, it does not simply replace the old value with the new one. Instead, it uses the temporal markers of natural language to naturally integrate historical information into the updated description. The following is an illustration using a specific example: Suppose the user's Level 1 profile from the previous day included the description: "Currently living in Chaoyang District, Beijing. There's a courier station 300 meters from my home, and I often go to the cafes in Sanlitun to relax on weekends." In today's conversation, the user mentioned, "I moved to Hangzhou last week." After the large language model performs inference, it outputs an updated description: "Currently living in Hangzhou, I just moved from Beijing in early July this year. I lived in Beijing for more than three years, previously living in Chaoyang District, with a courier station 300 meters from my home, and I often went to the cafes in Sanlitun on weekends. After moving to Hangzhou, I'm still adjusting to the new environment and exploring what good places there are nearby." Through the aforementioned temporal fusion mechanism, the updated Level 3 lightweight profile is displayed as "currently residing in Hangzhou (recently moved from Beijing)," providing accurate and concise information. The Level 1 profile fully preserves all the details of life during the Beijing period, naturally distinguishing information from different time periods through tense words. When the user subsequently mentions "when I was in Beijing," the system can accurately recall the relevant historical context.

[0085] It's important to note that the key to the aforementioned temporal fusion mechanism lies in its use of natural language text descriptions rather than JSON structured fields to store user profiles. Natural language text inherently supports temporal expression; a single sentence can fully preserve the fusion of historical information and the current state, eliminating the need for additional data structure design.

[0086] 104. Update the primary user profile according to the profile update method and the newly added dialogue data to obtain the updated primary user profile.

[0087] The large language model performs corresponding update operations on the primary user profile based on the profile update method determined by matching and combined with the change information in the newly added dialogue data: When temporal fusion is updated, the changed information is written to the corresponding paragraph of the profile, and the old and new descriptions are merged by tense words, so as to preserve historical details while updating the main information; when paragraph appending is updated, the new feature information is added to the narrative paragraph corresponding to the profile; when feature correction is updated, the original descriptions in the profile that have deviations are modified; when short-term state archiving is updated, the stage state is written to the recent state area, and the medium and long-term features remain unchanged; when no changes are retained, all content of the profile is maintained without modification.

[0088] After the update is complete, the large language model outputs the updated complete text of the first-level user profile.

[0089] 105. Based on the updated first-level user profile, the multi-level lightweight user profile is recompressed to obtain the updated multi-level lightweight user profile.

[0090] The system takes the updated first-level user profile as the first compression input and sends the first compression instruction to the large language model. While preserving the core features and important details of the user, the large language model performs semantic compression on the updated first-level profile to generate a new second-level lightweight user profile. The system then takes the newly generated second-level lightweight user profile as the second compression input and sends the second compression instruction to the large language model. The large language model extracts the most core and stable user features from it to generate a new third-level lightweight user profile.

[0091] In the long-term maintenance of user profiles, as a preferred implementation of the above-mentioned hierarchical compression and incremental update mechanism, the system can also adopt a hierarchical compression strategy based on memory units, instead of compressing the complete first-level profile as a whole each time.

[0092] Specifically, the system records each piece of information or segment in the event pipeline as an independent memory unit, with each memory unit accompanied by a time tag, category tag, importance level, and recall anchor. When constructing the persistent context, the system performs hierarchical compression of memory units based on time proximity and importance: recent events retain higher detail density and are preserved in full narrative form; earlier events are compressed into summary form or only retain thematic anchors; long-term stable feature information is further integrated into the high-level profile description.

[0093] When a user subsequently inquires about related topics, the system retrieves more detailed original information from the original dialogue record or lower-level profile through the corresponding recall anchor point, achieving accurate historical context backtracking.

[0094] This implementation method, as a further refinement of the aforementioned layered compression and incremental update mechanism, is particularly suitable for application scenarios with long profile accumulation cycles and high event density. It can provide more granular index support for on-demand retrieval of historical details while ensuring the simplicity of the core profile.

[0095] For example, please see Figure 5 , Figure 5 This is a schematic diagram of the incremental iterative update process provided in an embodiment of this application. The incremental iterative update process may include the following steps: S301: Trigger incremental update task.

[0096] After a user's conversation ends for the day, the system automatically triggers an incremental update task. This update task is executed once a day to ensure that the user profile continues to evolve as conversations accumulate, always effectively reflecting the user's latest status.

[0097] S302: Construct model inputs.

[0098] The system sends the following three items as input to the large language model: (a) the complete text of the Level 1 profile from the previous day; (b) the complete dialogue record of the current day; and (c) the preset profile update command. Among them, the Level 1 profile from the previous day serves as the baseline version for profile updates, the complete dialogue record of the current day serves as the source of new information, and the profile update command is used to constrain the analysis method and output format of the large language model.

[0099] S303: Autonomous Semantic Analysis of Large Language Models.

[0100] After receiving the above input, the large language model autonomously performs semantic analysis and inference on the day's dialogue records based on its semantic understanding capabilities. Specifically, the large language model performs a line-by-line semantic comparison between each piece of information in the day's dialogue records and the existing descriptions in the previous day's Level 1 profile, determining whether each piece of information constitutes a change to the profile, and classifying the changed information into the following five types: Permanent Change Type: This refers to a persistent change in a user's basic information, such as moving, changing jobs, getting married, or breaking up. For this type of information, the large language model updates the corresponding subject description in the profile, while naturally preserving historical details through tense words (such as "before," "now," and "formerly") to avoid losing historical context.

[0101] Additional details type: This refers to the discovery of new user habits, preferences, or opinions. For this type of information, the large language model adds it to the corresponding narrative paragraphs in the profile to enrich the completeness and detail of the character description.

[0102] Correction type: This refers to the discovery that a previous judgment about a user was inaccurate. For example, the user was judged to be "introverted" in the previous day's profile, but the current day's conversations show that the user is actually "selectively social." For this type of information, the large language model corrects the existing description in the profile while retaining a record of the reasoning process.

[0103] Temporary state type: refers to short-term emotions or phased events expressed by users, such as "I've been particularly tired these past few days" or "I've been rushing to finish a project lately." For this type of information, the large language model writes it into the "Recent State" section of the profile, without modifying the long-term stable personality traits or other characteristic descriptions in the profile.

[0104] No new information type: This means that the conversation log for the day did not provide any new information that could be used to update the profile. In this case, the profile remains unchanged and no update operation is required.

[0105] S304: Output the updated Level 1 image.

[0106] Based on the information type judgment results and the corresponding update method, the large language model performs corresponding modifications, additions, or leaves the previous day's Level 1 profile unchanged, and outputs the updated complete Level 1 profile text.

[0107] S305: Recompress to generate Level 2 and Level 3.

[0108] The system automatically retrieves the updated Level 1 profile, triggering the recompression and generation of Level 2 and Level 3 profiles. Specifically, the system uses the updated Level 1 profile as the first compression input, sending a first compression command to the large language model to generate a new Level 2 profile; then, it uses the newly generated Level 2 profile as the second compression input, sending a second compression command to the large language model to generate a new Level 3 profile. Through these recompression steps, consistency among the three profile layers is ensured, guaranteeing that each profile always reflects the user's latest complete state.

[0109] In some embodiments, the method may further include the following steps: Conduct quality self-inspection and optimization of the primary user profile; Quality self-inspection and optimization includes at least one of the following methods: Input the current version of the primary user profile and the dialogue records within a preset time period into the large language model. The large language model will output profile correction suggestions and update the primary user profile according to the correction suggestions. Associating time tags with each segment of the description in the first-level user profile, the large language model reduces the proportion of descriptions generated earlier in the compression result when compressing and generating multi-level lightweight user profiles. The primary user profile is categorized into topic categories, and an index mapping relationship is established between each topic category and its corresponding narrative paragraph. During the dialogue interaction phase, the corresponding narrative paragraph is retrieved from the primary user profile based on the index mapping relationship according to the topic category involved in the current dialogue and injected into the context. The system receives feedback from users, inputs it into a large language model, and then modifies the corresponding descriptions in the primary user profile based on these feedbacks.

[0110] Specifically, quality self-inspection and optimization includes at least one of the following methods: Regular quality self-check: The system inputs the current first-level profile and the dialogue records of the most recent week into the big language model according to a preset cycle (such as once a week). The big language model evaluates which descriptions are outdated, which important features have not been captured, and which details are too trivial, and outputs correction suggestions. The system updates the profile accordingly.

[0111] Time-weighted mechanism: The system associates time tags with each segment of the profile description and records the generation or update time of each segment. When compressing and generating multi-level profiles, the large language model automatically reduces the weight of earlier descriptions in the compression result based on the time tags. Specifically, information from the most recent week is prioritized for recall, information from three months ago has reduced weight and is only recalled when explicitly mentioned, and information from six months ago is archived to "historical period".

[0112] Semantic Topic Classification and Precise Recall Optimization: The system inputs the first-level profile into the large language model, instructing it to perform semantic analysis and classify the profile content into multiple topic categories (such as "occupation and work," "recent status," "historical experience," etc.). Representative keywords are extracted for each category, and an index mapping relationship is established between category names and corresponding narrative paragraphs. During the dialogue interaction phase, the system injects the third-level profile and classification index into the large language model. The large language model determines the topic category involved in the current dialogue and then only retrieves the narrative paragraphs under the corresponding category to inject into the context, rather than loading all first-level profile content. This mechanism reduces token consumption while maintaining precise recall, and is particularly suitable for scenarios where profile content is already very rich. The classification index is automatically re-executed after each update of the first-level profile to maintain consistency.

[0113] User-initiated correction mechanism: When a user expresses dissatisfaction with the profile assessment, the system inputs the user's correction suggestions into the large language model, which then rewrites the corresponding description in the profile.

[0114] The method provided in this application embodiment is illustrated below with a specific application scenario: Imagine a companion AI product. The user, Xiao Wang, is a 27-year-old male product manager who lives in Beijing when he first uses the AI ​​product.

[0115] Day 1: Profile Initialization. Xiao Wang has a conversation with the AI ​​for about 30 minutes, discussing work, interests, and recent worries. After the conversation, the system executes the profile initialization process. The large language model generates a Level 1 profile of about 2,500 words, describing Xiao Wang's occupation, personality, residence (Chaoyang District, Beijing), and living habits, and automatically compresses it to generate Level 2 (about 900 words) and Level 3 (about 250 words).

[0116] Day 15: Incremental Update and Temporal Fusion. Xiao Wang mentioned, "I moved to Hangzhou last week; my new company is in Xihu District." The system triggered an incremental update. The large language model determined that "moving" was a permanent change and performed a temporal fusion update, rewriting the residence paragraph to "Currently residing in Xihu District, Hangzhou. I moved from Beijing in early July. Previously, I lived in Chaoyang District, Beijing. There's a courier station 300 meters away from my home, and I often went to a coffee shop in Sanlitun to relax on weekends." While updating the information, the system fully preserved the details of his life in Beijing.

[0117] Day 20: Precise Recall in Historical Recollection Contexts. Xiao Wang said, "I kind of miss that coffee shop in Sanlitun, Beijing." The scene detector detected historical keywords such as "before" and "Beijing," identifying it as a historical recall scenario. Relevant passages from the Beijing period were extracted from the Level 1 profile and injected into the context. The AI ​​replied, "I remember you mentioned before that you often went to that coffee shop in Sanlitun to relax on weekends, and there was also a convenient courier station near your home. Have you found anything similar in Hangzhou?" This achieved precise historical association.

[0118] Day 30: Loading a complete profile in a key scenario. Xiao Wang expressed anxiety about the decision to change jobs. The scenario judge identified it as an emotionally supportive scenario, loading a complete Level 1 profile. Based on its understanding of Xiao Wang's complete life trajectory, the AI ​​generated a response with deep empathy.

[0119] The method provided in this application embodiment can continuously update user profiles during long-term interactions and load profile information of different granularities as needed according to the dialogue scenario, taking into account both personalized response quality and inference cost control.

[0120] For further details, please refer to Figure 6 , Figure 6 A structural block diagram of a multi-level user profile management device based on a large language model, provided in this application embodiment, is shown. The device includes: The acquisition unit 401 is used to acquire the user's initial dialogue data and input it into the large language model to generate a first-level user profile in the form of unstructured natural language text. The first-level user profile is then compressed to obtain a multi-level lightweight user profile. The identification unit 402 is used to input the first-level user profile and the user's new dialogue data into the large language model and identify the information type corresponding to the change information of the new dialogue data relative to the first-level user profile. The matching unit 403 is used to match the corresponding profile update method based on the information type. Different information types correspond to different profile update methods. The profile update method includes at least temporal fusion update, which is: fusing the original historical description and change information of the first-level user profile through natural language temporal tags. Update unit 404 is used to update the first-level user profile according to the profile update method and the newly added dialogue data to obtain the updated first-level user profile. Compression unit number 405 is used to re-compress the multi-level lightweight user profile based on the updated first-level user profile, so as to obtain the updated multi-level lightweight user profile.

[0121] Accordingly, embodiments of this application also provide an electronic device. For example... Figure 7 As shown, Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 500 includes a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 and the memory 502 are electrically connected. Those skilled in the art will understand that... Figure 7 The electronic device structures shown herein do not constitute a limitation on electronic devices and may include, but are not limited to, those shown. Figure 7 It can show more or fewer parts, or combine certain parts, or arrange different parts.

[0122] The processor 501 is the control center of the electronic device 500. It connects various parts of the electronic device 500 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, it performs various functions of the electronic device 500 and processes data, thereby monitoring the electronic device 500 as a whole.

[0123] In this embodiment of the application, the processor 501 in the electronic device 500 will load the instructions corresponding to the process of one or more applications into the memory 502 according to the following steps, and the processor 501 will run the applications stored in the memory 502 to realize various functions.

[0124] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0125] Optional, such as Figure 7As shown, the electronic device 500 may further include a display 503 and an input unit 504. The processor 501 is electrically connected to both the display 503 and the input unit 504. Those skilled in the art will understand that... Figure 7 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0126] The display 503 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The display 503 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, guidance information, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), an organic light-emitting diode (OLED), or other similar devices. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program. Optionally, the touch panel may include a touch detection device and a touch controller.

[0127] The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 501. It can also receive and execute commands from the processor 501. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 501 to determine the type of touch event. Subsequently, the processor 501 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and display panel can be integrated into the display 503 to achieve input and output functions. However, in some embodiments, the touch panel and display panel can be implemented as two independent components to achieve input and output functions. That is, the display 503 can also be used as part of the input unit 504 to achieve input functions.

[0128] The input unit 504 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0129] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0130] Therefore, embodiments of this application provide a computer-readable storage medium storing multiple computer programs that can be loaded by a digital signal processor to execute steps in any of the multi-level user profile management methods based on a large language model provided in embodiments of this application.

[0131] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0132] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0133] Since the computer program stored in the computer-readable storage medium can execute the steps in any of the multi-level user profile management methods based on a large language model provided in the embodiments of this application, it can achieve the beneficial effects that any of the multi-level user profile management methods based on a large language model provided in the embodiments of this application can achieve, as detailed in the preceding embodiments, and will not be repeated here.

[0134] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A multi-level user profile management method based on a large language model, characterized in that, The method includes: The user's initial dialogue data is obtained and input into a large language model to generate a first-level user profile in the form of unstructured natural language text. The first-level user profile is then compressed to obtain a multi-level lightweight user profile. The first-level user profile and the user's new dialogue data are input into the large language model to identify the information type corresponding to the change information of the new dialogue data relative to the first-level user profile; Based on the information type matching corresponding profile update method, different information types correspond to different profile update methods, and the profile update method includes at least temporal fusion update, which is: fusing the original historical description of the first-level user profile with the change information through natural language temporal tags; The first-level user profile is updated according to the profile update method and the newly added dialogue data to obtain the updated first-level user profile. Based on the updated first-level user profile, the multi-level lightweight user profile is recompressed to obtain the updated multi-level lightweight user profile.

2. The method according to claim 1, characterized in that, The process involves acquiring the user's initial dialogue data and inputting it into a large language model to generate a first-level user profile in unstructured natural language text form. This first-level user profile is then compressed to obtain a multi-level lightweight user profile, including: After the user's first conversation ends, a profile initialization task is triggered to obtain the conversation data of the first conversation, thus obtaining the initial conversation data; The initial dialogue data and the preset profile generation instructions are input into the large language model. The large language model outputs coherent paragraph-style natural language text based on semantic understanding, which serves as the first-level user profile. Using the first-level user profile as the first compression input, a first compression instruction is sent to the large language model to obtain a second-level lightweight user profile. The second-level user profile is used as the second compression input, and a second compression instruction is sent to the large language model to obtain a third-level lightweight user profile, which retains only the user's core features. The first-level user profile, the second-level lightweight user profile, and the third-level lightweight user profile are all unstructured natural language text.

3. The method according to claim 2, characterized in that, The method further includes: During the dialogue interaction phase, the user's input information is obtained, and the input information is used for scene recognition to determine the corresponding scene type. If the scenario type is a casual chat scenario, then the three-level lightweight user profile is injected into the context of the current conversation; If the scenario type is a historical memory scenario, then extract the paragraphs related to the input information from the first-level user profile, and inject the extracted paragraphs together with the third-level lightweight user profile into the context of the current dialogue; If the scenario type is an important scenario, then all the content of the first-level user profile will be injected into the context of the current conversation.

4. The method according to claim 3, characterized in that, The method further includes: Real-time acquisition of dialogue data between users and the dialogue system; preprocessing of the dialogue data, including at least one of sentence segmentation, noise reduction and standardization. The preprocessed dialogue data is input into a pre-trained text embedding model to generate corresponding semantic vectors; The semantic vectors are persistently stored in a vector database; In the aforementioned important scenarios, using the input information as the retrieval condition, historical dialogue fragments that are semantically similar to the input information are recalled from the vector database, and the historical dialogue fragments, together with all the content of the first-level user profile, are injected into the current dialogue context.

5. The method according to claim 1, characterized in that, The step of inputting the primary user profile and the user's new dialogue data into the large language model, and identifying the information type corresponding to the change information of the new dialogue data relative to the primary user profile, includes: After the user's new conversation ends, an incremental update task is triggered to obtain the new conversation data. The new conversation data, the first-level user profile, and the preset profile update instruction are then input into the large language model. The big language model is used to semantically compare each piece of information in the newly added dialogue data with the first-level user profile, and the change information is determined based on the comparison results. The information type of the change information is identified, and the information type is one of the following: permanent change type, detailed supplement type, judgment correction type, temporary status type, and no new information type.

6. The method according to claim 5, characterized in that, The method for updating the profile based on the information type includes: If the information type is the permanent change type, then the corresponding profile update method is determined to be temporal fusion update; If the information type is the detail supplement type, then the corresponding profile update method is determined to be paragraph append update, which means: adding new user feature information to the narrative paragraph corresponding to the profile to improve the user feature description; If the information type is the judgment correction type, then the corresponding profile update method is determined to be feature correction update, which means: modifying the original user feature descriptions in the profile that have deviations; If the information type is the temporary state type, then the corresponding profile update method is determined to be short-term state archive update. The short-term state archive update is: writing the user's stage state information into the profile's exclusive recent state narrative area, while retaining the long-term feature description in the profile without adjustment. If the information type is the "no new information" type, then the corresponding profile update method is determined to be "no change retention". "No change retention" means that all content of the first-level user profile is maintained without modification.

7. The method according to claim 1, characterized in that, The method further includes: Perform quality self-inspection and optimization on the aforementioned primary user profile; The quality self-inspection and optimization includes at least one of the following methods: The current version of the primary user profile and the dialogue records within a preset time period are input into the large language model. The large language model outputs profile correction suggestions and updates the primary user profile according to the correction suggestions. Associating time tags with each segment of the description in the first-level user profile, the large language model reduces the proportion of descriptions generated earlier in the compression result when compressing and generating the multi-level lightweight user profile; The primary user profile is categorized into topic categories, and an index mapping relationship is established between each topic category and its corresponding narrative paragraph. During the dialogue interaction phase, the corresponding narrative paragraph is retrieved from the primary user profile based on the index mapping relationship according to the topic category involved in the current dialogue and injected into the context. The system receives the user's feedback and inputs it into the large language model, which then modifies the corresponding description in the first-level user profile based on the feedback.

8. A multi-level user profile management system based on a large language model, characterized in that, The system includes: The original dialogue storage module is used to collect dialogue data between the user and the dialogue system in real time, perform vectorization encoding on the dialogue data, and persistently store the generated semantic vectors in the vector database. The multi-level user profile generation module is used to acquire the user's initial dialogue data and input it into a large language model to generate a first-level user profile in the form of unstructured natural language text, and to compress the first-level user profile to obtain a multi-level lightweight user profile. The AI ​​autonomous iterative update module is used to input the first-level user profile and the new dialogue data into the big language model after the user generates new dialogue data. The big language model identifies the information type corresponding to the change information and matches the corresponding profile update method according to the information type to update the first-level user profile. Then, it recompresses and generates lightweight user profiles at all levels based on the updated first-level user profile. The historical information temporal fusion module is used to retain historical information before the change in the profile text through temporal markers in natural language when updating the first-level user profile; The intelligent hierarchical recall module is used to determine the corresponding level of profile information from the multi-level lightweight user profile and inject it into the current dialogue context based on the current dialogue scenario type during the dialogue interaction phase.

9. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, it implements the multi-level user profile management method based on a large language model as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores multiple instructions adapted for loading by a processor to execute the multi-level user profile management method based on a large language model as described in any one of claims 1 to 7.