Context-conditioned user preference management method
Patent Information
- Application Number
- CN202611444211.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-17
- Publication Date
- 2026-10-23
AI Technical Summary
[0004]然而,上述传统方案均存在的技术问题是:无法识别和应对用户偏好的场景条件化特性
[0007]本申请提供一种基于上下文条件化的用户偏好管理方法,通过获取当前偏好信息和历史偏好信息,并对两者进行偏好冲突判断,当存在偏好冲突时获取与当前偏好信息对应的第一上下文条件和与历史偏好信息对应的第二上下文条件,并判断第一上下文条件与第二上下文条件之间是否存在差异,若存在差异则将当前偏好信息与第一上下文条件关联存储为第一偏好记忆、将历史偏好信息与第二上下文条件关联存储为第二偏好记忆,实现了偏好记忆的上下文条件化分裂存储。本申请使相互矛盾的偏好信息在存储层面保持独立且各自绑定适用的上下文条件,不同上下文条件的偏好记忆互不干扰;同时,由于偏好记忆携带上下文条件标签,后续召回过程中能够基于当前上下文条件进行精准匹配,避免不匹配的偏好记忆被误召回,从而提升了个性化应答与当前场景的适配准确性。
Smart Images

Figure CN122964239A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence technology and natural language processing technology, and in particular to a context-conditional user preference management method. Background Technology
[0002] With the rapid development of artificial intelligence technology, intelligent dialogue systems based on large language models have been widely applied in personalized interaction scenarios. These systems typically maintain user preferences through user profiling, recommendation systems, conversation summarization, vector retrieval, or long-term memory modules to provide responses tailored to the user's personalized needs in different conversations.
[0003] Traditionally, large-scale model memory systems typically employ the following methods to remember and manage user preferences: directly appending conversation history to the model input window, which is limited by context length and cannot save preferences across conversations; periodically summarizing user dialogues into abstracts and injecting them into the model as user profiles, with stored preferences as global tags; segmenting historical dialogues into fragments and storing them in a vector database, then recalling relevant fragments based on semantic similarity; or using a large model to extract preferences from dialogues and categorize them for storage through several predefined preference categories. All of these methods focus on storing and retrieving user preferences, emphasizing the persistence of preference information.
[0004] However, the technical problem with all the aforementioned traditional solutions is their inability to identify and address the contextualized nature of user preferences. Specifically, a user's true preferences are often conditional. For example, the same user might prefer concise and direct expression in a work setting, a humorous and relaxed style in a social setting, and a clear priority in a dietary advice setting. Understandably, user preferences dynamically shift with changes in contextual conditions such as scenario type, task objective, time window, and geographical location. Traditional solutions simply store preferences as global labels without contextual conditions, making it impossible to distinguish the applicable boundaries of preferences under different contexts. This leads to the activation of mismatched preferences in incorrect scenarios, causing the accuracy of personalized responses to decrease rather than increase. Furthermore, when users express contradictory preferences in different scenarios, traditional solutions lack effective conflict resolution mechanisms, resorting only to crude strategies such as direct overriding or simple coexistence, resulting in the loss of historical preference information or conflicting preferences during recall. Summary of the Invention
[0005] Therefore, in order to address the aforementioned problems of traditional solutions, this application provides a user preference management method based on contextual conditions. By associating preference information with its applicable contextual conditions, conflicting preferences of the same user under different contextual conditions can be managed and recalled separately, thereby improving the scenario adaptation accuracy of personalized responses.
[0006] This application provides a context-based user preference management method, including: Obtain user preference information; the user preference information includes current preference information and historical preference information; Determine whether there is a preference conflict between the current preference information and the historical preference information; If there is a preference conflict between the current preference information and the historical preference information, then obtain the first context condition corresponding to the current preference information and the second context condition corresponding to the historical preference information; Determine whether there is a difference between the first context condition and the second context condition; If there is a difference between the first context condition and the second context condition, a preference memory update operation is performed; the preference memory update operation includes associating the current preference information with the first context condition and storing it as a first preference memory, and associating the historical preference information with the second context condition and storing it as a second preference memory.
[0007] This application provides a context-conditional user preference management method. It obtains current preference information and historical preference information, and determines whether there is a preference conflict. When a conflict exists, it obtains a first context condition corresponding to the current preference information and a second context condition corresponding to the historical preference information. It then determines whether there is a difference between the first and second context conditions. If a difference exists, it associates the current preference information with the first context condition and stores it as a first preference memory, and associates the historical preference information with the second context condition and stores it as a second preference memory. This achieves context-conditional split storage of preference memories. This application ensures that contradictory preference information remains independent at the storage level and is each bound to an applicable context condition, preventing interference between preference memories with different context conditions. Furthermore, because preference memories carry context condition tags, accurate matching based on the current context condition is possible during subsequent recall, avoiding the false recall of mismatched preference memories, thereby improving the accuracy of personalized responses and adaptation to the current scenario. Attached Figure Description
[0008] Figure 1 A flowchart of a context-conditional user preference management method provided in an embodiment of this application. Detailed Implementation
[0009] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0010] This application provides a context-conditional user preference management method.
[0011] This application does not limit the application scenarios or the executing entities of the context-conditional user preference management method. Optionally, the context-conditional user preference management method provided in this application is applied to a context-conditional user preference management system, which includes an intelligent question-answering client and a backend server. For the sake of brevity, the context-conditional user preference management system will be referred to as the "system" below, and the intelligent question-answering client will be referred to as the "client" below, and will not be explained or described again hereafter.
[0012] The client is deployed on the user's terminal device and is used to collect multi-source behavioral signals from the user, interact with the user, and present response information to the user. The backend server is used to execute the various processing steps of the context-based user preference management method. The client and the backend server communicate with each other; the multi-source behavioral signals collected by the client are uploaded to the backend server, and the response information generated by the backend server is sent to the client.
[0013] It should also be noted that, in this application, the term "APP" as used thereafter has the same meaning as the client, and will not be explained again.
[0014] like Figure 1 As shown, in one embodiment of this application, the context-conditional user preference management method includes the following steps S100 to S331: S100, Obtain user preference information. The user preference information includes current preference information and historical preference information.
[0015] S200, determine whether there is a preference conflict between the current preference information and the historical preference information.
[0016] S310, if there is a preference conflict between the current preference information and the historical preference information, then obtain the first context condition corresponding to the current preference information and the second context condition corresponding to the historical preference information.
[0017] S320, determine whether there is a difference between the first context condition and the second context condition.
[0018] S331, if there is a difference between the first context condition and the second context condition, then a preference memory update operation is performed. The preference memory update operation includes associating the current preference information with the first context condition and storing it as a first preference memory, and associating the historical preference information with the second context condition and storing it as a second preference memory.
[0019] Specifically, preference information is a structured data object describing a user's interests and tendencies. Current preference information refers to the user preferences identified by the system from the user's multi-source behavioral signals during the current interaction period. Historical preference information refers to the user preference memories stored by the system at earlier points in time. When performing preference management, the system simultaneously retrieves both types of preference information for comparison.
[0020] Contextual conditions are used to characterize the scene boundaries where preference memory takes effect. In this embodiment, contextual conditions include, but are not limited to, scene type, task type, time window, and geographic location category. For example, "technical investigation scenario" and "social copywriting scenario" belong to different scene types and each corresponds to different contextual conditions. The first contextual condition refers to the context environment in which the current preference information is identified, and the second contextual condition refers to the context environment recorded by the system when the historical preference information is stored.
[0021] The preference conflict in S200 can be a semantic-level preference conflict. After the system obtains the current preference information and historical preference information, it first determines whether there is a semantic-level preference conflict between them. A semantic-level preference conflict refers to a contradiction between two preference pieces of information after their content is transformed into semantics. For example, "users like detailed explanations" and "users like concise answers" are semantically conflicting. If there is no conflict, there is no need to trigger the subsequent splitting process, that is, S310 to S331 are not executed. Conversely, if a conflict exists, the system further obtains the context conditions corresponding to each of the two preference pieces of information.
[0022] After obtaining the first and second context conditions, the system determines whether there are differences between them. Difference determination refers to whether there are inconsistencies across various dimensions such as scene type, task type, time window, or geographical location category. If the two context conditions are inconsistent in at least one dimension, a difference is determined to exist.
[0023] When the system confirms a preference conflict between current and historical preference information, and that the two contextual conditions corresponding to this conflict differ, the system performs a preference memory update operation. This update operation involves: associating the current preference information with the first contextual condition and storing it as a single unit as the first preference memory; and associating the historical preference information with the second contextual condition and storing it as a single unit as the second preference memory. This associative storage method ensures that the two conflicting preference information pieces no longer overwrite each other, but are instead stored independently in the preference memory database, each carrying a clear contextual condition label.
[0024] In this embodiment, by acquiring current preference information and historical preference information, and determining whether there is a preference conflict, when a preference conflict exists, a first contextual condition corresponding to the current preference information and a second contextual condition corresponding to the historical preference information are acquired. It is then determined whether there is a difference between the first and second contextual conditions. If a difference exists, the current preference information is associated with the first contextual condition and stored as a first preference memory, and the historical preference information is associated with the second contextual condition and stored as a second preference memory. This achieves context-conditional split storage of preference memories. This embodiment ensures that contradictory preference information remains independent at the storage level and is each bound to an applicable contextual condition, preventing interference between preference memories with different contextual conditions. Furthermore, because preference memories carry contextual condition tags, accurate matching based on the current contextual condition can be performed during subsequent recall, avoiding the false recall of mismatched preference memories, thereby improving the accuracy of personalized responses and adaptation to the current scenario.
[0025] In one embodiment of this application, S320 includes the following S321 to S322, namely, determining whether there is a difference between the first context condition and the second context condition includes the following S321 to S322: S321, determine whether the first context condition and the second context condition are inconsistent in at least one dimension of scene type, task type, time window, and geographical location category.
[0026] S322, if the first context condition and the second context condition are inconsistent in at least one dimension of scene type, task type, time window, and geographical location category, then it is determined that there is a difference between the first context condition and the second context condition.
[0027] Specifically, contextual conditions are multi-dimensional structured tags. In this embodiment, contextual conditions can consist of four dimensions of information: scene type, task type, time window, and geographic location category. Of course, contextual conditions may include more than just the four dimensions mentioned in this embodiment. The four dimensions mentioned in this embodiment are only for better expression of the technical solution and should not be construed as limiting this embodiment or this application.
[0028] The scenario type describes the user's current macro-environment, such as "office scenario," "fitness scenario," "home scenario," or "social scenario." The task type describes the specific task the user is currently performing, such as "code review," "email composition," "diet planning," or "copywriting." The time window describes the time range within which the preference takes effect, such as "weekday evening," "weekend morning," or "commuting time." The location category describes the category of the user's location, such as "office," "gym," "restaurant," or "shopping mall."
[0029] When determining whether there is a difference between the first and second contextual conditions, the system compares each of the four dimensions mentioned above. If any inconsistency is detected in any dimension, a difference is determined to exist between the two contextual conditions. For example, if the scenario type of the first contextual condition is "technical investigation scenario" and the scenario type of the second contextual condition is "social media copywriting scenario," they are inconsistent in the scenario type dimension, and the system determines that a difference exists. Similarly, if the time window of the first contextual condition is "weekday evening" and the time window of the second contextual condition is "weekend afternoon," they are inconsistent in the time window dimension, and the system also determines that a difference exists.
[0030] This multi-dimensional difference judgment mechanism ensures that the comparison of contextual conditions does not depend on a single dimension, avoiding misjudgments caused by missing or ambiguous information in a single dimension.
[0031] In this application, the context condition can contain a structured object in the form of key-value pairs, and can have two implementation forms. As one implementation form, the context condition is expressed as key-value pairs in JSON format, for example: {
[0032] "scene_type": "Technical troubleshooting scenario", "task_type": "code review", "time_window": "Weekday evening", "location_category": "Office area" } As another implementation, context conditions can be expressed as instances of classes in object-oriented programming languages, i.e., Java classes, and can take the form of: public class ContextCondition { private String sceneType; / / Scene type private String taskType; / / Task type private String timeWindow; / / Time window private String locationCategory; / / Location category } The two implementations can be converted to each other at runtime. JSON-formatted context conditions can be deserialized into class instances, and class instances can be serialized back into JSON format. JSON format is used for data transmission and persistent storage, while class instances are used for computational operations in program logic.
[0033] At the database level, context conditions are expressed as data tables.
[0034] When determining whether there is a difference between the first and second context conditions, the system performs a field-by-field string comparison. One possible implementation is that the system retrieves the value of the `scene_type` field from the first context condition and performs a string comparison with the value of the `scene_type` field from the second context condition. If the two strings match, a difference is determined to exist in that dimension; if the two strings do not match, a difference is determined to exist in that dimension. Further, the system repeats the above comparison steps sequentially for the `task_type`, `time_window`, and `location_category` fields. If the two strings in any one of these fields do not match, the system determines that a difference exists between the two context conditions.
[0035] In this embodiment, by determining whether the first context condition and the second context condition are inconsistent in at least one dimension of scene type, task type, time window, and geographical location category, and determining that there is a difference between the context conditions when there is an inconsistency in any dimension, the judgment criteria for the difference between the context conditions are refined, so that the triggering conditions of the preference splitting operation have clear and quantifiable judgment criteria, thereby enhancing the operability and judgment accuracy of the system.
[0036] In one embodiment of this application, S100 includes the following S110 to S150, namely, obtaining the user's preference information includes the following: S110, acquires multi-source behavioral signals from the user.
[0037] S120 performs semantic processing on the user's multi-source behavioral signals to generate behavioral semantic tags.
[0038] S130, Recall candidate preferences based on the behavioral semantic tags.
[0039] S140, Obtain multi-source evidence of the candidate preference, and verify whether the candidate preference is valid based on the multi-source evidence.
[0040] S150, if the candidate preference is true, then the candidate preference is determined as the current preference information.
[0041] Specifically, in S110, multi-source behavioral signals refer to raw data collected from different channels that can reflect user behavioral characteristics and interests. In this embodiment, multi-source behavioral signals include four types: location behavioral signals, browsing behavioral signals, dialogue interaction signals, and user feedback signals.
[0042] Location behavior signals can be collected via the client. Each time a user opens the client and enters the homepage, the system captures the user's GPS location information. If the user has not enabled location permissions, the system will display a prompt guiding the user to grant GPS authorization. GPS location information is only used as intermediate data in data processing and is not stored in the database. Location behavior signals can include the user's current latitude and longitude coordinates, location collection time, location accuracy, duration of stay at the user's current location, user's movement speed, location change trajectory, frequency of location occurrence, and types of points of interest near the user's current location.
[0043] Browsing behavior signals record users' browsing behavior within the app, including the topic categories of the content they visit, the duration of their stay on each content page, the frequency of repeated visits to the same or similar content, and the types of content they browse.
[0044] The dialogue interaction signal records the interaction behavior between the user and the chatbot, including the number of times the user initiates a dialogue, the topic distribution of each dialogue, the depth of the user's follow-up questions to the system's answers, the number of times the user corrects the answers, and the intensity of the emotions expressed by the user in the dialogue.
[0045] User feedback signals record users' explicit feedback behaviors to the system output, which may include actions such as liking, saving, accepting, rejecting, modifying, deleting, and asking a new question.
[0046] Further execute S120. After the system collects the aforementioned multi-source behavioral signals, it performs semantic processing on the signals. Semantic processing refers to converting the original signals from numerical or textual form into labels with clear semantic meaning. For example, GPS coordinates are converted into scene categories such as "gym," "restaurant," and "office building" by calling the map API; user dialogue text is condensed into topic tags such as "weight loss diet consultation" and "code debugging help" using natural language processing technology; user browsing history is summarized into topic tags such as "low-fat, high-protein content" and "fitness training content"; and user feedback behavior is categorized as "positive feedback," "negative feedback," or "neutral feedback."
[0047] Next, proceed to S130. After the behavioral semantic tags are generated, the system retrieves relevant candidate preferences from a pre-defined candidate preference library based on the category and semantic similarity of these tags. The candidate preference library pre-maintains various preference categories, such as diet preferences, exercise preferences, writing preferences, code review preferences, and communication style preferences. The system does not randomly select candidate preferences but instead performs targeted retrieval based on the category of the behavioral semantic tags. For example, when the behavioral semantic tags are "weight loss diet theme" and "post-workout scenario," the system only retrieves candidate preferences related to diet and exercise, and not travel or shopping preferences.
[0048] After recalling candidate preferences, the system needs to verify whether the candidate preference is valid; this is step S140. Verification is achieved by acquiring multi-source evidence of the candidate preference and calculating the strength of the evidence from multiple dimensions. The sources of the evidence are consistent with the sources of the behavioral signals, including dialogue evidence, browsing evidence, location and context evidence, user feedback evidence, time relevance evidence, and contextual matching evidence.
[0049] The strength of dialogue evidence can be defined as , The calculation method involves the system segmenting the user's dialogue text into sentences and words, converting the segmented results into corpus vectors using embedding technology, and then calculating the similarity between the corpus vectors and the reference vectors corresponding to the candidate preferences. The specific implementation of the similarity measure can employ Euclidean distance or cosine similarity, which are common techniques used in vector space models to measure the semantic similarity between two vectors. The specific calculation method itself is not the focus of this application and will not be described in detail. Optionally, Euclidean distance can be chosen as the similarity measure. It can be understood that the smaller the Euclidean distance, the higher the semantic similarity between the dialogue content and the candidate preferences, and the stronger the dialogue evidence. Simultaneously, the system will distinguish the user's expression style; for example, affirmative sentences have higher evidence strength than interrogative or ambiguous expressions. For example, an affirmative sentence could be expressed as "I do like low-fat diets."
[0050] Optionally, the calculated similarity is normalized and then used as the strength of the dialogue evidence. At the same time, the system identifies the tone of the user's expression. Optionally, the strength of evidence for affirmative sentences is multiplied by a coefficient of 1.0, for interrogative sentences by a coefficient of 0.5, and for ambiguous expressions by a coefficient of 0.3.
[0051] Optionally, the strength of browsing evidence can be calculated using Formula 1. .
[0052] Formula 1. Wherein, The number of related pages. Total duration of stay This represents the number of times the item was accessed repeatedly. This refers to the weight coefficient of the relevant page. This is the weighting coefficient for the total stay duration. These three weighting coefficients are used to adjust the contribution of different browsing behavior indicators to the strength of browsing evidence, representing the weighting of repeat visit counts.
[0053] This is a page count normalization parameter, a positive integer, representing the upper limit of the number of relevant pages that the system considers sufficient to demonstrate the strength of evidence of user browsing activity. When the number of relevant pages viewed by the user is less than or equal to... hour, The value increases linearly between 0 and 1; when the number of relevant pages is greater than 1... At that point, the contribution was truncated to 1 and no longer increased with the number of pages. The value is set by the system based on historical data statistics, and its purpose is to prevent extreme values from a single dimension from dominating the overall strength of browsing evidence.
[0054] This is the normalized parameter for total dwell time, a preset positive real number threshold, expressed as the upper limit of the total dwell time that the system considers sufficient to reflect the strength of user browsing evidence. When the user's total dwell time is less than or equal to... hour, The value increases linearly between 0 and 1; when the total stay time is greater than 1... At that time, the contribution is 1 and no longer increases with time. The value is set by the system based on historical data statistics. Its purpose is to prevent an abnormally long user stay on a certain page from having an excessive impact on the overall strength of evidence.
[0055] This is a normalization parameter for the number of repeated visits, a preset positive integer threshold, expressed as the upper limit of the number of repeated visits that the system considers sufficient to reflect the strength of user browsing evidence. When the user's number of repeated visits is less than or equal to... hour, The value increases linearly between 0 and 1; when the number of repeated visits is greater than 1... At that point, the contribution was truncated to 1 and no longer increased with the number of visits. The value is set by the system based on historical data statistics. Its purpose is to prevent a small number of users from excessively accessing the same content, which could lead to a distortion of the strength of the evidence.
[0056] The min function in Formula 1 means taking the smaller of two values. Its function is to truncate the term to 1 when the actual value exceeds the normalization parameter, so as to avoid distortion caused by an excessively large value of a certain term.
[0057] Location and Scene Evidence Strength The system can determine the appropriateness of the preference based on the degree of match between the user's location scenario tags and the applicable scenario tags of the candidate preferences. If the user's location scenario tags and the applicable scenario tags of the candidate preferences are a perfect match, then... Equals 1.0, partial match is... Equals 0.5, if not a match It equals 0.
[0058] Strength of Evidence from User Feedback The calculation method can be used as formula 2. The system first counts the number of positive feedbacks given by users to content related to candidate preferences. and the number of negative feedback Then calculate according to Formula 2. Formula 2. If there is no feedback, then It is 0.
[0059] Strength of evidence in terms of time of relevance The calculation method is as follows: the system obtains the occurrence time of all behaviors that support the candidate preference, and calculates the weighted average recency according to the time decay function, with more recent behaviors having higher weights. See Formula 3 for the specific formula.
[0060] Formula 3, where Let be the time elapsed between the occurrence of the i-th action and the current time node. This is the attenuation coefficient.
[0061] Context matching evidence strength The calculation method is as follows: the system determines the degree of matching between the current context condition and the applicable context condition of the candidate preference, and calculates the proportion of the number of matching dimensions to the total number of dimensions. Specifically, the method for determining the degree of matching between the current context condition and the applicable context condition of the candidate preference can be consistent with the method for determining whether there is a difference between the first context condition and the second context condition in S321 to S322. For each dimension, the system determines whether the value of the current context condition in that dimension is consistent with the value of the applicable context condition of the candidate preference in that dimension. If they are consistent, the dimension is counted as a matching dimension. If they are inconsistent, the dimension is counted as a non-matching dimension.
[0062] The system combines the strength of evidence from the above six dimensions into a six-dimensional evidence vector, which is denoted as […]. The specific form is .in It is the strength of dialogue evidence. It is about browsing the strength of evidence. It is the strength of location and scene evidence. It is the strength of evidence from user feedback. It is the strength of evidence based on its relevance in time. This refers to the strength of evidence in context matching. Each strength of evidence ranges from 0 to 1, where 0 indicates no supporting evidence and 1 indicates the highest level of supporting evidence.
[0063] The system performs a weighted comprehensive score on the six dimensions of the evidence vector, which can be calculated using Formula 4.
[0064] Formula 4. Wherein, , , , , , These are the weight coefficients for each dimension, reflecting the importance of the evidence strength of the corresponding dimension in preference verification. This is a weighted composite score. If the weighted composite score... If the score is greater than or equal to a preset scoring threshold, the candidate preference is considered valid. For example, for the candidate preference "user prefers a low-fat, high-protein diet," if the user has repeatedly inquired about weight-loss diets in recent conversations (high strength of conversational evidence), browsed low-fat, high-protein related content (high strength of browsing evidence), frequently initiated diet-related conversations after exercising (high strength of location-based evidence), and explicitly rejected high-calorie dinners (high strength of user feedback evidence), then the candidate preference has high strength of multiple pieces of evidence, and after calculation using Formula 4, a weighted comprehensive score is obtained. If the score is greater than or equal to the preset scoring threshold, the system determines that the candidate preference is valid.
[0065] Once a candidate preference is verified to be valid, the system will identify that candidate preference as the current preference information.
[0066] In this embodiment, by acquiring multi-source behavioral signals of users and performing semantic processing on the multi-source behavioral signals to generate behavioral semantic tags, candidate preferences are recalled based on the behavioral semantic tags, and multi-source evidence of the candidate preferences is obtained to verify whether the candidate preferences are valid. When the candidate preferences are valid, the candidate preferences are determined as the current preference information. This realizes the reliable construction of preferences based on cross-validation of multi-source behavioral signals, which solves the problem in the prior art of mistakenly solidifying temporary interests into long-term preferences based on only a single dialogue text or a single signal, and improves the accuracy and reliability of preference recognition.
[0067] In one embodiment of this application, both the current preference information and the historical preference information are stored in the form of preference atoms. Each preference atom includes at least a preference content field, a preference category field, an evidence source field, a contextual condition field, a confidence field, a stability field, and a lifecycle status field.
[0068] Specifically, a preference atom is the basic data structure unit for storing preference information in the system. Each preference atom is a structured JSON object. A preference atom can include preference content fields, preference category fields, evidence source fields, context condition fields, confidence fields, stability fields, and lifecycle status fields.
[0069] The preference content field stores a specific description of the user's preferences in natural language text format. For example, the preference content field could be "The user prefers a low-fat, high-protein diet" or "The user prefers concise answers in work scenarios."
[0070] The preference category field identifies the category to which the preference belongs, using a hierarchical tag format. For example, "health.diet" represents a preference for healthy eating, "fitness.training" represents a preference for fitness training, and "communication.style" represents a preference for communication style. Hierarchical tags facilitate system aggregation, statistics, and categorized management by category.
[0071] The "Source of Evidence" field identifies the type of signal source supporting the preference, including one or more of the following: dialogue interaction signals, browsing behavior signals, location scene signals, and user feedback signals. This field is stored as an array; for example, ["dialogue","location_scene","browse_topic","feedback"] indicates that the preference is supported by all four types of signals: dialogue, location scene, browsing, and feedback.
[0072] The contextual condition field stores the scenario, task, or time condition to which the preference applies. This field is stored as an array and can contain information such as scenario type, task type, time window, and geographic location category. For example, ["workday_evening","after_fitness","weight_loss_stage"] indicates that the preference applies to three contextual conditions: weekday evening, after a workout, and the weight loss stage.
[0073] The confidence score field indicates the degree of certainty that the preference is true, and its value is a continuous number between 0 and 1. A higher value indicates greater certainty in the system's judgment that the preference is true. The confidence score is determined by the combined score of multiple source evidence vectors.
[0074] The stability field indicates the degree to which a preference tends to remain consistent over time, and takes a continuous value between 0 and 1. A higher value indicates that the preference is consistently supported by evidence over a longer period and is less prone to fluctuation. The system calculates the stability value based on the frequency of the preference's occurrence and changes in confidence levels across different time windows. For example, a preference that has consistently been supported by evidence over the past 30 days will have a higher stability value; if it only appears in the last 2 days, its stability value will be lower.
[0075] The lifecycle status field indicates the current active stage of the preference, including four states: rising, stable, decaying, and archived. The rising state indicates that the preference has been continuously strengthened recently, and the evidence supporting it is increasing; the stable state indicates that the preference has been stably supported for a long time, and the evidence supporting it remains at a certain level; the decaying state indicates that the evidence supporting the preference has weakened recently, and the attention it receives is decreasing; the archived state indicates that the preference has not been supported by evidence for a long time and has been moved to the history archive.
[0076] In this embodiment, a structured preference memory data model is constructed by storing both current preference information and historical preference information in the form of preference atoms. Each preference atom includes at least the fields of preference content, preference category, evidence source, contextual conditions, confidence level, stability, and lifecycle state. This provides a unified and complete data structure foundation for preference memory conflict detection, contextualized split storage, drift score calculation, and multi-dimensional decision-making.
[0077] In one embodiment of this application, before S200, the following steps S161 to S165 are further included: that is, before determining whether there is a preference conflict between the current preference information and the historical preference information, the following steps S161 to S165 are further included: S161, perform aggregate statistics on user preference information according to multiple preset time windows to generate short-term preference distribution, medium-term preference distribution and long-term preference distribution.
[0078] S162, calculate the first difference between the short-term preference distribution and the long-term preference distribution, and calculate the second difference between the medium-term preference distribution and the long-term preference distribution.
[0079] S163, calculate the preference drift score based on the first difference degree and the second difference degree.
[0080] S164, determine whether the preference drift score is greater than a preset preference drift score threshold.
[0081] S165, if the preference drift score is greater than the preset preference drift score threshold, then the step of determining whether there is a preference conflict between the current preference information and the historical preference information is executed. That is, if the preference drift score is greater than the preset preference drift score threshold, then S200 is executed.
[0082] Specifically, before performing preference conflict detection, the system first determines whether the user's preferences have changed significantly. This determination is achieved by calculating a preference drift score. This is the focus of this application.
[0083] In this embodiment, the system aggregates and statistically analyzes preferred atoms according to multiple preset time windows. In this embodiment, there are three preset time windows: a short-term time window, a medium-term time window, and a long-term time window. The short-term time window is 1 to 3 days from the current time point, the medium-term time window is 7 to 30 days from the current time point, and the long-term time window is a historical interval that is more than 30 days from the current time point or exists continuously for multiple periods.
[0084] For each preset time window, the system categorizes preference atoms based on the preference category field. Then, combining information such as the confidence level, stability, and frequency of occurrence of the preference atoms, the system calculates the weight of each preference category within that time window. This weight is a dimensionless numerical value; a higher weight indicates greater user interest in that category. For example, within a short time window, if users frequently discuss weight loss diets, the weight of the `health.diet` category might be 0.82; if users also frequently discuss fitness training, the weight of the `fitness.training` category might be 0.75.
[0085] Based on the above statistics, the system generates short-term, medium-term, and long-term preference distributions. Each preference distribution consists of multiple preference categories and their corresponding weights.
[0086] After generating three preference distributions, the system calculates the first degree of difference between the short-term and long-term preference distributions, and the second degree of difference between the medium-term and long-term preference distributions. The degree of difference is calculated as follows: for the target preference category, the absolute value of the difference between its weight in the short-term preference distribution and its weight in the long-term preference distribution is calculated as the first degree of difference; the absolute value of the difference between its weight in the medium-term preference distribution and its weight in the long-term preference distribution is calculated as the second degree of difference.
[0087] The calculation method for the first degree of difference is shown in Formula 5. The calculation method for the second degree of difference is shown in Formula 6. Formula 5. Formula 6. Wherein, The first degree of difference, For the second degree of difference, The weight of the target preference category in the short-run preference distribution. The weight of the target preference category in the intermediate preference distribution. This represents the weight of the target preference category in the long-term preference distribution.
[0088] Based on the first and second differences, the system calculates the preference drift score. The preference drift score is a comprehensive quantitative indicator used to measure the degree of change in user preferences over time. If the preference drift score is greater than a preset preference drift score threshold, it indicates that the user's preferences have changed significantly, requiring further detection of preference conflicts. If the preference drift score is less than or equal to the preset preference drift score threshold, it indicates that the user's preferences are relatively stable, and conflict detection does not need to be triggered; the system can skip subsequent steps to save computational resources.
[0089] In this embodiment, before determining whether a preference conflict exists, the preference information is aggregated and statistically analyzed according to multiple preset time windows to generate short-term, medium-term, and long-term preference distributions. The difference between short-term and long-term, and between medium-term and long-term, is calculated, and the preference drift score is calculated based on the difference. When the preference drift score is greater than a preset threshold, preference conflict detection is triggered. This achieves quantitative perception of user preference changes and on-demand triggering of conflict detection, solving the problem in the prior art where the lack of a clear drift detection mechanism makes it impossible to distinguish between short-term fluctuations and long-term trend changes, and improving the utilization efficiency of system computing resources.
[0090] In one embodiment of this application, S163 includes the following S163a to S163f, namely, calculating the preference drift score based on the first difference degree and the second difference degree includes the following S163a to S163f: S163a, obtain the frequency of occurrence of the topic corresponding to the target preference category within a preset time window of the short-term preference distribution, and denote it as the first frequency of occurrence. The target preference category is the preference category currently being evaluated.
[0091] S163b, obtain the frequency of occurrence of the topic corresponding to the target preference category within a preset time window of the mid-term preference distribution, and denot it as the second frequency of occurrence.
[0092] S163c, obtain the frequency of occurrence of the topic corresponding to the target preference category within a preset time window of the long-term preference distribution, and denot it as the third frequency of occurrence.
[0093] S163d, calculate the short-term-long-term frequency growth rate of the topic corresponding to the target preference category based on the first occurrence frequency and the third occurrence frequency, and calculate the medium-term-long-term frequency growth rate of the topic corresponding to the target preference category based on the second occurrence frequency and the third occurrence frequency.
[0094] S163e, obtain the changes in the number of evidence sources, changes in contextual conditions, and changes in user feedback direction corresponding to the target preference category.
[0095] S163f, calculate the preference drift score based on the weighted sum of the first difference degree, the second difference degree, the short-term to long-term frequency growth rate, the medium-term to long-term frequency growth rate, the change in the number of evidence sources, the change in contextual conditions, and the change in user feedback direction.
[0096] Specifically, this embodiment describes the specific calculation method for preference drift score. The calculation of preference drift score involves changes in multiple dimensions, which together constitute a comprehensive quantitative indicator.
[0097] First, the system obtains the frequency of occurrence of topics corresponding to the target preference category within different time windows. The target preference category refers to the preference category currently being evaluated, such as health.diet. A topic refers to the specific content within that preference category, such as "fat-loss diet" or "high-protein intake." The first frequency of occurrence refers to the number of times the topic is mentioned or followed by users within a short-term time window; the second frequency of occurrence refers to the number of times the topic is mentioned or followed within a medium-term time window; and the third frequency of occurrence refers to the number of times the topic is mentioned or followed within a long-term time window.
[0098] For example, if a user mentions "weight loss diet" 8 times in the last 3 days, the first frequency is 8; if they mention it 20 times in the last 30 days, the second frequency is 20; and if they mention it 15 times in the last 3 months, the third frequency is 15.
[0099] After obtaining the three frequencies of occurrence, the system calculates the growth rates of the two frequencies. The short-term-long-term frequency growth rate is calculated by first calculating the difference between the first and third frequencies of occurrence, then dividing the difference by the third frequency of occurrence, and then multiplying by 100%. This gives the short-term-long-term frequency growth rate, which measures the growth rate of a topic in the short term relative to the long term.
[0100] The formula for calculating the medium- to long-term frequency growth rate is as follows: first, calculate the difference between the second and third frequencies of occurrence; then divide the difference by the third frequency of occurrence; and finally multiply by 100%. The result is the medium- to long-term frequency growth rate, which is used to measure the growth rate of a theme in the medium term relative to the long term.
[0101] Both growth rates operate on the same principle: a positive growth rate indicates that users' interest in the topic is increasing, while a negative growth rate indicates that interest is decreasing.
[0102] Continuing with the previous example: Short-term - Long-term frequency growth rate = (8-15) / 15 = -0.47, indicating that users' short-term attention to "weight loss diet" is lower than the long-term average; Medium-term - Long-term frequency growth rate = (20-15) / 15 = 0.33, indicating that medium-term attention has increased.
[0103] Simultaneously, the system acquires information on changes in the number of evidence sources, changes in contextual conditions, and changes in the direction of user feedback corresponding to the target preference category. Changes in the number of evidence sources refer to the increase or decrease in the number of signal source types supporting the preference across different time windows. For example, previously only conversational evidence supported "user's interest in weight loss," but now, in addition to location evidence (such as the user being at a gym) and browsing evidence (such as the user browsing weight loss videos), the number of evidence sources has increased from 1 to 3.
[0104] A change in context refers to whether the context in which a preference applies has changed between different time windows. For example, the preference for a "fat-loss diet" used to only appear in the context of post-workout activities, but now it has been extended to lunchtime as well, indicating a change in context.
[0105] A change in user feedback direction refers to whether a user's attitude towards content related to their preference has shifted across different time windows. For example, previously, users would all like recommendations for high-protein content, but recently they have started frequently correcting users to "avoid high-protein content," indicating a change in feedback direction.
[0106] Finally, the system calculates the preference drift score according to Formula 7.
[0107] Formula 7. Wherein, This is the preference drift score. The first degree of difference, For the second degree of difference, This represents the short-term to long-term frequency growth rate. For medium- to long-term frequency growth rates, Due to changes in the number of sources of evidence, Due to changes in context, The direction of user feedback changes. , , , , , , These are all configurable weighting coefficients, which are used to adjust the contribution ratio of each dimension to the total score.
[0108] Through the above multidimensional weighted calculation, the system obtains a comprehensive preference drift score, which can fully reflect the degree of change in user preferences across multiple dimensions such as time, evidence, context, and feedback.
[0109] In this embodiment, the frequency of occurrence of the topic corresponding to the target preference category within a preset time window of short-term, medium-term, and long-term preference distribution is obtained and recorded as the first, second, and third occurrence frequencies, respectively. The short-term-long-term frequency growth rate is calculated based on the first and third occurrence frequencies, and the medium-term-long-term frequency growth rate is calculated based on the second and third occurrence frequencies. Combined with changes in the number of evidence sources, changes in contextual conditions, and changes in user feedback direction, the changes in the above multiple dimensions are weighted and summed to calculate the preference drift score. This achieves a multi-dimensional quantitative assessment of preference drift, solving the problem in the prior art that the preference change is based on only a single statistical distance metric, resulting in a single perception dimension and ignoring evidence evolution and scene migration. This improves the comprehensiveness and accuracy of drift detection.
[0110] In one embodiment of this application, after S320, S340 is further included. That is, after determining whether there is a difference between the first context condition and the second context condition, the method further includes: S340, if there is no difference between the first context condition and the second context condition, then a preference memory update operation is performed. The preference memory update operation includes overwriting the historical preference information with the current preference information.
[0111] Specifically, when the system determines that there is no difference between the first and second contextual conditions, it indicates that the conflict between current and historical preference information is not caused by differences in contextual conditions. In this case, the preference conflict reflects a real change in user preferences, rather than different preference expressions in different scenarios.
[0112] At this point, the system performs an overriding preference memory update operation: replacing historical preference information with current preference information. This means the system recognizes that the user's preferences have substantially changed, and the old preferences are no longer applicable. For example, if a user previously preferred detailed explanations but now explicitly states that they prefer concise answers in all scenarios, and the context has not changed, then the system will replace "the user prefers detailed explanations" with "the user prefers concise answers".
[0113] In this embodiment, by performing a preference memory update operation when there is no difference between the first context condition and the second context condition, the current preference information is used to overwrite the historical preference information. This achieves preference update processing when preference conflict does not involve differences in context conditions. This complements the split storage operation mentioned above when there are differences in context conditions, thus constructing a complete preference conflict handling system and ensuring that there are corresponding processing strategies under different conflict causes.
[0114] In one embodiment of this application, after S200, the following steps are further included: S410 to S430. After determining whether there is a preference conflict between the current preference information and the historical preference information, the following steps are further included: S410, if there is no preference conflict between the current preference information and the historical preference information, then obtain the confidence level of the historical preference information, the semantics of the current preference information, and the semantics of the historical preference information.
[0115] S420, determine whether the semantic similarity between the semantics of the current preference information and the semantics of the historical preference information is greater than or equal to the semantic similarity threshold.
[0116] S430, if the semantic similarity between the semantics of the current preference information and the semantics of the historical preference information is greater than or equal to the semantic similarity threshold, then the confidence level of the historical preference information is enhanced based on the current preference information.
[0117] Specifically, when the system determines that there is no preference conflict between the current preference information and the historical preference information, it means that the two preference information are semantically consistent or at least not contradictory. In this case, the current preference information can serve as supplementary evidence to the historical preference information, thereby enhancing the credibility of the historical preference information.
[0118] The system first acquires the confidence level of historical preference information, the semantic content of current preference information, and the semantic content of historical preference information. Then, the system determines whether two pieces of semantic content point to the same preference by calculating their semantic similarity. The semantic similarity calculation can employ vectorization combined with Euclidean distance. Specifically, the text content of both current and historical preference information is converted into semantic vectors using embedding technology, and then the Euclidean distance between the two vectors is calculated. A smaller distance indicates higher semantic similarity.
[0119] If the semantic similarity is greater than or equal to a preset semantic similarity threshold, it indicates that the current preference information and the historical preference information are highly consistent in content, and the current preference information is a reaffirmation of the same preference. In this case, the system enhances the confidence level of the historical preference information based on the current preference information, i.e., increases the confidence level value of the historical preference information. The extent of the confidence enhancement can be adjusted according to the strength of evidence of the current preference information.
[0120] For example, the historical preference information is "the user prefers a low-fat, high-protein diet," with a confidence level of 0.72. The current preference information is "the user again expressed a liking for low-fat, high-protein foods," and the semantic similarity is judged to be highly consistent. The system increases the confidence level of the historical preference information from 0.72 to 0.86.
[0121] In this embodiment, by obtaining the confidence level of historical preference information and the semantics of current preference information and historical preference information when there is no preference conflict between current preference information and historical preference information, and enhancing the confidence level of historical preference information based on current preference information when the semantic similarity is greater than or equal to the semantic similarity threshold, the credibility of existing preferences is enhanced under the condition of no conflict and semantic consistency. This solves the problem that the confidence level fails to be updated in time when multiple sources of evidence continuously support preferences, resulting in a mismatch between the strength of preference memory and actual evidence, and enables the confidence level of preferences to be adaptively enhanced as evidence accumulates.
[0122] In one embodiment of this application, the system further performs a preference memory retrieval and application step. This step is independent of the aforementioned preference conflict detection and preference memory update operations, and can be performed when one or more preference memories are already stored in the preference memory bank, specifically including the following W100 to W300: In one embodiment of this application, the context-based user preference management method further includes: W100 receives the current interaction request and obtains the current context conditions corresponding to the current interaction request.
[0123] W200, based on the current context conditions, recalls preference memories that match the current context conditions from the preference memory bank, and defines the preference memories that match the current context conditions as recalled preference memories.
[0124] W300 injects the recalled preference memory into the target language model and obtains the response information output by the target language model.
[0125] Specifically, the preference memory stores multiple preference memories, each carrying its applicable context conditions. When a user initiates a new interaction request, the system receives the request and extracts the current context conditions corresponding to the current interaction request.
[0126] The current context conditions are extracted in the same way as those obtained previously, i.e., by parsing information such as scenario type, task type, time window, and geographic location category from the current interaction request. For example, if a user asks about code debugging issues through the app at 10:15:30 PM on a weekday, this is the so-called "current interaction request." In this case, the corresponding current context conditions extracted by the system might be: scenario type is technical troubleshooting scenario, task type is code debugging, time window is weekday evening, and geographic location category is office area.
[0127] After extracting the current context condition, the system iterates through all preference memories in the preference memory bank, comparing the current context condition with the context conditions stored in each preference memory. The comparison method is consistent with the difference judgment method described in S321 to S322, that is, matching is performed on dimensions such as scene type, task type, time window, and geographical location category. If the current context condition matches the context condition of a preference memory in all dimensions or reaches a preset matching threshold, then the preference memory is marked as a preference memory that matches the current context condition.
[0128] For example, if the current context is "technical investigation scenario" + "weekday evening", and preference memory M1 exists in the preference memory bank with the same context, then the system will recall preference memory M1. Preference memory M2, however, has a context of "social media copywriting scenario" + "weekend afternoon", which does not match the current context, so it will not be recalled.
[0129] The recalled preference memories are converted into an input format that the target language model can understand and injected into the prompt information of the target language model. When generating response information, the target language model will refer to the preference content contained in the recalled preference memories, so that the output response information matches the user's preferences under the current context.
[0130] In this embodiment, after storing the current preference information as a first preference memory associated with the first context condition and storing the historical preference information as a second preference memory associated with the second context condition, the current interaction request is received and the corresponding current context condition is obtained. Based on the current context condition, the preference memory that matches the context condition is recalled from the first preference memory and the second preference memory and injected into the target language model to generate response information. This realizes the closed-loop application of scenario-based accurate recall of preference memory and personalized response of large model, solves the problem of inaccurate response caused by the activation of global preference labels in the wrong scenario in the prior art, and improves the matching degree between personalized response and current scenario.
[0131] In one embodiment of this application, W300 is followed by W400 to W620, which, after the statement that if there is a difference between the first context condition and the second context condition, the preference memory update operation is performed, further include W400 to W620: W400 obtains feedback information on the user's response to the output of the target language model.
[0132] W500 parses the feedback information and determines whether the user's response to the output of the target language model is positive feedback.
[0133] W610, if the user's feedback to the response information output by the target language model is positive, then the confidence of the recalled preference memory is increased.
[0134] W620, if the user's feedback to the response information output by the target language model is not positive, then the confidence of the recalled preference memory is reduced or the recalled preference memory is deleted.
[0135] Specifically, after the system generates response information based on the recalled preference memory and outputs the response information to the user, the user will generate implicit or explicit feedback behavior to the response information. The system collects this feedback information and performs closed-loop correction on the recalled preference memory used to generate the response information accordingly.
[0136] Feedback information includes two types: explicit feedback and implicit feedback. Explicit feedback refers to the user's proactively expressed attitude, such as the user explicitly saying, "Yes, I'll do it this way from now on," "No, I'm just asking today," or "Don't remember this." Implicit feedback refers to the user's behavioral response, such as the user accepting the suggestion, continuing to ask follow-up questions, expressing dislike, manually deleting it from memory, requesting to remember it in the future, or requesting that it not be mentioned again.
[0137] After receiving feedback, the system analyzes and categorizes it to determine whether it is positive or negative. Positive feedback refers to user actions that indicate approval, acceptance, or satisfaction with the response, such as liking, saving, accepting suggestions, or explicitly agreeing. Negative feedback refers to user actions that indicate disapproval, dissatisfaction, or rejection of the response, such as disliking, reporting errors, explicitly expressing dislike, or manually deleting the response from memory.
[0138] If the feedback is positive, it indicates that the recalled preference memory is valid under the given context. The system increases the confidence level of the recalled preference memory, giving it a higher priority in future recalls. If the feedback is negative, it indicates that the recalled preference memory may be inaccurate or inapplicable under the given context. The system decreases the confidence level of the recalled preference memory or deletes it directly to prevent this erroneous memory from having a long-term impact on subsequent personalized responses.
[0139] In this embodiment, by acquiring and parsing the user's response information to the target language model's output, the system determines whether the feedback is positive. When the feedback is positive, the confidence of the second preference memory is increased; when the feedback is negative, the confidence of the second preference memory is decreased or the second preference memory is deleted. This achieves closed-loop correction of preference memory based on user feedback, solving the problem that erroneous preference memory has a long-term impact on the output of the large model and cannot be automatically corrected. This allows preference memory to be continuously optimized based on user feedback, improving the adaptive capability and long-term accuracy of the preference management system.
[0140] This application also provides a context-based user preference management system.
[0141] In one embodiment of this application, the context-based user preference management system includes: At least one memory is configured to store computer-executable instructions.
[0142] At least one processor is configured to execute the computer-executable instructions. When executed by the at least one processor, the computer-executable instructions implement a context-conditional user preference management method as mentioned in any of the foregoing embodiments.
[0143] Specifically, the context-conditional user preference management system further includes a signal acquisition module for collecting multi-source user behavior signals and a preference memory bank for storing preference atoms. The signal acquisition module collects location behavior signals, dialogue interaction signals, and user feedback signals through the location interface, interaction interface, and log interface of the intelligent question-and-answer client, respectively, and collects browsing behavior signals through a browsing behavior tracking module. The collected raw signals are processed through semantic processing and de-identification to generate behavioral semantic tags, which are then used by the preference management module to perform preference conflict detection, context condition difference judgment, and preference memory update operations.
[0144] In one embodiment of this application, in S100, obtaining the user's preference information includes obtaining historical preference information. Historical preference information is directly read from the preference memory. The preference memory is a database or storage system used by the system to persistently store preference atoms. When the system starts or needs to execute a preference management process, it queries the stored preference atoms from the preference memory and uses the query results as historical preference information. For new users or when there are no records in the preference memory, the historical preference information is an empty set, and the system directly writes the current preference information as a new preference into the preference memory without performing conflict detection and splitting operations.
[0145] In one embodiment of this application, the preference atom may further include a recentity field and a drift state field. The recentity field indicates how recent the preference is, taking a continuous value between 0 and 1. A higher recentity value indicates a higher frequency of evidence supporting the preference in the recent past. The drift state field indicates the current direction of change of the preference, including three states: positive drift, negative drift, and scenario shift. Positive drift means the preference strength is increasing. Negative drift means the preference strength is decreasing. Scenario shift means the applicable scenario of the preference is changing.
[0146] Below is an example of a specific form of preferred atom.
[0147] { "preference_content": "Users prefer a low-fat, high-protein diet", "preference_category": "health.diet", "evidence_sources": ["dialogue", "location_scene", "browse_topic", "feedback"], "context_conditions": ["workday_evening", "after_fitness", "weight_loss_stage"], "confidence": 0.86, "stability": 0.72, "recency": 0.91, "sensitivity_level": "medium", "lifecycle_state": "rising", "drift_state": "positive_drift", "last_updated_time": "2026-06-30" } In this preference atom, preference_content is the preference content field; preference_category is the preference category field; evidence_sources is the evidence source field; context_conditions is the context conditions to which this preference applies; confidence is the confidence level of the current preference; stability is the stability of this preference; recency is the recency of this preference; sensitivity_level is the privacy sensitivity level of this preference; lifecycle_state is the lifecycle state of the preference; drift_state is the drift direction of the preference; and last_updated_time is the last update time field.
[0148] In one embodiment of this application, the system also performs a preference merging operation. When multiple preference atoms are semantically similar, have similar contextual conditions, and have a high degree of overlap in evidence sources, the system merges the multiple preference atoms into a more stable preference memory.
[0149] The specific process of the merging operation may include: the system calculates the semantic similarity between multiple preference atoms. If the semantic similarity exceeds a preset merging threshold, the common part of the preference content of the multiple preference atoms is extracted as the merged preference content. Further, the evidence sources of the multiple preference atoms are merged. Further, the contextual conditions of the multiple preference atoms are merged. Further, the confidence scores of the multiple preference atoms are weighted and averaged to obtain the merged confidence score. The maximum stability value of the multiple preference atoms is taken as the merged stability.
[0150] For example, preference atom A is "users are concerned about fat loss", preference atom B is "users are concerned about low-calorie diets", and preference atom C is "users are concerned about what to eat after training". The three are semantically similar and have overlapping contexts, so the system merges them into a new preference atom: "users are in the fat loss stage and are concerned about low-calorie, high-protein diets after training".
[0151] In one embodiment of this application, the system also performs a preference deweighting operation. When a preference atom is not supported by new behavioral evidence within a preset time window, or when the correlation between the user's recent behavior and the preference atom decreases, the system reduces the weight of the preference atom.
[0152] The specific process for the deweighting operation is as follows: The system periodically checks the last update time field of all preference atoms. If the last update time of a preference atom is more than a preset decay time window away from the current time, the confidence of that preference atom is reduced according to the time decay function. If the confidence drops below the preset archiving threshold, the system moves that preference atom from the preference memory to the historical archive.
[0153] For example, if a user once followed a travel destination but did not browse related content, mention it in conversations, or provide any feedback within three months, the system will downgrade that preference from a current active preference to a historical preference.
[0154] In one embodiment of this application, the acquisition method of multi-source behavioral signals is explained below.
[0155] Firstly, an optional method for collecting location behavior signals is provided. Each time a user opens the app and enters the homepage, the system obtains the user's GPS coordinates through the operating system's location service interface. If the user has not enabled location permissions, the system will display a prompt guiding the user to grant authorization. The obtained GPS coordinates are used as intermediate data in subsequent scene tag conversion; after conversion, they are discarded immediately and not written to the database. The system also obtains information about nearby businesses through partner API interfaces, such as nearby gyms, restaurants, and shopping malls via the Dianping API.
[0156] Secondly, we introduce a method for collecting browsing behavior signals. The system records the page paths visited by users, the duration of stay on each page, the topic tags of the page content, and the user's repeated visits through the browsing tracking module within the app.
[0157] Another optional method for collecting dialogue interaction signals is for the system to record every interaction between the user and the chatbot through the dialogue management module, including the text content entered by the user, the number of dialogue rounds, the number and depth of follow-up questions asked by the user, and the number of times the user corrects errors.
[0158] Finally, the methods for collecting user feedback signals may include the system recording user actions such as liking, saving, accepting, rejecting, modifying, deleting, and re-asking questions in response to system outputs through a feedback collection module.
[0159] In one embodiment of this application, the process of generating scene tags in behavioral semantic tags is described.
[0160] Optionally, the system generates one or more candidate scene labels based on the anonymized location behavior features. For example, if a user is located in a business district, the system generates multiple candidate scene labels such as "commercial scene," "shopping scene," "dining scene," and "leisure and entertainment scene," with each candidate scene label having an initial candidate confidence level.
[0161] Furthermore, when the confidence level of a candidate scenario label falls below a preset threshold, the system adjusts the label by incorporating other signals. These signals include one or more of the following: browsing topics, conversation topics, application usage behavior, temporal context, task context, and historical access patterns. For example, if a user is located in a commercial area, the location signal alone is insufficient to determine the user's specific scenario. The system further incorporates the following signals: the current time is dinner time, the user has browsed content related to low-fat diets, and the user asked in a conversation, "What should I eat tonight to avoid gaining weight?" In these cases, the system increases the confidence level of "dining scenario" and "fat-loss diet scenario," ultimately generating the adjusted scenario label "evening fat-loss diet decision scenario."
[0162] The process of generating scene labels can be summarized as follows: first, the original behavioral signals are acquired; then, multiple candidate scene labels are generated; further, the candidate scene labels are corrected and confirmed using multi-source signals; finally, the final scene label is obtained. One behavioral signal can generate multiple candidate labels, and multiple behavioral signals can jointly confirm the same final label.
[0163] In one embodiment of this application, semantic markup processing further includes desensitization processing. Specific implementation methods for desensitization processing are described below.
[0164] The system converts precise GPS coordinates into region or scene categories by calling the map API. For example, it converts latitude and longitude coordinates (30.2741°N, 120.1551°E) into "City A, District A or Street A - Fitness Area". The system converts specific addresses or point-of-interest (POI) names into POI categories, such as converting "XXX Gym" into the category "Gym". The system converts precise times into time periods, such as converting "19:23:45 on 2026-08-31" into "Weekday Evening". The system converts continuous location trajectories into movement patterns, such as converting a series of GPS coordinates into movement pattern labels like "Commuting" or "Shopping".
[0165] After the above anonymization process, the system no longer needs to save the original GPS coordinates, complete browsing history, or complete conversation content. It only needs to save the converted abstract tags and their confidence levels, evidence sources, and sensitivity levels. The anonymization process reduces the risk of storing user privacy data while preserving the semantic information required for preference management.
[0166] In another embodiment of this application, the lifetime state field of the preferred atom includes rising state, stable state, decaying state and archived state.
[0167] An upward trend indicates that the preference has been continuously strengthened recently. If the system detects that the confidence level and frequency of the preference are higher in the short-term time window than in the medium- and long-term time windows, and that this trend is upward, then the life cycle state of the preference is marked as an upward trend.
[0168] A stable state indicates that the preference is consistently supported over a long period. If the system detects that the confidence level and frequency of occurrence of the preference remain at a high level and fluctuate little across the short-term, medium-term, and long-term time windows, then the lifecycle state of the preference is marked as a stable state.
[0169] A decaying state indicates that recent evidence supporting the preference is weakening. If the system detects that the confidence and frequency of the preference are lower in the short-term time window than in the medium- and long-term time windows, and that this trend is decreasing, then the lifecycle state of the preference is marked as a decaying state.
[0170] An archived state indicates that the preference has not been supported by evidence for a long period of time. If the system detects that the preference has not been supported by any new behavioral evidence within a preset archiving time window, it will mark the lifecycle state of the preference as archived and move it from the active preference memory to the history archive.
[0171] In another embodiment of this application, the system identifies the specific type of preference drift based on the contribution of each dimension of the preference drift score.
[0172] When the preference drift score is primarily contributed by the first degree of difference and the short-to-long-term frequency growth rate, the system classifies it as a positive drift, indicating that the user's attention to that preference has increased rapidly in the short term. For example, if a user rarely consults about diet in the long term but has frequently consulted about weight loss diets in the last 10 days, then the health.diet category preference will show a positive drift.
[0173] When the preference drift score is primarily contributed by negative changes in the quantity of evidence sources and the direction of user feedback, the system classifies it as negative drift, indicating that the user's attention to the preference is decreasing. For example, if a user has long enjoyed a certain type of content but recently stops browsing, engaging with, or providing feedback, then that preference exhibits decay drift.
[0174] When the preference drift score is primarily contributed by changes in contextual conditions, the system determines it as a scenario migration, indicating that the applicable scenario for the preference has changed. For example, if a user prefers formal expressions in a work setting but prefers humorous expressions in a social media setting, then the preference has migrated between different scenarios.
[0175] It should be noted that the above embodiments of this application can be implemented individually or coupled and connected in series. The following description uses a complete application scenario to illustrate an embodiment formed by connecting the above embodiments in series.
[0176] Suppose user A uses the dialogue service on a smart question-and-answer app. The system obtains the user's GPS coordinates through the app's location interface, records the dialogue content between the user and the chatbot through the dialogue management module, records the content browsed by the user through the browsing tracking module, and records the user's feedback behavior to the system's answers through the feedback collection module.
[0177] The system converts GPS coordinates into a "gym" scene label using a map API, condenses conversation content into a "post-workout diet consultation" topic label using natural language processing, and categorizes browsing history into a "low-fat, high-protein diet" topic label. Based on these behavioral semantic tags, the system retrieves "user preference for low-fat, high-protein diet" from the candidate preference library as candidate preferences.
[0178] The system obtains multi-source evidence for the candidate preference: the user mentioned weight loss diets 5 times in conversations over the past 3 days (high strength of conversation evidence), browsed 3 articles related to low-fat, high-protein content (high strength of browsing evidence), the location scenario tag is "gym" and matches the applicable scenario of the candidate preference (high strength of location scenario evidence), and the user liked previous related suggestions (high strength of user feedback evidence). The system combines the above evidence strengths into a six-dimensional evidence vector. If the comprehensive score exceeds the verification threshold, the candidate preference is determined to be valid and identified as the current preference information.
[0179] The system reads historical preference information from the preference memory and finds a historical preference for "users prefer whole milk as a post-training supplement" with a confidence level of 0.78. The system determines that there is a preference conflict between the current preference information and the historical preference information, that is, a conflict exists between the preferences for low-fat high-protein and whole milk.
[0180] The system retrieves the first contextual condition corresponding to the current preference information: scenario type is "fitness scenario," task type is "diet planning," time window is "weekday evening," and geographical location category is "gym." It also retrieves the second contextual condition corresponding to historical preference information: scenario type is "home scenario," task type is "daily diet," time window is "any time," and geographical location category is "at home." The system determines that the first and second contextual conditions are inconsistent across all four dimensions: scenario type, task type, time window, and geographical location category.
[0181] The system performs a preference memory update operation, specifically associating the current preference information "user prefers a low-fat, high-protein diet" with the first contextual condition (fitness scenario + weekday evening + gym) and storing it as the first preference memory. The system also associates the historical preference information "user prefers whole milk as a post-workout supplement" with the second contextual condition (home scenario + any time + at home) and stores it as the second preference memory. The two preference memories are stored independently and do not interfere with each other.
[0182] When user A opens the app again on a weekday evening and asks "What to eat tonight?", the system receives the current interaction request and extracts the current context conditions as "fitness scenario" + "weekday evening" + "gym". Based on these context conditions, the system retrieves a matching preference memory from the preference memory bank. Since the context conditions of the first preference memory match the current context conditions, it is successfully retrieved. The system then injects the preference content "user prefers a low-fat, high-protein diet" from the first preference memory into the target language model. The target language model then generates the response "suggests chicken breast with a vegetable salad".
[0183] When a user likes the response, the system receives this positive feedback, increases the confidence level of the first-preference memory, and the entire process ends.
[0184] The technical features of the above embodiments can be combined arbitrarily, and the execution order of the method steps is not restricted. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0185] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A user preference management method based on contextual conditionation, characterized in that, include: Obtain user preference information; The user's preference information includes current preference information and historical preference information; Determine whether there is a preference conflict between the current preference information and the historical preference information; If there is a preference conflict between the current preference information and the historical preference information, then obtain the first context condition corresponding to the current preference information and the second context condition corresponding to the historical preference information; Determine whether there is a difference between the first context condition and the second context condition; If there is a difference between the first context condition and the second context condition, a preference memory update operation is performed; the preference memory update operation includes associating the current preference information with the first context condition and storing it as a first preference memory, and associating the historical preference information with the second context condition and storing it as a second preference memory.
2. The user preference management method based on contextual conditionalization according to claim 1, characterized in that, Determining whether there is a difference between the first context condition and the second context condition includes: Determine whether the first context condition and the second context condition are inconsistent in at least one dimension of scene type, task type, time window, and geographic location category; If the first context condition and the second context condition are inconsistent in at least one dimension of scene type, task type, time window, or geographical location category, then it is determined that there is a difference between the first context condition and the second context condition.
3. The user preference management method based on contextual conditionalization according to claim 1, characterized in that, The acquisition of user preference information includes: Acquire user's multi-source behavioral signals; Semantic processing is performed on users' multi-source behavioral signals to generate behavioral semantic tags; Candidate preferences are recalled based on the aforementioned behavioral semantic tags; Obtain multi-source evidence of the candidate preference, and verify whether the candidate preference is valid based on the multi-source evidence; If the candidate preference is valid, then the candidate preference is determined as the current preference information.
4. The user preference management method based on contextual conditionalization according to claim 3, characterized in that, Both the current preference information and the historical preference information are stored in the form of preference atoms. Each preference atom includes at least a preference content field, a preference category field, an evidence source field, a contextual condition field, a confidence field, a stability field, and a lifecycle status field.
5. The user preference management method based on contextual conditionalization according to claim 1, characterized in that, Before determining whether there is a preference conflict between the current preference information and the historical preference information, the method further includes: The user's preference information is aggregated and statistically analyzed according to multiple preset time windows to generate short-term preference distribution, medium-term preference distribution and long-term preference distribution; Calculate a first degree of difference between the short-term preference distribution and the long-term preference distribution, and calculate a second degree of difference between the medium-term preference distribution and the long-term preference distribution; Calculate the preference drift score based on the first difference and the second difference; Determine whether the preference drift score is greater than a preset preference drift score threshold; If the preference drift score is greater than the preset preference drift score threshold, then the step of determining whether there is a preference conflict between the current preference information and the historical preference information is performed.
6. The user preference management method based on contextual conditionalization according to claim 5, characterized in that, The step of calculating the preference drift score based on the first difference and the second difference includes: The frequency of occurrence of the topic corresponding to the target preference category within a preset time window of the short-term preference distribution is obtained and denoted as the first frequency of occurrence; the target preference category is the preference category currently being evaluated. The frequency of occurrence of the topic corresponding to the target preference category within a preset time window of the intermediate preference distribution is obtained and denoted as the second frequency of occurrence. The frequency of occurrence of the topic corresponding to the target preference category within a preset time window of the long-term preference distribution is obtained and denoted as the third frequency of occurrence. The short-term-long-term frequency growth rate of the topic corresponding to the target preference category is calculated based on the first occurrence frequency and the third occurrence frequency, and the medium-term-long-term frequency growth rate of the topic corresponding to the target preference category is calculated based on the second occurrence frequency and the third occurrence frequency; Obtain changes in the quantity of evidence sources, changes in contextual conditions, and changes in user feedback direction corresponding to the target preference category; The preference drift score is calculated based on a weighted sum of the first degree of difference, the second degree of difference, the short-term to long-term frequency growth rate, the medium-term to long-term frequency growth rate, the change in the number of evidence sources, the change in contextual conditions, and the change in the direction of user feedback.
7. The user preference management method based on contextual conditionalization according to claim 1, characterized in that, After determining whether there is a difference between the first context condition and the second context condition, the method further includes: If there is no difference between the first context condition and the second context condition, then a preference memory update operation is performed; the preference memory update operation includes overwriting the historical preference information with the current preference information.
8. The user preference management method based on contextual conditionalization according to claim 1, characterized in that, After determining whether there is a preference conflict between the current preference information and the historical preference information, the method further includes: If there is no preference conflict between the current preference information and the historical preference information, then obtain the confidence level of the historical preference information, the semantics of the current preference information, and the semantics of the historical preference information; Determine whether the semantic similarity between the semantics of the current preference information and the semantics of the historical preference information is greater than or equal to a semantic similarity threshold; If the semantic similarity between the current preference information and the historical preference information is greater than or equal to a semantic similarity threshold, then the confidence level of the historical preference information is enhanced based on the current preference information.
9. The user preference management method based on contextual conditionalization according to claim 1, characterized in that, Also includes: Receive the current interaction request and obtain the current context conditions corresponding to the current interaction request; Based on the current context conditions, retrieve preference memories that match the current context conditions from the preference memory bank, and define the preference memories that match the current context conditions as the retrieved preference memories; The recalled preference memory is injected into the target language model to obtain the response information output by the target language model.
10. The user preference management method based on contextual conditionalization according to claim 9, characterized in that, After injecting the recalled preference memory into the target language model and obtaining the response information output by the target language model, the method further includes: Obtain feedback information from the user's response to the output of the target language model; Analyze the feedback information to determine whether the user's response to the output of the target language model is positive feedback; If the user's response to the output of the target language model is positive, the confidence of the recalled preference memory is increased. If the user's response to the output of the target language model is not positive, the confidence level of the recalled preference memory is reduced or the recalled preference memory is deleted.