Life service agent decision reasoning method based on user preference
By combining the entropy weight method and the C4.5 decision tree model, the problems of simple decision logic and insufficient interpretability of existing decision reasoning algorithms in life service scenarios are solved. This enables the quantification of user preferences and the feasibility and interpretability of recommendation results, thereby improving user experience and trust.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG GUOLI EDUCATION TECH CO LTD
- Filing Date
- 2026-02-10
- Publication Date
- 2026-05-15
AI Technical Summary
Existing decision-making reasoning algorithms suffer from problems such as simplistic decision-making logic, neglect of dynamic constraints, and lack of interpretability in life service scenarios. They fail to meet users' multi-objective decision-making needs, and the recommended results cannot be actually implemented, resulting in low user experience and trust.
The entropy weight method is used to quantify user preferences, and candidate set filtering is performed in combination with real-time scene data. A multi-objective utility function is used for comprehensive scoring, and the C4.5 decision tree model is used for final screening to output the optimal decision result and its natural language recommendation reason.
It achieves objectivity in quantifying user preferences, ensures the feasibility of recommendation results in real-world scenarios, improves the accuracy and interpretability of decision-making, and enhances users' trust in and adoption rate of recommendation results.
Smart Images

Figure CN122048487A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence and intelligent decision recommendation technology, specifically to a decision-making and reasoning method for intelligent agents in life services based on user preferences. It can be applied to life service (O2O) scenarios and can combine user personalized preferences, real-time scenario constraints and multi-objective optimization strategies to achieve highly accurate automatic decision-making and reasoning. Background Technology
[0002] With the widespread application of large model-driven agents in the life services sector, users' functional requirements for agents are no longer limited to "understanding instructions," but also include the ability to "make decisions for me," such as directly ordering the most suitable lunch for the user or recommending entertainment activities that match personal preferences and offer good value for money.
[0003] However, existing decision-making reasoning algorithms have revealed many significant shortcomings in practical applications: 1. Simplistic and rigid decision-making logic: Most algorithms rank products based on only a single dimension (such as "highest sales volume" or "lowest price"). However, in real-life service scenarios, users often need to make complex trade-offs, such as wanting lunch to be "delicious," "cheap," and "delivered quickly." Existing algorithms cannot meet this multi-objective decision-making need.
[0004] 2. Ignoring dynamic constraints: Traditional recommendation algorithms are usually based on offline data and fail to fully consider the dynamic constraints of real-time scenarios. This may result in recommending invalid options such as "high-rated but closed" or "outside the delivery range", making the recommendation results impossible to implement and reducing the user experience.
[0005] 3. Lack of interpretability: Deep learning models (such as DeepFM) are often black boxes in the decision-making process. Users can only see the final recommendation results, but cannot understand the basis for the agent's decision, resulting in low user trust in the recommendation results and low adoption rate.
[0006] Therefore, there is an urgent need for a precise decision-making reasoning algorithm that can quantify users' multidimensional preferences, combine them with the hard constraints of the scenario in real time, and output the optimal solution through an interpretable logic tree, so as to meet the high requirements of intelligent decision-making in the life service field. Summary of the Invention
[0007] This invention provides a decision-making reasoning method for intelligent agents in life services based on user preferences. This method comprehensively analyzes users' historical behavior data and real-time scene data, uses the entropy weight method to quantify the weights of users on different preference dimensions (such as taste, price, timeliness, etc.), combines real-time scene constraints to filter candidate sets, uses a multi-objective utility function for comprehensive scoring, and uses a C4.5 decision tree model for final screening, outputting the optimal decision result and the recommendation reason in natural language form.
[0008] The present invention achieves the above objectives through the following technical solutions: A decision-making reasoning method for a user-preference-based smart agent in life services includes: The user profile quantification step uses the entropy weight method to calculate the weight of the user on the preset preference dimensions based on the user's historical behavior data; The constraint filtering step, based on real-time scene data, filters out candidates that do not meet the constraints of the current scene; The comprehensive scoring process utilizes a multi-objective utility function to weight and score the candidate set after constraint filtering; the multi-objective utility function is defined as: Score(c i ) = α×S match + β×S value + γ×S time S match S represents the cosine similarity between candidate product features and user profile vectors. value S is the Sigmoid mapping value between product rating and standardized price. time The timeliness score is calculated based on the estimated delivery time and the user's expected delivery time, with α, β, and γ being preset weighting coefficients and α+β+γ=1; The tree-based screening step uses the C4.5 decision tree model to perform final screening of the candidate set and output the optimal decision. The output steps are transparent, providing the optimal decision and the reasons for the recommendation in natural language.
[0009] According to the present invention, a decision-making reasoning method for a life service intelligent agent based on user preferences includes the following steps in determining weights using the entropy weight method: Build users u The historical behavior matrix X, which contains m Each historical order has [number] historical orders. n The feature indicators must include at least price, rating, and delivery-related indicators; For positive indicators, the formula is used. Standardization processing is required; For negative indicators, the formula is used. Standardization processing is required; in, xij Indicates the first i The first historical order j The original values of each feature index, max( x j ) and min( x j ) respectively represent the first j The maximum and minimum values of each feature index across all historical orders are processed to obtain a standardized matrix. Y .
[0010] According to the present invention, a decision-making reasoning method for a life service intelligent agent based on user preferences is provided to calculate the first... j Entropy value of each indicator ,in ; Calculate the coefficient of difference d j =1 e j ; Finally, determine the weight of the j-th feature index. W j = d j / ∑ d j ; Based on the determined weights W j The magnitude of the weight value indicates the user's sensitivity to the corresponding feature indicator. If the weight value of a feature indicator is large, it indicates that the user is highly sensitive to the feature indicator; if the weight value is small, it indicates that the user is not highly sensitive to the feature indicator.
[0011] According to the user preference-based life service intelligent agent decision-making reasoning method provided by the present invention, the constraint filtering step is implemented in the following manner: Real-time acquisition of current scene data, which includes at least merchant business status data, delivery range data, and inventory status data; Associate each candidate in the candidate set with the corresponding merchant and product, and clarify the merchant and specific product corresponding to each candidate; Business status determination: For each candidate, based on its real-time associated business status data, determine whether the corresponding merchant is currently in business status and whether the current time is within the business hours range; if the merchant is not in business or the current time is not within the business hours range, then mark the candidate as not meeting the business status constraints. Delivery range determination: Based on the geographical information of the delivery area corresponding to the merchant associated with the candidate, and combined with the user's current location information, determine whether the candidate is within the delivery range; if it is not within the delivery range, mark the candidate as not meeting the delivery range constraints; Inventory status determination: Based on the inventory status data of the corresponding product of the candidate, determine whether the inventory quantity of the product is greater than zero; if the inventory quantity is zero, mark the candidate as not meeting the inventory status constraints. Candidates marked as not conforming to business status constraints, delivery range constraints, or inventory status constraints in the constraint filtering step are removed from the candidate set to obtain the constraint-filtered candidate set, which is then transferred to the comprehensive scoring step for further processing.
[0012] According to the user preference-based life service intelligent agent decision-making reasoning method provided by the present invention, after a constraint filtering step, namely hard constraint filtering based on the current scene data, a candidate set is obtained. C ={ c 1, c 2,…, c k}; Define a multi-objective utility function Score( c i ) is the decision function used to process the candidate set. C Each candidate c i Scoring will be conducted; among them, S match ( c i For accuracy scoring, the cosine distance between the candidate product feature vector and the user profile vector is calculated using a vector similarity calculation method. S value ( c i The product rating is a sigmoid mapping between the product rating and the standardized price. First, the product price is standardized. Then, the product rating and the standardized price are mapped using the sigmoid function to obtain the final value. S value ( c i The value of ); S time ( c i () represents the timeliness score, and the timeliness calculation formula is: The rating is determined based on the relationship between the estimated delivery time and the user's desired delivery time. This is achieved by obtaining the estimated delivery time of candidate products and the user's desired delivery time, and then substituting these values into the timeliness calculation formula.S time ( c i The value of ); Based on the defined decision function and the dynamically adjusted weight coefficients, the candidate set... C Each candidate c i Calculate Score( ci The value of ) is used to obtain the comprehensive score of each candidate, and the scoring results containing each candidate and its comprehensive score are transmitted to the tree-structured filtering step for filtering.
[0013] According to the present invention, a decision-making reasoning method for a life service agent based on user preferences is provided, which uses information gain ratio as the basis for selecting split attributes; For each candidate attribute A in the candidate attribute set, calculate its information gain ratio. ;in, Gain ( A ) represents the information gain of attribute A. SplitInfo ( A ) represents the splitting information for attribute A; The candidate attribute with the highest information gain ratio is selected as the splitting attribute of the current node to divide the data and construct a decision tree structure.
[0014] According to the present invention, a decision-making reasoning method for a life service intelligent agent based on user preferences includes the following steps in constructing and filtering the decision tree structure: Root node selection: Construct the root node of the decision tree. The selection criterion for the root node is the comprehensive score. Score > Threshold Threshold is a preset threshold used to initially screen high-quality products. Candidates that meet the screening criteria will be moved to the next level of screening, while those that do not meet the criteria will be judged or eliminated directly according to subsequent nodes. First-level node filtering: The filtering condition for the first-level node is that the preference matching degree is greater than a preset threshold, so as to ensure that the candidate options match the user's taste preferences; the candidate options that meet the filtering conditions continue to the next level node filtering, and those that do not meet the conditions are judged or classified into the alternative category according to the subsequent nodes. Second-level node screening: Second-level nodes perform constraint tolerance testing, which includes at least the tolerance of constraints such as timeout duration and preferential usage restrictions; based on the test results, it is decided whether the candidate will continue to the next level of screening or be classified into the corresponding decision category; Leaf node output: After being filtered by nodes at all levels, the process reaches the leaf node, which outputs the decision category. The decision category includes at least three options: recommended, alternative, and eliminated. Pruning steps: The constructed decision tree is pruned using a pessimistic pruning strategy; for each subtree in the decision tree, its prediction error on the validation set is evaluated using the validation set; if the prediction error of a subtree on the validation set does not decrease significantly, the subtree is pruned to a leaf node. The decision results, which have been filtered and adjudicated by the C4.5 decision tree model, i.e. the final determined decision category information, are transmitted to the transparent output step.
[0015] According to the user preference-based life service intelligent agent decision reasoning method provided by the present invention, after obtaining the final decision result through the tree filtering step, the relevant information corresponding to the decision result is obtained, including at least the specific product name recommended and the comprehensive score obtained by the product in the comprehensive scoring step. At the same time, key attribution information in the decision-making process is collected, specifically including: Matching point information: Based on the matching of user preferences and product features in the profile quantification step, determine the degree of matching and specific matching description on the preference dimension; Constraint check results: Based on the constraint check results in the constraint filtering and screening steps, extract the constraint satisfaction status that has a significant impact on the decision result. Advantages: Summarize the product's multiple advantages by combining the calculation results of each scoring item in the comprehensive scoring process; Construct structured data containing decision results and related attribution information according to JSON data format requirements; the specific structure is as follows: The top layer contains a "decision" field, which stores the specific product name to be recommended; The “score” field is used to store the overall rating of the product; The “reasoning” field has a value that is an object, which is further subdivided into the “match_point” field to store matching point information, the “constraint_check” field to store constraint check results, and the “advantage” field to store advantage information. Output the constructed JSON format data for the front-end to display.
[0016] According to the present invention, a decision-making reasoning method for a life service intelligent agent based on user preferences is provided, which constructs a real-time connection channel with various life service data sources, including at least a user order system and an evaluation system; the order system is used to provide users' recent order information; and the evaluation system is used to provide users' evaluation data on goods or services. By using message queue middleware as a medium for data buffering and transmission, data from the order system and evaluation system is continuously fed into the data processing system in the form of a stream; Real-time cleaning and standardization of incoming streaming data; According to the preset feature mapping rules, the preprocessed data is mapped into feature vectors suitable for the algorithm model to process; A weight adjustment model is constructed based on the entropy weight method. This model receives the preprocessed feature vector of streaming data as input. For each newly acquired user order or review data, the user's historical behavior matrix is updated in real time. Based on the updated user history behavior matrix, the information entropy of each feature indicator is recalculated; for the ... j Each characteristic indicator, according to the formula Perform calculations, where , k =1 / ln( m ), Y ij These are the standardized feature values. m This represents the number of historical orders.
[0017] According to the present invention, a decision-making reasoning method for a life service agent based on user preferences is provided, which determines the difference coefficient of each feature index based on the calculated information entropy. d j =1 e j This leads to an update of the weight vector. W ,in , W =[ w 口味 , w 价格 , w 时效 , ], n The number of feature indicators; The dynamically adjusted user preference weight data is synchronized to the parameter storage module of the weight adjustment model in real time; The incremental update mechanism of the weight adjustment model is triggered. For the comprehensive scoring step in the decision reasoning algorithm, the comprehensive score of the candidate set is recalculated based on the new weight vector. For the tree-shaped screening step, the screening conditions of the nodes are updated with new weight information without changing the decision tree structure, so as to ensure the accuracy and real-time performance of the decision. Among them, an anomaly handling mechanism is established to monitor and handle any anomalies that may occur during streaming data processing in real time; Among these measures, a monitoring indicator system is set up to monitor the operation status of the data update mechanism in real time.
[0018] Therefore, compared with the prior art, the user preference-based life service intelligent agent decision-making reasoning method proposed in this invention has the following beneficial effects: 1. This invention uses the entropy weight method to objectively mine the weights of users on different preference dimensions from users' historical behavior data, avoiding the bias caused by subjective assignment and more accurately reflecting the users' true preferences.
[0019] 2. This invention combines real-time scene data to dynamically constrain and filter the candidate set, ensuring that the recommendation results are feasible in real-world scenarios and improving the effectiveness and practicality of the recommendations.
[0020] 3. This invention utilizes a multi-objective utility function to comprehensively score the candidate set, taking into account multiple objectives such as taste matching, cost-effectiveness, and timeliness, thereby achieving optimal decision-making under complex trade-offs.
[0021] 4. This invention introduces the C4.5 decision tree model for final screening. Through the structure and rules of the decision tree, it provides users with clear and understandable reasons for recommendations, thereby enhancing the interpretability of the decision.
[0022] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0023] Figure 1 This is a flowchart of an embodiment of a user preference-based intelligent agent decision-making reasoning method for life services according to the present invention.
[0024] Figure 2 This is a schematic diagram illustrating the logic of calculating user preference weights based on the entropy weight method in an embodiment of the user preference-based life service intelligent agent decision-making reasoning method of the present invention.
[0025] Figure 3 This is a structural diagram of a multi-objective optimization decision-making and C4.5 decision tree screening model in an embodiment of a user preference-based life service intelligent agent decision-making reasoning method of the present invention.
[0026] Figure 4 This is an example diagram of the decision result output and attribution logic in an embodiment of a user preference-based life service intelligent agent decision reasoning method of the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0028] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0029] See Figures 1 to 4 This embodiment provides a decision-making reasoning method for a life service intelligent agent based on user preferences, including: The user profile quantification step uses the entropy weight method to calculate the weight of the user on the preset preference dimensions based on the user's historical behavior data; The constraint filtering step, based on real-time scene data, filters out candidates that do not meet the constraints of the current scene; The comprehensive scoring process utilizes a multi-objective utility function to weight and score the candidate set after constraint filtering; the multi-objective utility function is defined as: Score(c i ) = α×S match + β×S value + γ×S time S match S represents the cosine similarity between candidate product features and user profile vectors. value S is the Sigmoid mapping value between product rating and standardized price. time The timeliness score is calculated based on the estimated delivery time and the user's expected delivery time, with α, β, and γ being preset weighting coefficients and α+β+γ=1; The tree-based screening step uses the C4.5 decision tree model to perform final screening of the candidate set and output the optimal decision. The output steps are transparent, providing the optimal decision and the reasons for the recommendation in natural language.
[0030] In the above-mentioned portrait quantification steps, the process of determining weights using the entropy weight method includes the following steps: Build users u The historical behavior matrix X, which contains m Each historical order has [number] historical orders. n The feature indicators must include at least price, rating, and delivery-related indicators; For positive indicators, such as scores, a formula is used. Standardization processing is required; For negative indicators, such as price, use the formula. Standardization processing is required; in, x ij Indicates the first iThe first historical order j The original values of each feature index, max( x j ) and min( x j ) respectively represent the first j The maximum and minimum values of each feature index across all historical orders are processed to obtain a standardized matrix. Y .
[0031] Calculate the first j Entropy value of each indicator ,in ; Calculate the coefficient of difference d j =1 e j ; Finally, determine the weight of the j-th feature index. W j = d j / ∑ d j ; Based on the determined weights W j The magnitude of the weight value determines the user's sensitivity to the corresponding feature indicator. If the weight value of a feature indicator is large, it indicates that the user is highly sensitive to the feature indicator; if the weight value is small, it indicates that the user is not highly sensitive to the feature indicator. This weight is then applied to the multi-objective utility function calculation in the comprehensive scoring step and the decision-making process in the tree-shaped screening step to achieve accurate decision-making reasoning based on user preferences.
[0032] As can be seen, to avoid bias from subjective assignment, this embodiment uses the entropy weight method to objectively mine weights from historical behavioral data. The specific steps are as follows: Data construction: Construct a matrix of users' historical behavior, which includes multiple historical orders, each with multiple feature indicators (price, rating, delivery time, etc.).
[0033] Standardization: Standardize positive indicators (such as ratings) and negative indicators (such as prices) separately to map the data to a unified dimensional range.
[0034] Calculate information entropy: Calculate the entropy value of each feature indicator and determine the user's sensitivity to that indicator based on the entropy value. If the price of a user's historical orders fluctuates greatly (high entropy), it indicates that the user is not sensitive to price (low weight); if the user always selects ratings above 4.8, it indicates that they are extremely sensitive to quality (high weight).
[0035] Determine the weights: Calculate the difference coefficient based on the information entropy, and then determine the weight vector of each feature index.
[0036] In this embodiment, the constraint filtering step is implemented in the following way: Real-time acquisition of current scene data, including merchant operating status data, delivery range data, and inventory status data; among which, merchant operating status data includes whether the merchant is open and the range of operating hours; delivery range data includes the geographical information of the delivery area corresponding to each merchant; and inventory status data includes the inventory quantity information of each merchant's goods. Associate each candidate in the candidate set with the corresponding merchant and product, and clarify the merchant and specific product corresponding to each candidate; Business status determination: For each candidate, based on its real-time associated business status data, determine whether the corresponding merchant is currently in business status and whether the current time is within the business hours range; if the merchant is not in business or the current time is not within the business hours range, then mark the candidate as not meeting the business status constraints. Delivery range determination: Based on the geographical information of the delivery area corresponding to the merchant associated with the candidate, and combined with the user's current location information, determine whether the candidate is within the delivery range; if it is not within the delivery range, mark the candidate as not meeting the delivery range constraints; Inventory status determination: Based on the inventory status data of the corresponding product of the candidate, determine whether the inventory quantity of the product is greater than zero; if the inventory quantity is zero, mark the candidate as not meeting the inventory status constraints. Candidates marked as not conforming to business status constraints, delivery range constraints, or inventory status constraints in the above constraint filtering steps are removed from the candidate set to obtain a constraint-filtered candidate set, which is then transferred to the comprehensive scoring step for further processing.
[0037] After the constraint filtering step, which involves hard constraint filtering based on real-time scenario data (including merchant operating status, delivery range, inventory status, etc.), a candidate set is obtained. C ={ c 1, c 2,…, c k}; Define a multi-objective utility function Score( c i ) is the decision function used to process the candidate set. C Each candidate c i Scoring will be conducted; among them, S match ( c iFor accuracy scoring, the cosine distance between the candidate product feature vector and the user profile vector is calculated using a vector similarity method. Specifically, the feature information of the candidate products is constructed into a product feature vector, and the preference information of the user obtained through the profiling quantification step based on historical behavior data is constructed into a user profile vector. The cosine distance between the two is then calculated; this distance value is the accuracy score. S match ( c i The value of ); S value ( c i The product rating is a sigmoid mapping between the product rating and the standardized price. First, the product price is standardized. Then, the product rating and the standardized price are mapped using the sigmoid function to obtain the final value. S value ( c i The value of ); S time ( c i The timeliness score is calculated using the following formula: The rating is determined based on the relationship between the estimated delivery time and the user's desired delivery time. This is achieved by obtaining the estimated delivery time of candidate products and the user's desired delivery time, and then substituting these values into the formula described above. S time ( c i The value of ); The weighting coefficients (0.6 / 0.2 / 0.2) in the decision function above are baseline values, and the algorithm will dynamically adjust them according to the user's current scenario; when the user is in a "weekday lunch" scenario, the algorithm automatically increases the weighting. S time ( c i The weighting coefficients are adjusted to better highlight the impact of delivery time on the score.
[0038] Based on the defined decision function and the dynamically adjusted weight coefficients, the candidate set... C Each candidate c i Calculate Score( ci The value of ) is used to obtain the comprehensive score of each candidate, and the scoring results containing each candidate and its comprehensive score are transmitted to the subsequent tree-structured filtering step for further filtering.
[0039] In the tree-based selection step, the information gain ratio is used as the basis for selecting splitting attributes to address the problem that the ID3 algorithm tends to select multi-valued attributes. For each candidate attribute A in the candidate attribute set (such as "whether it contains coupons", "whether the rating is >4.5", etc.), calculate its information gain ratio. ;in, Gain ( A ) represents the information gain of attribute A. SplitInfo ( A ) represents the splitting information for attribute A; The candidate attribute with the highest information gain ratio is selected as the splitting attribute of the current node to divide the data and construct a decision tree structure.
[0040] Specifically, the construction and selection of decision tree structures includes the following steps: Root node selection: Construct the root node of the decision tree. The selection criterion for the root node is the comprehensive score. Score > Threshold (Threshold is a preset threshold used for initial screening of high-quality products). Candidates that meet the condition will be moved to the next level of screening, while those that do not meet the condition will be judged or eliminated directly according to subsequent nodes. First-level node screening: The screening criteria for the first-level node is a preference matching degree >80%, which ensures that the candidate options match the user's taste preferences; candidates that meet this condition continue to the next level of node screening, while those that do not meet the condition are judged according to subsequent nodes or classified into alternative categories. Second-level node screening: Second-level nodes perform constraint tolerance testing, including but not limited to the tolerance of constraints such as timeout duration (e.g., even if the timeout is 5 minutes, is there a large red envelope compensation, etc.) and restrictions on the use of discounts; based on the test results, it is decided whether the candidate will continue to the next level of screening or be classified into the corresponding decision category; Leaf node output: After being filtered through the above levels of nodes, the leaf node is reached. The leaf node outputs the decision category, which includes recommendation, alternative, and elimination. Pruning steps: The constructed decision tree is pruned using a pessimistic pruning (PEP) strategy; for each subtree in the decision tree, its prediction error on the validation set is evaluated using the validation set; if the prediction error of a subtree on the validation set does not decrease significantly, the subtree is pruned to a leaf node; pruning prevents the agent from focusing too much on minor details and avoids missing the overall optimal solution due to some non-critical conditions (such as "a free drink must be provided"). The results after being filtered and adjudicated by the C4.5 decision tree model, namely the final decision category information such as recommendation, alternative, and elimination, are transmitted to the transparent output step to generate output content containing the optimal decision and its recommendation reasons.
[0041] After obtaining the final decision result through the tree-structured filtering step (the decision categories include recommendation, alternative, elimination, etc., and this embodiment mainly focuses on the recommendation result), the relevant information corresponding to the recommendation result is obtained, including the specific product name recommended and the comprehensive score obtained by the product in the comprehensive scoring step. At the same time, key attribution information in the decision-making process is collected, specifically including: Matching point information: Based on the matching of user preferences and product features in the profile quantification step, determine the degree of matching and specific matching description in preference dimensions such as taste, for example, "Taste matching degree 95% (detected that you prefer rich cheese)"; Constraint check results: Based on the constraint filtering steps and related subsequent screening steps, the results of checking constraints such as delivery range, business status, and inventory status are extracted to identify the constraint satisfaction status that has a significant impact on decision-making, such as "Delivery only takes 25 minutes (meets your dining needs within 30 minutes)". Advantages: Based on the calculation results of each scoring item in the comprehensive scoring process, summarize the product's advantages in terms of cost-effectiveness, timeliness, etc., such as "high cost-effectiveness (currently has a 30% off coupon)"; Construct structured data containing decision results and related attribution information according to JSON data format requirements; the specific structure is as follows: The top layer contains a "decision" field, which stores the specific product name to be recommended; The “score” field is used to store the overall rating of the product; The “reasoning” field has a value that is an object, which is further subdivided into the “match_point” field to store matching point information, the “constraint_check” field to store constraint check results, and the “advantage” field to store advantage information. The constructed JSON format data is output for the front-end to display, enabling the front-end to present the agent's decision results and the core basis behind them to the user in a clear and structured way, thereby enhancing the interpretability and transparency of the decision results.
[0042] JSON example: { "decision": "a pizza place", "score": 0.92, "reasoning": { "match_point": "Flavor match 95% (Your preference for rich cheese flavor was detected)", "constraint_check": "Delivery takes only 25 minutes (meets your dining needs within 30 minutes)", "Advantage": "High cost-performance ratio (currently available with a 30% off coupon)" } } In this embodiment, a real-time connection channel is constructed with various life service data sources, including at least a user order system and a rating system. The order system is used to provide users with recent order information, including the characteristics of the ordered goods (such as specific attributes such as taste, price, and delivery time) and the order time. The rating system is used to provide users with rating data for goods or services, such as ratings and rating content. By using message queue middleware (such as Kafka, RabbitMQ, etc.) as a medium for data buffering and transmission, data from the order system and evaluation system is continuously fed into the data processing system in the form of a stream, ensuring the real-time nature and orderliness of the data.
[0043] The incoming streaming data is cleaned in real time to remove noise, duplicate data, and non-compliant data; for example, data items with abnormal prices (such as negative prices or prices outside the reasonable range) in order information are filtered out. The cleaned data is standardized to unify the data format and units of different data sources; for numerical data such as the price and rating of order products, it is converted according to the preset standardization formula; for text data such as evaluation content, natural language processing operations such as word segmentation and part-of-speech tagging are performed to extract key information. According to the preset feature mapping rules, the preprocessed data is mapped into feature vectors suitable for the algorithm model to process; for example, the flavor features of the order products are mapped into a multi-dimensional vector, where each dimension of the vector represents a flavor type and its degree.
[0044] A weight adjustment model is constructed based on the entropy weight method. This model receives the preprocessed feature vector of streaming data as input. For each newly acquired user order or review data, the user's historical behavior matrix is updated in real time; taking order data as an example, the feature information of the new order is added to the historical order matrix to maintain the timeliness of the matrix; Based on the updated user history behavior matrix, the information entropy of each feature indicator is recalculated; for the ... j Each characteristic indicator, according to the formula Perform calculations, where , k =1 / ln( m ), Y ij These are the standardized feature values. m This refers to the number of historical orders. Based on the calculated information entropy, determine the difference coefficients of each feature index.d j =1 e j This leads to an update of the weight vector. W ,in , W =[ w 口味 , w 价格 , w 时效 , ], n This refers to the number of feature indicators; in this way, the weights of users' preferences for dimensions such as taste, price, and timeliness are dynamically adjusted based on the latest user behavior data.
[0045] The dynamically adjusted user preference weight data is synchronized to the parameter storage module of the algorithm model in real time to ensure that the algorithm model uses the latest weight information in subsequent decision-making and reasoning processes; The incremental update mechanism of the algorithm model is triggered. For the comprehensive scoring step in the decision reasoning algorithm (such as the defined multi-objective utility function), the comprehensive score of the candidate set is recalculated according to the new weight vector. For the tree-shaped screening step (such as the C4.5 decision tree model), the screening conditions of the nodes are updated with new weight information without changing the decision tree structure, so as to ensure the accuracy and real-time performance of the decision.
[0046] Establish an anomaly handling mechanism to monitor and handle any anomalies that may occur during streaming data processing in real time. For example, when there is data backlog in the message queue or a calculation error in the data processing module, issue an alarm in a timely manner and take corresponding recovery measures, such as restarting the data processing task and cleaning up the backlog data. A monitoring indicator system is set up to monitor the operation status of the data update mechanism in real time. The monitoring indicators include data access latency, data processing throughput, weight adjustment frequency, etc. These indicators are displayed through a visual monitoring interface, which makes it convenient for operation and maintenance personnel to understand the system's operation status in a timely manner and ensure the stability and reliability of the data update mechanism.
[0047] Furthermore, this embodiment also constructs a user feature recognition module to extract key features from user historical data and real-time interaction data to distinguish between new and old users. For new users, the feature recognition module focuses on their registration information (such as age, gender, region, and other preliminary information) and initial interaction behavior (such as first search keywords, first browsing of product categories, etc.). For old users, it conducts in-depth analysis of their historical order data, review data, consumption frequency, consumption amount, and other multi-dimensional information. At the same time, combined with real-time scene data, such as current time (weekday / weekend, daytime / night), geographical location (office area / residential area / commercial area), special events (holidays, promotional activities), etc., the specific scene at present is determined by scene classification algorithms (such as rule-based classification or machine learning classification models). Based on user features and scene classification results, the user-scene combination is divided into different categories, such as "new user - weekday lunch scene" and "old user - weekend dinner scene".
[0048] For different user-scenario categories, preset basic parameters for the decision tree model are used, including node selection thresholds and pruning strategy parameters. For new users, due to the lack of sufficient historical behavior data, a relatively lenient node selection threshold is adopted to increase the diversity and exploratory nature of recommendations. For example, the first-level node selection threshold for preference matching is set to a low value (e.g., 70%), allowing more products that may meet the user's potential needs to enter the subsequent selection stage. At the same time, a more conservative pruning strategy, such as pre-pruning, is adopted to stop branch growth in advance during the decision tree construction process to prevent overfitting, but retains a certain degree of tree structure complexity to adapt to the uncertainty of new user preferences. For experienced users, based on their rich historical behavior data, a relatively strict node selection threshold is adopted to improve the accuracy of recommendations. For example, the first-level node selection threshold for preference matching is set to a high value (e.g., 85%), ensuring that only products that highly match the user's preferences enter the subsequent selection. At the same time, a more aggressive pruning strategy, such as post-pruning, is adopted. After the decision tree is built, the subtrees are pruned according to the prediction error of the validation set to remove redundant branches, simplify the tree structure, and improve the model's generalization ability.
[0049] During the decision tree construction process, the structure of the decision tree is dynamically adjusted according to the preset parameters corresponding to the current user-scenario category; For the selection of splitting attributes at each node, the information gain ratio (for C4.5 decision trees) is used as the metric, but the calculation of the information gain ratio is adjusted appropriately according to the user-scenario category. For example, in the case of new users, in order to encourage exploratory recommendations, the information gain ratio weight of certain attributes (such as attributes with large price fluctuations) can be appropriately reduced, so that the decision tree is more inclined to select attributes with general appeal for splitting. In the case of old users, the splitting attributes are selected strictly according to the standard information gain ratio calculation method to accurately match user preferences. During node splitting, a preset node filtering threshold is used to determine whether to continue splitting; if the information gain ratio of the current node is lower than the threshold corresponding to the user-scenario category, the splitting stops and the node is designated as a leaf node. Based on the pruning strategy parameters, pruning operations are performed after the decision tree is built. For decision trees in new user scenarios, the depth and number of branches of the tree are limited during the construction process according to the pre-pruning rules. For decision trees in old user scenarios, the prediction error on the validation set is evaluated according to the post-pruning rules. If the prediction error of a certain subtree is not significantly reduced, it is pruned to a leaf node.
[0050] The decision tree model is evaluated regularly using historical and real-time interactive data, and the preset parameters are optimized and adjusted based on the evaluation results. For example, if the model accuracy is found to be low in a certain user-scenario category, the node selection threshold or pruning strategy parameters can be adjusted appropriately, and the decision tree model can be retrained.
[0051] The dynamically adjusted decision tree model structure and parameters are synchronized to the decision module of the algorithm model in real time to ensure that the latest model is used in subsequent decision reasoning processes. When the user-scenario category changes (such as new users gradually becoming old users, or the scenario switching from weekdays to weekends), the decision tree model is promptly readjusted and updated to ensure that the model always matches the current user-scenario combination.
[0052] In summary, this invention employs the entropy weight method to deeply mine user historical behavior data, objectively quantifying the weights of different user preference dimensions such as taste, price, and timeliness. This avoids the biases caused by subjective assignment in traditional algorithms and can more accurately capture users' true preferences. For example, if a user's historical order prices fluctuate significantly, it indicates that the user is not price-sensitive, and the algorithm will correspondingly reduce the price weight; if a user consistently chooses products with a rating of 4.8 or higher, it indicates that the user is extremely sensitive to quality, and the algorithm will increase the rating weight. This allows the algorithm to provide users with lifestyle service recommendations that highly match their personalized needs, greatly improving the accuracy of decision-making.
[0053] This invention utilizes a multi-objective utility function to comprehensively score the candidate set, taking into account multiple key objectives such as taste matching, cost-effectiveness, and timeliness. In daily life service scenarios, users often hope to achieve a balance in multiple aspects, such as wanting a delicious lunch that is also affordable and delivered promptly. This algorithm achieves optimal decision-making under complex trade-offs by reasonably setting the weights of each objective (e.g., a baseline weight of 0.6 / 0.2 / 0.2, which can be dynamically adjusted according to the scenario), providing users with the most suitable recommendation results and effectively improving user satisfaction with the decision outcome.
[0054] This invention's algorithm can acquire and process the latest user behavior data and scenario change information in real time. It establishes real-time connections with various life service data sources (such as user order systems, rating systems, merchant business status systems, inventory management systems, etc.) and utilizes message queue middleware (such as Kafka, RabbitMQ, etc.) to achieve streaming data access and processing. This ensures the algorithm can promptly perceive dynamic changes in user preferences and real-time scenario constraints, such as merchant closures, product shortages, and changes in delivery range.
[0055] This invention utilizes real-time acquired data to dynamically adjust the decision-making model. On one hand, based on the latest user behavior data, the entropy weight method is used to update the weights of different preference dimensions in real time, ensuring that the recommendation results closely follow changes in user preferences. On the other hand, combined with real-time scenario data, the candidate set is dynamically constrained and filtered to eliminate infeasible solutions, ensuring that the recommendation results are feasible in real-world scenarios. This dynamic adjustment mechanism guarantees that the recommendation results always remain consistent with the actual situation, improving the algorithm's practicality and adaptability.
[0056] This invention's algorithm explains the reasons for recommendations to users in natural language, enabling them to clearly understand the basis for the agent's decision-making. For example, when recommending Pizza Hut's Super Supreme Pizza, it explains to the user, "95% flavor match (detected your preference for rich cheese), delivery in just 25 minutes (meets your dining needs within 30 minutes), and high cost-performance ratio (currently has a 30% off coupon)." Clearly, this intuitive and easy-to-understand explanation enhances users' trust and understanding of the recommendation results, making them more willing to accept the recommendations.
[0057] This invention introduces the C4.5 decision tree model for final selection. The structure and rules of the decision tree provide users with a clear and understandable decision-making logic. Users can understand the conditions and judgments that led to the recommendation results through the nodes and branches of the decision tree, further enhancing the interpretability of the decision. This not only helps to improve the user adoption rate but also enhances the user's overall satisfaction and loyalty to the agent.
[0058] The entropy weight method provides a scientific and objective approach to quantifying multidimensional user preferences. Compared to traditional subjective assignment methods, the entropy weight method can fully utilize information from users' historical behavioral data and automatically determine the weights of each preference dimension based on the data's dispersion. This makes the weight calculation results more consistent with users' actual preferences, providing a solid foundation for accurate decision-making.
[0059] Traditional recommendation algorithms often neglect dynamic constraints, leading to recommendations that are unenforceable in real-world scenarios. This invention uses real-time information such as merchant operating status, product inventory, and delivery range to filter the candidate set, effectively avoiding invalid recommendations and improving the effectiveness and practicality of recommendations, providing users with a more reliable service experience. It utilizes a multi-objective utility function for comprehensive scoring, considering the optimization of multiple objectives, thus solving the problem of the single and rigid decision-making logic of traditional decision-making reasoning algorithms. In real-life service scenarios, user needs are often multifaceted. This algorithm achieves optimal decision-making under complex trade-offs by reasonably balancing the relationships between various objectives, satisfying diverse user needs. The introduction of the C4.5 decision tree model for final selection not only improves the accuracy of the decision but also enhances its interpretability. The C4.5 algorithm uses information gain ratio to select splitting attributes, solving the problem of the D3 algorithm's bias towards selecting multi-valued attributes. Simultaneously, a pessimistic pruning strategy prevents overfitting, making the decision tree structure more reasonable and concise. Users can intuitively understand the recommendation logic through the decision tree, enhancing the interactive experience between the user and the agent.
[0060] The technical features of the above embodiments can be combined in any way. 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.
[0061] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.
Claims
1. A decision-making reasoning method for a life service intelligent agent based on user preferences, characterized in that, include: The user profile quantification step uses the entropy weight method to calculate the weight of the user on the preset preference dimensions based on the user's historical behavior data; The constraint filtering step, based on real-time scene data, filters out candidates that do not meet the constraints of the current scene; The comprehensive scoring process utilizes a multi-objective utility function to weight and score the candidate set after constraint filtering; the multi-objective utility function is defined as: Score(c i ) = α×S match + β×S value + γ×S time S match S represents the cosine similarity between candidate product features and user profile vectors. value S is the Sigmoid mapping value between product rating and standardized price. time The timeliness score is calculated based on the estimated delivery time and the user's expected delivery time, with α, β, and γ being preset weighting coefficients. The tree-based screening step uses the C4.5 decision tree model to perform final screening of the candidate set and output the optimal decision. The output steps are transparent, providing the optimal decision and the reasons for the recommendation in natural language.
2. The method according to claim 1, characterized in that, The process of determining weights using the entropy weight method includes the following steps: Build users u The historical behavior matrix X, which contains m Each historical order has [number] historical orders. n The feature indicators must include at least price, rating, and delivery-related indicators; For positive indicators, the formula is used. Standardize the process; For negative indicators, the formula is used. Standardize the process; in, x ij Indicates the first i The first historical order j The original values of each feature index, max( x j ) and min( x j ) respectively represent the first j The maximum and minimum values of each feature index in all historical orders are processed to obtain a standardized matrix. Y .
3. The method according to claim 2, characterized in that: Calculate the first j Entropy value of each indicator ,in ; Calculate the coefficient of difference d j =1 e j ; Finally, determine the weight of the j-th feature index. W j = d j / ∑ d j ; Based on the determined weights W j The magnitude of the weight value indicates the user's sensitivity to the corresponding feature indicator. If the weight value of a feature indicator is large, it indicates that the user is highly sensitive to the feature indicator; if the weight value is small, it indicates that the user is not highly sensitive to the feature indicator.
4. The method according to claim 1, characterized in that, The constraint filtering step is implemented in the following way: Real-time acquisition of current scene data, which includes at least merchant business status data, delivery range data, and inventory status data; Associate each candidate in the candidate set with the corresponding merchant and product, and clarify the merchant and specific product corresponding to each candidate; Business status determination: For each candidate, based on its real-time associated business status data, determine whether the corresponding merchant is currently in business status and whether the current time is within the business hours interval; If the merchant is not open for business or the current time is outside the business hours period, the candidate will be marked as not meeting the business status constraints. Delivery range determination: Based on the geographical information of the delivery area of the merchant associated with the candidate option, and combined with the user's current location information, determine whether the candidate option is within the delivery range; If the candidate is not within the delivery range, mark it as not meeting the delivery range constraints; Inventory status assessment: Based on the inventory status data of the candidate product, determine whether the inventory quantity of the product is greater than zero; If the inventory quantity is zero, then the candidate is marked as not meeting the inventory status constraint; Candidates marked as not conforming to business status constraints, delivery range constraints, or inventory status constraints in the constraint filtering step are removed from the candidate set to obtain the constraint-filtered candidate set, which is then transferred to the comprehensive scoring step for further processing.
5. The method according to claim 1, characterized in that: After the constraint filtering step, which involves filtering based on hard constraints of the current scene data, a candidate set is obtained. C ={ c 1, c 2,…, c k }; Define a multi-objective utility function Score( c i ) is the decision function used to process the candidate set. C Each candidate c i To score; in, S match ( c i For accuracy scoring, the cosine distance between the candidate product feature vector and the user profile vector is calculated using a vector similarity calculation method. S value ( c i The product rating is a sigmoid mapping between the product rating and the standardized price. First, the product price is standardized. Then, the product rating and the standardized price are mapped using the sigmoid function to calculate the result. S value ( c i The value of ); S time ( c i () represents the timeliness score, and the timeliness calculation formula is: The rating is determined based on the relationship between the estimated delivery time and the user's desired delivery time. This is achieved by obtaining the estimated delivery time of candidate products and the user's desired delivery time, and then substituting these values into the timeliness calculation formula. S time ( c i The value of ); Based on the defined decision function and the dynamically adjusted weight coefficients, the candidate set... C Each candidate c i Calculate Score( ci The value of ) is used to obtain the comprehensive score of each candidate, and the scoring results containing each candidate and its comprehensive score are transmitted to the tree-structured filtering step for filtering.
6. The method according to claim 1, characterized in that: Information gain ratio is used as the basis for selecting splitting attributes; For each candidate attribute A in the candidate attribute set, calculate its information gain ratio. ;in, Gain ( A ) represents the information gain of attribute A. SplitInfo ( A ) represents the splitting information for attribute A; The candidate attribute with the highest information gain ratio is selected as the splitting attribute of the current node to divide the data and construct a decision tree structure.
7. The method according to claim 6, characterized in that, The construction and selection of decision tree structures includes the following steps: Root node selection: Construct the root node of the decision tree. The selection criterion for the root node is the comprehensive score. Score > Threshold Threshold is a preset threshold used to initially screen high-quality products. Candidates that meet the screening criteria will be moved to the next level of screening, while those that do not meet the criteria will be judged or eliminated directly according to subsequent nodes. First-level node filtering: The filtering condition for the first-level node is that the preference matching degree is greater than a preset threshold, so as to ensure that the candidate options match the user's taste preferences; the candidate options that meet the filtering conditions continue to the next level node filtering, and those that do not meet the conditions are judged or classified into the alternative category according to the subsequent nodes. Second-level node screening: Second-level nodes perform constraint tolerance testing, which includes at least the tolerance of constraints such as timeout duration and preferential usage restrictions; based on the test results, it is decided whether the candidate will continue to the next level of screening or be classified into the corresponding decision category; Leaf node output: After being filtered by nodes at all levels, the process reaches the leaf node, which outputs the decision category. The decision category includes at least three options: recommended, alternative, and eliminated. Pruning steps: The constructed decision tree is pruned using a pessimistic pruning strategy; for each subtree in the decision tree, its prediction error on the validation set is evaluated using the validation set; if the prediction error of a subtree on the validation set does not decrease significantly, the subtree is pruned to a leaf node. The decision results, which have been filtered and adjudicated by the C4.5 decision tree model, i.e. the final determined decision category information, are transmitted to the transparent output step.
8. The method according to claim 1, characterized in that: After obtaining the final decision result through the tree-structured filtering step, obtain the relevant information corresponding to the decision result, including at least the specific product name recommended and the comprehensive score obtained by the product in the comprehensive scoring step; At the same time, key attribution information in the decision-making process is collected, specifically including: Matching point information: Based on the matching of user preferences and product features in the profile quantification step, determine the degree of matching and specific matching description on the preference dimension; Constraint check results: Based on the constraint check results in the constraint filtering and screening steps, extract the constraint satisfaction status that has a significant impact on the decision result. Advantages: Summarize the product's multiple advantages by combining the calculation results of each scoring item in the comprehensive scoring process; Construct structured data containing decision results and related attribution information according to JSON data format requirements; the specific structure is as follows: The top layer contains a "decision" field, which stores the specific product name to be recommended; The "score" field is used to store the overall score of the product; The "reasoning" field has a value that is an object, which is further subdivided into the "match_point" field to store matching point information, the "constraint_check" field to store constraint check results, and the "advantage" field to store advantage information. Output the constructed JSON format data for the front-end to display.
9. The method according to any one of claims 1 to 8, characterized in that: Establish real-time connection channels with various lifestyle service data sources, including at least user order systems and rating systems; the order system is used to provide users with recent order information; The rating system is used to provide users with rating data on goods or services; By using message queue middleware as a data buffer and transmission medium, data from the order system and evaluation system is continuously fed into the data processing system in the form of a stream; Real-time cleaning and standardization of incoming streaming data; According to the preset feature mapping rules, the preprocessed data is mapped into feature vectors suitable for the algorithm model to process; A weight adjustment model is constructed based on the entropy weight method. This model receives the preprocessed feature vector of streaming data as input. For each newly acquired user order or review data, the user's historical behavior matrix is updated in real time. Based on the updated user history behavior matrix, the information entropy of each feature indicator is recalculated; For the j Each characteristic indicator, according to the formula Perform calculations, where , k =1 / ln( m ), Y ij These are the standardized feature values. m This represents the number of historical orders.
10. The method according to claim 9, characterized in that: Based on the calculated information entropy, determine the difference coefficients of each feature index. d j =1 e j This leads to an update of the weight vector. W ,in , W =[ w 口味 , w 价格 , w 时效 , ], n The number of feature indicators; The dynamically adjusted user preference weight data is synchronized to the parameter storage module of the weight adjustment model in real time; The incremental update mechanism of the weight adjustment model is triggered. For the comprehensive scoring step in the decision reasoning algorithm, the comprehensive score of the candidate set is recalculated based on the new weight vector. For the tree-shaped screening step, the screening conditions of the nodes are updated with new weight information without changing the decision tree structure, so as to ensure the accuracy and real-time performance of the decision. Among them, an anomaly handling mechanism is established to monitor and handle any anomalies that may occur during streaming data processing in real time; Among these measures, a monitoring indicator system is set up to monitor the operation status of the data update mechanism in real time.