Item recommendation method and device based on mcp protocol, equipment and medium
By employing an item recommendation method based on the MCP protocol, utilizing a large language model and multi-round optimization processing, and dynamically selecting and combining recommendation tools, the problem of existing systems being unable to recommend the most suitable items in real time is solved, thereby improving the adaptive capability and accuracy of the recommendation system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING QIYI CENTURY SCI & TECH CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-05-29
AI Technical Summary
Existing item recommendation systems cannot dynamically recommend the most suitable items in real time based on user, scenario, and item characteristics, resulting in insufficient recommendation accuracy and poor system flexibility.
The method adopts an item recommendation approach based on the MCP protocol. It obtains user profile data, user historical behavior data, and current recommendation scenario information through a large language model, intelligently filters candidate recommendation tools, and determines the target recommendation tool and its fusion weight through multiple rounds of optimization. It calculates the recommendation score by combining item feature data, and finally generates a target item recommendation list.
It enables the dynamic selection and combination of recommendation tools, improving the adaptive ability and recommendation effect of the recommendation system, and enhancing the accuracy and flexibility of recommendations.
Smart Images

Figure CN122115073A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of e-commerce technology, and in particular to a method, apparatus, device and medium for recommending items based on the MCP protocol. Background Technology
[0002] With the continuous growth of data scale and business complexity on internet platforms, recommendation systems have been widely applied in various scenarios such as e-commerce recommendations, content distribution, and social relationship recommendations. These systems automatically recommend items that users may be interested in based on user characteristics and behavioral data. Common recommendation systems are typically built upon collaborative filtering, content matching, deep learning ranking models, or hybrid recommendation models. In practical engineering implementations, different recommendation algorithms are often encapsulated into multiple recommendation modules or services. One or a few recommendation algorithms are selected to perform the recommendation task through preset rules or manual configuration. While such systems can achieve certain results under specific data conditions, they still rely on static strategy configurations and fixed algorithm pipelines, exhibiting weak adaptability to changes in user state, data richness, and recommendation scenarios.
[0003] Current item recommendation systems cannot dynamically recommend the most suitable items in real time based on user, scenario, and item characteristics, resulting in insufficient recommendation accuracy and poor system flexibility.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a method, apparatus, device, and medium for item recommendation based on the MCP protocol to solve the aforementioned technical problem of "being unable to recommend the most suitable items in real time and dynamically based on user, scenario, and item characteristics".
[0006] According to one aspect of the embodiments of this application, this application provides an item recommendation method based on the MCP (Model Context Protocol), comprising: acquiring user profile data of a target user, user historical behavior data, current recommendation scenario information, and item feature data of candidate items; inputting the user profile data, user historical behavior data, and current recommendation scenario information as input data into a large language model, so as to determine at least one candidate recommendation tool from multiple initial recommendation tools through the large language model, wherein the initial recommendation tools follow the MCP protocol, and different candidate recommendation tools run different recommendation algorithms; performing multiple rounds of optimization processing on the candidate recommendation tools based on the item feature data and the historical performance indicators of the candidate recommendation tools, so as to determine at least one candidate recommendation tool from multiple initial recommendation tools through the large language model, wherein the initial recommendation tools follow the MCP protocol, and different candidate recommendation tools run different recommendation algorithms; and performing multiple rounds of optimization processing on the candidate recommendation tools based on the item feature data and the historical performance indicators of the candidate recommendation tools, so as to determine at least one candidate recommendation tool from multiple initial recommendation tools. The tool determines the target recommendation tool and its corresponding fusion weights. Through the execution interface defined by the MCP protocol, it calls each target recommendation tool in parallel. Each target recommendation tool calculates a recommendation score based on user historical behavior data and the item feature data of candidate items, thereby generating an initial item recommendation list for each target recommendation tool. This initial item recommendation list includes the item identifier and recommendation score for each candidate item. The recommendation scores of the same item in different initial item recommendation lists are weighted according to the fusion weights of the target recommendation tools to obtain a weighted score for each item. The items are then sorted in descending order according to their weighted scores, generating the target item recommendation list.
[0007] Optionally, user profile data, user historical behavior data, and current recommendation scenario information are used as input data to input the large language model, including: performing field encoding processing on the user profile data to generate user profile feature vectors, and performing feature extraction processing on the user historical behavior data to generate behavior sequence feature vectors; concatenating the user profile feature vectors, behavior sequence feature vectors, and scenario labels of the current recommendation scenario according to a preset prompt template to obtain model input text data; and inputting the model input text data into the large language model.
[0008] Optionally, at least one candidate recommendation tool is determined from multiple initial recommendation tools using a large language model, including: receiving response data returned by the large language model, wherein the response data includes a tool identifier and a corresponding selection reason text; querying the tool availability status corresponding to the tool identifier in the MCP service registry based on the tool identifier; and determining the initial recommendation tools with a valid tool availability status as candidate recommendation tools.
[0009] Optionally, the multi-round optimization process includes a basic screening round, which includes: calculating the behavioral matching degree between each candidate recommendation tool and the user's historical behavior data, and calculating the feature matching degree between each candidate recommendation tool and the item feature data; weighting the historical performance indicators, behavioral matching degree, and feature matching degree of the candidate recommendation tools to obtain a weighted sum; using the weighted sum as the predicted performance value of the candidate recommendation tool in the current recommendation scenario; and integrating the candidate recommendation tools whose predicted performance value is greater than a preset performance threshold to obtain a basic toolset.
[0010] Optionally, the multi-round optimization process includes a weight calculation round, which is executed after the basic screening round. The weight calculation round includes: for each tool in the basic toolset, obtaining the tool's historical performance index and feedback effect index, where the historical performance index is a long-term performance evaluation value obtained based on the tool's historical recommendation effect statistics, and the feedback effect index is a short-term performance evaluation value calculated based on user feedback data; obtaining the tool's time decay factor, where the time decay factor is a decay coefficient calculated based on the time difference between the tool's last call time and the current time; calculating the tool's initial weight value through a weighted linear combination based on the historical performance index, feedback effect index, and time decay factor; normalizing the initial weight value of each tool to obtain the fusion weight corresponding to each tool; and allocating the fusion weight to the corresponding tool to obtain the target recommendation tool including the fusion weight.
[0011] Optionally, after generating the target item recommendation list, the method further includes: monitoring and collecting interaction behavior data of target users on each item in the target item recommendation list, wherein the interaction behavior data includes at least one of click behavior, purchase behavior, dwell time data and rating data; calculating the effectiveness evaluation score of the current recommendation task based on the interaction behavior data; and adjusting the historical performance indicators of the target recommendation tool according to the effectiveness evaluation score.
[0012] Optionally, adjusting the historical performance index of the target recommendation tool based on the performance evaluation score includes: comparing the performance evaluation score with a first threshold and a second threshold, wherein the first threshold is greater than the second threshold; if the performance evaluation score is greater than the first threshold, then adjusting the corresponding historical performance index upward according to the gain coefficient; if the performance evaluation score is less than the second threshold, then adjusting the corresponding historical performance index downward according to the decay coefficient, wherein the gain coefficient is greater than the target value and the decay coefficient is less than the target value.
[0013] According to another aspect of the embodiments of this application, this application provides an item recommendation device based on the MCP protocol, including: an acquisition module, used to acquire user profile data of a target user, user historical behavior data, current recommendation scenario information, and item feature data of candidate items; a first determination module, used to input the user profile data, user historical behavior data, and current recommendation scenario information as input data into a large language model, so as to determine at least one candidate recommendation tool from multiple initial recommendation tools through the large language model, wherein the initial recommendation tools follow the MCP protocol, and different candidate recommendation tools run different recommendation algorithms; and a second determination module, used to perform multiple rounds of optimization processing on the candidate recommendation tools based on the item feature data and the historical performance indicators of the candidate recommendation tools, so as to determine at least one candidate recommendation tool from multiple initial recommendation tools. The selection of recommendation tools determines the actual target recommendation tool and its corresponding fusion weight. The first calculation module uses the execution interface defined by the MCP protocol to call each target recommendation tool in parallel. Each target recommendation tool calculates a recommendation score based on user historical behavior data and the item feature data of candidate items, thereby generating an initial item recommendation list for each target recommendation tool. This initial item recommendation list includes the item identifier and recommendation score for each candidate item. The second calculation module performs a weighted calculation on the recommendation scores of the same item in different initial item recommendation lists based on the fusion weight of the target recommendation tool, obtaining a weighted score for each item. The sorting module sorts the items in descending order according to their weighted scores and generates the target item recommendation list.
[0014] According to another aspect of the embodiments of this application, this application provides an electronic device, including a memory, a processor, a communication interface and a communication bus. The memory stores a computer program that can run on the processor. The memory and the processor communicate with each other through the communication bus and the communication interface. When the processor executes the computer program, it implements the steps of the above method.
[0015] According to another aspect of the embodiments of this application, this application also provides a computer-readable medium having processor-executable non-volatile program code that causes the processor to perform the above-described method.
[0016] Compared with related technologies, the technical solutions provided in this application have the following advantages: This application provides an item recommendation method based on the MCP protocol, comprising: acquiring user profile data, user historical behavior data, current recommendation scenario information, and item feature data of candidate items for a target user; inputting the user profile data, user historical behavior data, and current recommendation scenario information as input data into a large language model to determine at least one candidate recommendation tool from multiple initial recommendation tools through the large language model, wherein the initial recommendation tools follow the MCP protocol, and different candidate recommendation tools run different recommendation algorithms; and performing multiple rounds of optimization processing on the candidate recommendation tools based on the item feature data and the historical performance indicators of the candidate recommendation tools to determine the candidate recommendation tool from the candidate recommendation tools. The actual target recommendation tools and their corresponding fusion weights are used. Through the execution interface defined by the MCP protocol, various target recommendation tools are called in parallel. Each target recommendation tool calculates a recommendation score based on user historical behavior data and candidate item feature data, thus generating an initial item recommendation list for each target recommendation tool. This initial item recommendation list includes the item identifier and recommendation score for each candidate item. The recommendation scores of the same item in different initial item recommendation lists are weighted according to the fusion weights of the target recommendation tools to obtain a weighted score for each item. The items are then sorted in descending order according to their weighted scores, generating the target item recommendation list. Candidate tools are intelligently screened using a large language model, and multiple rounds of optimization are performed based on item features and historical performance to determine the target tools and weights. Finally, the target tools are called in parallel based on the MCP protocol to calculate scores and perform weighted fusion, realizing the dynamic selection and combination of recommendation tools. This solves the problem of not being able to dynamically recommend the most suitable items in real time based on user, scenario, and item features. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of the hardware environment for an optional item recommendation method based on the MCP protocol provided in an embodiment of this application; Figure 2 A flowchart illustrating an optional item recommendation method based on the MCP protocol according to an embodiment of this application; Figure 3This is a schematic diagram of an optional three-level degradation data query process provided according to an embodiment of this application; Figure 4 This is a data processing flowchart for an optional score prediction method provided according to an embodiment of this application; Figure 5 This is a flowchart illustrating an optional intelligent tool selection process based on a large model, according to an embodiment of this application. Figure 6 This is a schematic diagram illustrating the steps of an optional result fusion and sorting method according to an embodiment of this application. Figure 7 This is a block diagram of an optional item recommendation device based on the MCP protocol according to an embodiment of this application; Figure 8 This is a schematic diagram of an optional electronic device structure provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0021] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustration and has no specific meaning in itself. Therefore, "module" and "part" may be used interchangeably.
[0022] With the continuous growth of data scale and business complexity on internet platforms, recommendation systems have been widely applied in various scenarios such as e-commerce recommendations, content distribution, and social relationship recommendations. These systems automatically recommend items that users may be interested in based on user characteristics and behavioral data. Common recommendation systems are typically built upon collaborative filtering, content matching, deep learning ranking models, or hybrid recommendation models. In practical engineering implementations, different recommendation algorithms are often encapsulated into multiple recommendation modules or services. One or a few recommendation algorithms are selected to perform the recommendation task through preset rules or manual configuration. While such systems can achieve certain results under specific data conditions, they still rely on static strategy configurations and fixed algorithm pipelines, exhibiting weak adaptability to changes in user state, data richness, and recommendation scenarios.
[0023] Current item recommendation systems cannot dynamically recommend the most suitable items in real time based on user, scenario, and item characteristics, resulting in insufficient recommendation accuracy and poor system flexibility.
[0024] To address the problems mentioned in the background art, according to one aspect of the embodiments of this application, an embodiment of an item recommendation method based on the MCP protocol is provided.
[0025] Optionally, in the embodiments of this application, the above-described item recommendation method based on the MCP protocol can be applied to, for example... Figure 1 The hardware environment shown consists of terminal 101 and server 103. Figure 1 As shown, server 103 is connected to terminal 101 via a network and can be used to provide services to the terminal or clients installed on the terminal. Database 105 can be set up on the server or independently of the server to provide data storage services for server 103. The network mentioned above includes, but is not limited to, wide area network, metropolitan area network or local area network. Terminal 101 includes, but is not limited to, PC, mobile phone, tablet computer, etc.
[0026] The item recommendation method based on the MCP protocol in this application embodiment can be executed by server 103, or it can be jointly executed by server 103 and terminal 101, such as... Figure 2 As shown, it includes: Step 201: Obtain user profile data, user historical behavior data, current recommendation scenario information, and item feature data of candidate items for the target user; Step 202: Input user profile data, user historical behavior data and current recommendation scenario information into the large language model as input data, so as to determine at least one candidate recommendation tool from multiple initial recommendation tools through the large language model. The initial recommendation tools follow the MCP protocol, and different candidate recommendation tools run different recommendation algorithms. Step 203: Based on the item feature data and the historical performance indicators of the candidate recommendation tools, perform multiple rounds of optimization on the candidate recommendation tools to determine the target recommendation tool to be used and the corresponding fusion weight from the candidate recommendation tools; Step 204: Through the execution interface defined by the MCP protocol, each target recommendation tool is called in parallel. Each target recommendation tool calculates a recommendation score based on the user's historical behavior data and the item feature data of the candidate items, thereby generating an initial item recommendation list corresponding to each target recommendation tool. The initial item recommendation list includes the item identifier and recommendation score of each candidate item. Step 205: Calculate the weighted score of the same item in different initial item recommendation lists based on the fusion weight of the target recommendation tool to obtain the weighted score of each item. Step 206: Sort each item in descending order according to the weighted score and generate a recommended list of target items.
[0027] This application is applicable to e-commerce product recommendations, and can also be applied to other high-precision personalized recommendation scenarios, especially in businesses with diverse user needs, frequent scenario changes, and complex characteristics of items to be recommended.
[0028] This application first encapsulates multiple different recommendation algorithms into initial recommendation tools conforming to the MCP protocol, realizing standardized interface management and parallel invocation of recommendation tools. It then introduces a large language model to perform semantic-level comprehensive analysis of user profile data, user historical behavior data, and current recommendation scenario information, intelligently determining candidate recommendation tools from multiple initial tools, thus achieving dynamic selection of recommendation tools. Based on this, it combines item feature data and historical performance indicators of candidate recommendation tools to perform multiple rounds of optimization processing on the candidate recommendation tools, determining the target recommendation tool and its corresponding fusion weight. Finally, it uses the MCP protocol execution interface to call multiple target recommendation tools in parallel to generate their respective recommendation results, and performs weighted fusion ranking based on the fusion weight to obtain the final recommendation list. The inventive point of this scheme lies in combining a large language model-driven intelligent tool selection mechanism, a multi-round performance optimization mechanism, and an MCP protocol standardized tool invocation mechanism to achieve dynamic selection and weighted fusion execution of recommendation tools, improving the adaptive capability and recommendation effect of the recommendation system.
[0029] As an optional implementation, user profile data, user historical behavior data, and current recommendation scenario information are input into the large language model, including: performing field encoding processing on the user profile data to generate a user profile feature vector, and performing feature extraction processing on the user historical behavior data to generate a behavior sequence feature vector; concatenating the user profile feature vector, behavior sequence feature vector, and scenario label of the current recommendation scenario according to a preset prompt template to obtain the model input text data; and inputting the model input text data into the large language model.
[0030] When acquiring various data (including user profile data, user historical behavior data, product feature data, and current recommendation scenario information), a three-level degradation strategy can be adopted to ensure reliability. Figure 3 The schematic diagram of the three-level degradation data query process provided for this application is shown in the figure. First, it attempts to read from the Redis cache; if it fails or the data does not exist, it falls back to querying the MySQL database; if the database query also fails, it uses the preset default value as the data to be queried. The entire process uses the try-catch mechanism to catch and handle exceptions.
[0031] User profile data includes fields such as age, gender, region, and membership level. The structured user profile data undergoes field encoding. For example, categorical fields are one-hot encoded or embedded, continuous fields are normalized, and then all encoded features are concatenated into a comprehensive user profile feature vector. In other words, discrete user attributes are transformed into machine-understandable and computable numerical representations.
[0032] User historical behavior data includes clicks, purchases, and browsing sequences. Feature extraction processing is performed on time-series user historical behavior data. The processing steps include sorting the behavior sequences by time, assigning different weights to behaviors at different time points based on time decay factors, and extracting features such as behavior type, frequency, and sequence pattern. Finally, a behavior sequence feature vector representing the user's recent interests and long-term preferences is generated.
[0033] The user profile feature vector and behavior sequence feature vector, along with descriptive current recommendation scenario information, are transformed into text-based scenario labels. The current recommendation scenario information may include "new user homepage cold start" or "clothing category recommendation during a major promotion".
[0034] Based on a pre-defined prompt template, these vectorized features and scene labels are organized into a Prompt (i.e., the model input text data), which is a structured natural language description.
[0035] This application provides a sample prompt: "User profile features: [User profile feature vector]; Recent user behavior sequence features: [Behavior sequence feature vector]; Current recommendation scenario: [Scenario label]; Based on the above information, please select the most suitable recommendation tool from the list of available tools." The constructed model is input into text data and then fed into the large language model via an API (Application Programming Interface). The large language model provided in this application can be GPT or Claude, etc. Based on its powerful understanding of natural language and contextual logic, the large language model parses the user attributes, behavioral patterns, and scenario requirements contained in the input text, and performs inference accordingly to output appropriate tool identifiers.
[0036] By transforming user profiles and behavioral sequences into structured textual descriptions input into the model, the decision-making process of the large language model is built upon specific and traceable feature information. This not only improves the accuracy of the model's initial selection tools, but also makes the selection rationale output by the model more transparent and interpretable throughout the entire recommendation system's decision-making process.
[0037] Before determining the final candidate recommendation tool, this application also utilizes a large language model for rating prediction. Figure 4 The data processing flowchart for rating prediction provided in this application is shown in the figure. It involves acquiring user data (user profile features and recent user behavior sequence features) and product feature data as input; then, constructing another Prompt based on this input information, i.e., a structured instruction or query text; next, submitting the constructed Prompt to the large language model API to call the large language model service; finally, the large model API performs inference and outputs the result. The system parses the result to predict the rating, converting it into a numerical rating between 0 and 1. The predicted rating is a semantically rich predicted score of the user's interest in the item, serving as prior information for subsequent product recommendations.
[0038] For example, the predicted score of 0.0 to 1.0 can be used as an independent feature term and directly incorporated into the input feature vector of various recommendation tools (such as collaborative filtering tools and deep learning models), so that specific algorithms can integrate the global semantic understanding of the large model when calculating the item recommendation score; or, in the multi-tool result fusion stage, the predicted score can be used as a weighted correction factor to fine-tune the fused item total score based on the confidence of the large model; it can also be used for pre-filtering of candidate item sets, only performing subsequent complex processing on items with predicted scores higher than the threshold, thereby improving the overall efficiency of the system.
[0039] As an optional embodiment, determining at least one candidate recommendation tool from multiple initial recommendation tools using a large language model includes: receiving response data returned by the large language model, wherein the response data includes a tool identifier and a corresponding selection reason text; querying the tool availability status corresponding to the tool identifier in the MCP service registry based on the tool identifier; and determining the initial recommendation tools with a valid tool availability status as candidate recommendation tools.
[0040] The response data is usually in JSON or structured text format. After receiving the response data returned by the large language model, it is parsed to extract the tool identifier and the text of the selection reason attached to the model. For example, the tool identifier is "collaborative_filtering_v2, content_based_rec", and the output selection reason is "The user has rich historical behavior, which is suitable for the use of collaborative filtering algorithm".
[0041] Based on the parsed tool identifier, a query is performed in a centralized MCP service registry.
[0042] The MCP service registry maintains metadata for all registered initial recommended tools, one key piece of information being the tool's availability status, which includes online / available, offline / under maintenance, and overload.
[0043] "Available" is used as the preset valid state. The availability status of the queried tools is compared with the preset valid state. Only tools with a valid state are included in the final candidate recommendation tool set. Any tools selected by the large language model but currently unavailable (e.g., under deployment, faulty, overloaded) will be filtered out.
[0044] Figure 5 The flowchart for the intelligent tool selection based on a large model provided in this application is as follows: First, predicted scores and user characteristics are obtained as basic inputs, with the predicted scores incorporated into the user data. Then, the user data and a list of available tools are integrated to construct a Prompt. Next, this Prompt is submitted to a large language model for analysis. Based on the analysis results, the large language model selects the MCP tools. Then, the tools selected by the large model are submitted to the MCP tool library for usability verification. Tools verified as usable are identified as candidate recommendation tools and output as a valid tool list.
[0045] This embodiment introduces a tool availability verification and filtering mechanism based on the MCP service registry after the intelligent initial selection recommendation tool using a large language model. This decouples the ideal algorithm selection from the real-time running status of the system, and only determines tools with valid status as final candidates, effectively preventing the interruption of the entire recommendation chain due to single-point tool failure or overload.
[0046] As an optional implementation, the multi-round optimization process includes a basic screening round, which includes: calculating the behavioral matching degree between each candidate recommendation tool and the user's historical behavior data, and calculating the feature matching degree between each candidate recommendation tool and the item feature data; weighting the historical performance indicators, behavioral matching degree, and feature matching degree of the candidate recommendation tools to obtain a weighted sum; using the weighted sum as the predicted performance value of the candidate recommendation tool in the current recommendation scenario; and integrating the candidate recommendation tools whose predicted performance value is greater than a preset performance threshold to obtain a basic toolset.
[0047] For each candidate recommendation tool, calculate its behavioral matching degree with the user's historical behavior data. For example, calculate the similarity between the tool's behavioral preference vector and the user's behavioral feature vector, and use this similarity value as the behavioral matching degree. Similarity calculation methods include cosine similarity or the reciprocal of Euclidean distance.
[0048] Behavioral matching score is used to evaluate how well a tool's algorithmic characteristics fit the current user behavior patterns. For example, a collaborative filtering tool that relies on a rich user-item interaction matrix will have a higher matching score when facing users with rich behavioral history; conversely, it will have a lower matching score when facing "new users" with sparse behavior.
[0049] For each candidate recommendation tool, the feature matching degree between it and the item feature data is calculated. For example, each candidate recommendation tool declares the types of item features its algorithm relies on in its metadata, which can be transformed into a tool feature requirement vector. Additionally, an overall analysis of the acquired candidate item feature data is performed to generate an item feature completeness vector. The tool feature requirement vector and the item feature completeness vector are then compared and calculated element-wise (corresponding to feature types). A direct calculation method is to take the dot product or weighted dot product of the two vectors, where the weights represent the importance of different feature types to the tool. A simpler approach is to determine the feature matching degree by calculating the overlap.
[0050] Feature matching score is used to evaluate the compatibility of a tool's algorithmic characteristics with the features of the current set of items to be recommended. For example, a "content recommendation tool" that relies on the textual description of items will have a higher matching score when faced with a set of items with rich textual features; conversely, if the item features are mainly images or very sparse, the matching score will be lower.
[0051] Obtain the historical performance metrics of each candidate recommendation tool, and sum the historical performance metrics, behavior matching degree, and feature matching degree according to the preset weight coefficients. The weighted sum is the prediction performance value of the tool in the current specific recommendation scenario.
[0052] For example, the formula for calculating the prediction performance value is: Prediction performance value = Historical performance index × 0.5 + Behavior matching degree × 0.3 + Feature matching degree × 0.2, where 0.5, 0.3 and 0.2 are preset weight coefficients, which represent the relative importance or contribution ratio of the three different evaluation dimensions when evaluating the prediction performance of a candidate recommendation tool. These weight coefficients can be adjusted according to the actual application scenario.
[0053] The calculated predicted performance value is compared with a preset performance threshold (e.g., 0.6). Only tools whose predicted performance value is greater than the threshold are considered to be eligible for the next round of optimization.
[0054] All candidate recommendation tools that pass the threshold screening are integrated together to form a basic toolset. The basic toolset serves as the output of this round of optimization and the input for the next round of weight calculation.
[0055] By setting up basic screening rounds, the prediction performance of candidate recommendation tools is evaluated based on multi-index weighting. Only tools with prediction performance values exceeding the threshold are retained for subsequent processing. This effectively reduces the participation of low-fit recommendation tools in fusion calculations, lowers the system's computational resource consumption, and improves the overall quality of tools entering the fusion stage, thereby enhancing the accuracy and consistency of the final recommendation results.
[0056] As an optional implementation, the multi-round optimization process includes a weight calculation round, which is executed after the basic screening round. The weight calculation round includes: for each tool in the basic toolset, obtaining the tool's historical performance index and feedback effect index, wherein the historical performance index is a long-term performance evaluation value obtained based on the tool's historical recommendation effect statistics, and the feedback effect index is a short-term performance evaluation value calculated based on user feedback data; obtaining the tool's time decay factor, wherein the time decay factor is a decay coefficient calculated based on the time difference between the tool's last call time and the current time; calculating the tool's initial weight value through a weighted linear combination based on the historical performance index, feedback effect index, and time decay factor; normalizing the initial weight value of each tool to obtain the fusion weight corresponding to each tool; and allocating the fusion weight to the corresponding tool to obtain the target recommendation tool including the fusion weight.
[0057] For each tool in the basic toolset, its historical performance metrics are read from the system's persistent storage (such as a database). These metrics are a comprehensive evaluation of the tool's long-term performance, calculated based on business metrics such as average click-through rate and conversion rate over the past few weeks or months, reflecting the tool's stability and overall strength.
[0058] Based on user feedback data collected within a pre-defined, recent time window (e.g., the past 1 hour or 24 hours), the tool's feedback effectiveness metric is calculated. This metric measures the tool's recent performance and adaptability, such as the click-through rate or user rating of recent recommendations. This ensures that the weighting allocation responds to the latest performance changes.
[0059] Obtain the tool's time decay factor. This factor is a coefficient calculated using a preset decay function (such as an exponential decay function) based on the time interval between the tool's last successful invocation and the current system time. The value of the time decay factor decreases as the time interval increases (between 0 and 1), used to reduce the impact of the tool's historical performance (if it has not been used for a long time) on the current weight.
[0060] Based on the acquired historical performance metrics, feedback effectiveness metrics, and time decay factors, the initial weight values of the tool are calculated using a weighted linear combination. The calculation formula is: Initial Weight = (Historical Performance Metric × α + Feedback Effectiveness Metric × β) × Time Decay Factor, where α and β are preset weighting coefficients (e.g., α = 0.6, β = 0.4). This formula integrates long-term performance, recent performance, and novelty.
[0061] The initial weight values calculated for all tools in the base toolset are normalized. This is typically done by summing all initial weight values to obtain a total weight, and then dividing the initial weight value of each tool by this total weight. Normalization ensures that the sum of the fusion weights for all tools is 1, resulting in a reasonable probability distribution or influence allocation in subsequent weighted fusion.
[0062] The calculated and normalized fusion weights are then assigned one-to-one to each tool in the basic toolset. At this point, the basic toolset with its precise fusion weights is officially identified as the target recommendation tool and its weight configuration to be invoked in parallel in the next optimization round.
[0063] By dynamically evaluating and normalizing the weights of each recommendation tool within the basic toolset through rounds of weight calculation, the fusion weights can simultaneously reflect the long-term stability, recent feedback performance, and data timeliness of the tools. This avoids the bias problems caused by fixed weights or single evaluation indicators, improves the accuracy and robustness of multi-tool fusion recommendation results, and enhances the system's ability to adapt to changes in performance.
[0064] After completing the weight calculation round, we proceed to the result fusion round, which will be explained below.
[0065] Using the standardized execution interface defined by MCP, all recommendation services identified as target recommendation tools in the previous round are invoked in parallel. Each invocation passes the required input data for the current recommendation task to the corresponding tool, primarily including user historical behavior data and item feature data of candidate items. Each target recommendation tool independently executes its built-in recommendation algorithm and returns its own initial item recommendation list. Each list contains a series of candidate items and their corresponding recommendation scores.
[0066] For each candidate item (identified by its unique item identifier), iterate through all initial recommendation lists containing that item. Extract the item's recommendation score from each list and multiply it by the fusion weight of the target recommendation tool corresponding to the item's list to obtain the tool's weighted contribution score for that item.
[0067] The final weighted score of an item is obtained by summing the weighted contribution scores of all tools to the item. The specific formula is: Final weighted score of item = Σ (Recommended score of tool n × Fusion weight of tool n).
[0068] After completing the weighted score fusion calculation for all candidate items, a set containing all items and their final weighted scores is obtained.
[0069] All candidate items are sorted in descending order based on the final weighted score. According to business requirements (such as the top N items), the top-ranked items are selected from the sorted list to generate the final target item recommendation list, which is the final output of this recommendation request.
[0070] Figure 6 The schematic diagram illustrating the steps of result fusion and ranking provided in this application is shown in the figure. First, processing results from multiple different recommendation tools are input simultaneously. These results are labeled as tool result 1 weight W1, tool result 2 weight W2, up to tool result N weight WN, with each result accompanied by its corresponding weight value. Subsequently, all weighted results are sent to the weighted fusion module for unified calculation. In this module, weighted summation and integration are performed based on the weight of each tool result. Finally, the weighted fusion result is passed to the Top-N ranking module. This module sorts all candidate items in descending order based on the final score and selects the top N results with the highest scores to form the final recommendation list. The entire process clearly demonstrates the complete data processing chain from inputting results from multiple tools, through weighted fusion, to generating a refined and ordered output.
[0071] By using a weighted summation method, the decision results of multiple heterogeneous recommendation tools are integrated to combine the advantages of each tool and generate a better final recommendation.
[0072] As an optional embodiment, after generating the target item recommendation list, the method further includes: monitoring and collecting interaction behavior data of target users on each item in the target item recommendation list, wherein the interaction behavior data includes at least one of click behavior, purchase behavior, dwell time data and rating data; calculating the effectiveness evaluation score of the current recommendation task based on the interaction behavior data; and adjusting the historical performance indicators of the target recommendation tool according to the effectiveness evaluation score.
[0073] Continuous monitoring and logging of target user interactions and feedback on the target item recommendation list are conducted. The collected interaction data serves as direct evidence of user reactions to specific items in the recommendation list, and mainly includes, but is not limited to: click behavior: whether the user clicked on the recommended item; purchase behavior: whether the user purchased the recommended item; dwell time data: the time the user spends on the recommended item details page; rating data: explicit ratings given by users to the recommended items (e.g., 1-5 stars). This data can be used individually or in combination as the primary basis for evaluating the effectiveness of the recommendations.
[0074] The overall performance evaluation score for this recommendation task is calculated according to a predefined quantitative formula.
[0075] The specific calculation formula is as follows: Performance evaluation score = Click-through rate × A + Conversion rate × B + Average dwell time × C + Average rating × D, where A, B, C, and D are the preset weight coefficients corresponding to each indicator. For example, A = 0.3, B = 0.4, C = 0.2, and D = 0.1. Indicators such as click-through rate and conversion rate need to be statistically derived from the original behavioral data.
[0076] The performance evaluation score is a normalized scalar value, typically between 0 and 1, which comprehensively reflects the immediate effects of the recommendation on attracting user attention, facilitating transactions, maintaining user interest, and achieving user satisfaction.
[0077] The calculated performance evaluation score is used to dynamically update the historical performance metrics of all target recommendation tools participating in this recommendation task. In other words, the performance of this recommendation task is used as a new data point and fed back into the long-term performance records of the corresponding tools.
[0078] By introducing an effect evaluation mechanism based on real interaction behavior and a dynamic update mechanism for historical performance indicators, the performance evaluation of recommendation tools can continuously reflect the latest recommendation results. This allows for the priority selection of tools with better actual performance in subsequent tool selection and weight allocation processes, gradually suppressing the participation of poorly performing tools in the fusion calculation. Ultimately, this improves the overall recommendation accuracy and user satisfaction, enabling the recommendation system to achieve long-term self-learning and adaptive optimization.
[0079] As an optional embodiment, adjusting the historical performance index of the target recommendation tool based on the performance evaluation score includes: comparing the performance evaluation score with a first threshold and a second threshold, wherein the first threshold is greater than the second threshold; if the performance evaluation score is greater than the first threshold, then adjusting the corresponding historical performance index upward according to a gain coefficient; if the performance evaluation score is less than the second threshold, then adjusting the corresponding historical performance index downward according to a decay coefficient, wherein the gain coefficient is greater than the target value and the decay coefficient is less than the target value.
[0080] The calculated performance evaluation score is compared with two preset thresholds, namely a first threshold and a second threshold, where the first threshold is greater than the second threshold. For example, the first threshold could be 0.7 and the second threshold could be 0.5.
[0081] If the performance evaluation score is greater than the first threshold, the recommendation task is deemed to have significantly outperformed expectations. At this point, a gain coefficient is used to adjust the historical performance metrics of all target recommendation tools participating in this recommendation process. This adjustment is typically a multiplicative operation; for example, the new historical performance metric = the old historical performance metric × the gain coefficient.
[0082] If the performance evaluation score is lower than the second threshold, the recommended task is deemed to have performed significantly worse than expected. In this case, the historical performance metrics of the relevant tools are adjusted downwards using a decay coefficient. The adjustment can also be a multiplicative operation: for example, new historical performance metric = old historical performance metric × decay coefficient.
[0083] If the effectiveness evaluation score is between the first threshold and the second threshold (inclusive), the effectiveness of this recommendation is considered to be within the normal fluctuation range and no special adjustment is required. In this case, the historical effectiveness indicators of the relevant tools will remain unchanged.
[0084] The target value provided in this application is 1, the gain coefficient can be 1.1, and the attenuation coefficient can be 0.9.
[0085] By setting a dual-threshold adjustment range consisting of a first threshold and a second threshold, and combining gain coefficient and attenuation coefficient for segmented updates, the adjustment of historical performance indicators has a clear direction and controllable magnitude. This can quickly strengthen recommendation tools with excellent performance and promptly weaken recommendation tools with poor performance, thereby improving the accuracy of subsequent tool selection and weight allocation stages, and enhancing the stability and adaptive optimization capability of the entire multi-tool fusion recommendation system.
[0086] The application system architecture of the item recommendation method based on the MCP protocol provided in this application includes a user interface layer, a parameter acquisition layer, a core processing layer, a tool library layer, and a feedback optimization layer. The system starts at the top-level user interface layer, which receives user recommendation requests from external sources. The request is first passed to the parameter acquisition layer, which obtains the required parameters through a three-level strategy: firstly, it reads from the Redis cache; if no match is found, it queries the MySQL database; if still no results are found, it falls back to the product service API to obtain default values. After obtaining the parameters, the process enters the core processing layer. This layer first uses a large-model rating prediction module to predict user preference ratings using a large model. Subsequently, the large-model tool selection module intelligently selects suitable MCP tools from the tool library layer based on the analysis results. The tool library layer deploys five MCP recommendation tools, including Trending RecommendService, Collaborative Filtering Func, Deep Recommend Service, and Random RecommendFunc. After selecting a tool, the n-round optimization module initiates three rounds of progressive optimization processing: the first round selects basic tools, the second round dynamically adjusts the weights of the selected tools, and the third round prepares for result fusion. The optimized tools are invoked and executed through the MCP tool layer, and their outputs are sent to the result fusion module. This module weights and fuses the results from each tool to form a preliminary recommendation list, which is then output as the recommendation result. Simultaneously, the system establishes a feedback optimization closed loop. The feedback optimization layer monitors actual user interactions with the recommendation results through the feedback collection module, quantitatively evaluates the recommendation effect through the effect evaluation module, and dynamically adjusts the weights of each tool based on the evaluation results through the weight update module. The updated weight information is fed back to the tool selection stage of the core processing layer, thereby optimizing subsequent recommendation decisions and forming a complete data closed loop from recommendation results to feedback collection, effect evaluation, and weight updates, ultimately influencing tool selection.
[0087] The entire system starts with user requests, goes through parameter acquisition, model prediction, intelligent tool selection and multiple rounds of optimization, tool execution and result fusion, and finally outputs recommendation results. It also continuously iterates with real-time feedback, forming a data-driven and self-optimizing intelligent recommendation process.
[0088] This application provides an item recommendation method based on the MCP protocol, comprising: acquiring user profile data of a target user, user historical behavior data, current recommendation scenario information, and item feature data of candidate items; inputting the user profile data, user historical behavior data, and current recommendation scenario information as input data into a large language model, so as to determine at least one candidate recommendation tool from multiple initial recommendation tools through the large language model, wherein the initial recommendation tools follow the MCP protocol, and different candidate recommendation tools run different recommendation algorithms; performing multiple rounds of optimization processing on the candidate recommendation tools based on the item feature data and the historical performance indicators of the candidate recommendation tools, so as to determine the target item to be actually used from the candidate recommendation tools. The system employs a recommendation tool and its corresponding fusion weights. Through the execution interface defined by the MCP protocol, various target recommendation tools are invoked in parallel. Each target recommendation tool calculates a recommendation score based on the user's historical behavior data and the item feature data of the candidate items, thereby generating an initial item recommendation list for each target recommendation tool. This initial item recommendation list includes the item identifier and recommendation score of each candidate item. The recommendation scores of the same item in different initial item recommendation lists are weighted according to the fusion weights of the target recommendation tools to obtain a weighted score for each item. The items are then sorted in descending order according to the weighted scores to generate a target item recommendation list. By intelligently screening candidate tools using a large language model and performing multiple rounds of optimization based on item features and historical performance, the target tools and their weights are determined. Finally, the system uses the MCP protocol to incur parallel calls to calculate scores and perform weighted fusion, enabling dynamic selection and combination of recommendation tools. This solves the problem of not being able to dynamically recommend the most suitable items in real time based on user, scenario, and item features.
[0089] According to another aspect of the embodiments of this application, this application provides an item recommendation device based on the MCP protocol, such as... Figure 7 As shown, it includes: The acquisition module 701 is used to acquire user profile data, user historical behavior data, current recommendation scenario information, and item feature data of candidate items for the target user; The first determining module 702 is used to input user profile data, user historical behavior data and current recommendation scenario information as input data into the large language model, so as to determine at least one candidate recommendation tool from multiple initial recommendation tools through the large language model. The initial recommendation tools follow the MCP protocol, and different candidate recommendation tools run different recommendation algorithms. The second determining module 703 is used to perform multiple rounds of optimization on the candidate recommendation tools based on the item feature data and the historical performance indicators of the candidate recommendation tools, so as to determine the target recommendation tool to be used and the corresponding fusion weight from the candidate recommendation tools. The first calculation module 704 is used to call various target recommendation tools in parallel through the execution interface defined by the MCP protocol. Each target recommendation tool calculates a recommendation score based on the user's historical behavior data and the item feature data of the candidate items, thereby generating an initial item recommendation list corresponding to each target recommendation tool. The initial item recommendation list includes the item identifier and recommendation score of each candidate item. The second calculation module 705 is used to perform weighted calculation of the recommendation score of the same item in different initial item recommendation lists according to the fusion weight of the target recommendation tool, so as to obtain the weighted score of each item. The sorting module 706 is used to sort the items in descending order according to their weighted scores and generate a recommended list of target items.
[0090] It should be noted that the acquisition module 701 in this embodiment can be used to execute step 201 in this application embodiment, the first determination module 702 in this embodiment can be used to execute step 202 in this application embodiment, the second determination module 703 in this embodiment can be used to execute step 203 in this application embodiment, the first calculation module 704 in this embodiment can be used to execute step 204 in this application embodiment, the second calculation module 705 in this embodiment can be used to execute step 205 in this application embodiment, and the arrangement module 706 in this embodiment can be used to execute step 206 in this application embodiment.
[0091] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of a device, can operate in environments such as... Figure 1 The hardware environment shown.
[0092] According to another aspect of the embodiments of this application, this application provides an electronic device, such as... Figure 8 As shown, it includes a memory 801, a processor 803, a communication interface 805, and a communication bus 807. The memory 801 stores a computer program that can run on the processor 803. The memory 801 and the processor 803 communicate through the communication interface 805 and the communication bus 807. When the processor 803 executes the computer program, it implements the steps of the above method.
[0093] The memory and processor in the aforementioned electronic devices communicate with each other via a communication bus and a communication interface. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0094] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0095] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0096] According to another aspect of the embodiments of this application, a computer-readable medium having processor-executable non-volatile program code is also provided.
[0097] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.
[0098] In specific implementation, the embodiments of this application can be referred to the above embodiments and have corresponding technical effects.
[0099] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0100] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0101] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0102] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0103] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0104] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0105] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0106] If the aforementioned function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks. It should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. In the absence of further restrictions, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0107] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for recommending items based on the MCP protocol, characterized in that, include: Acquire user profile data, historical user behavior data, current recommendation scenario information, and item feature data of candidate items for the target user; The user profile data, the user historical behavior data, and the current recommendation scenario information are input into a large language model to determine at least one candidate recommendation tool from multiple initial recommendation tools. The initial recommendation tools follow the MCP protocol, and different candidate recommendation tools run different recommendation algorithms. The candidate recommendation tools are optimized in multiple rounds based on the item feature data and the historical performance indicators of the candidate recommendation tools, so as to determine the target recommendation tool to be used and the corresponding fusion weight from the candidate recommendation tools; Through the execution interface defined by the MCP protocol, each of the target recommendation tools is called in parallel. Each target recommendation tool calculates a recommendation score based on the user's historical behavior data and the item feature data of the candidate items, thereby generating an initial item recommendation list corresponding to each target recommendation tool. The initial item recommendation list includes the item identifier and recommendation score of each candidate item. The recommendation scores of the same item in different initial item recommendation lists are weighted according to the fusion weight of the target recommendation tool to obtain the weighted scores of each item. The items are sorted in descending order according to the weighted scores, and a recommended list of target items is generated.
2. The method according to claim 1, characterized in that, The step of inputting the user profile data, the user's historical behavior data, and the current recommendation scenario information into the large language model includes: The user profile data is processed by field encoding to generate a user profile feature vector, and the user's historical behavior data is processed by feature extraction to generate a behavior sequence feature vector. The user profile feature vector, the behavior sequence feature vector, and the scene label of the current recommended scene are concatenated according to a preset prompt template to obtain the model input text data; The input text data is then input into the large language model.
3. The method according to claim 1, characterized in that, The step of determining at least one candidate recommendation tool from multiple initial recommendation tools using the large language model includes: Receive response data returned by the large language model, wherein the response data includes a tool identifier and a corresponding text explaining the reason for selection; Based on the tool identifier, query the availability status of the tool corresponding to the tool identifier in the MCP service registry; The initial recommendation tool whose tool availability status is valid is identified as the candidate recommendation tool.
4. The method according to claim 1, characterized in that, The multi-round optimization process includes a basic screening round, which includes: Calculate the behavioral matching degree between each of the candidate recommendation tools and the user's historical behavior data, and calculate the feature matching degree between each of the candidate recommendation tools and the item feature data; The historical performance index, behavior matching degree, and feature matching degree of the candidate recommendation tool are weighted and calculated to obtain a weighted sum; The weighted sum is used as the predicted performance value of the candidate recommendation tool in the current recommendation scenario; The candidate recommendation tools whose predicted performance values are greater than a preset performance threshold are integrated to obtain a basic toolset.
5. The method according to claim 4, characterized in that, The multi-round optimization process includes weight calculation rounds, which are executed after the basic screening rounds. These weight calculation rounds include: For each tool in the basic toolset, the historical performance index and feedback effect index of the tool are obtained, wherein the historical performance index is a long-term performance evaluation value obtained based on the historical recommendation effect statistics of the tool, and the feedback effect index is a short-term performance evaluation value calculated based on user feedback data. Obtain the time decay factor of the tool, wherein the time decay factor is a decay coefficient calculated based on the time difference between the last time the tool was called and the current time; Based on the historical performance indicators, the feedback effect indicators, and the time decay factor, the initial weight value of the tool is calculated through a weighted linear combination. The initial weight values of each tool are normalized to obtain the fusion weights corresponding to each tool. The fusion weights are assigned to the corresponding tools to obtain the target recommendation tool including the fusion weights.
6. The method according to claim 1, characterized in that, After generating the target item recommendation list, the method further includes: Monitor and collect the interaction behavior data of the target user with each item in the target item recommendation list, wherein the interaction behavior data includes at least one of click behavior, purchase behavior, dwell time data and rating data; Based on the interaction behavior data, calculate the performance evaluation score of the current recommendation task; The historical performance metrics of the target recommendation tool are adjusted based on the performance evaluation scores.
7. The method according to claim 6, characterized in that, The step of adjusting the historical performance metrics of the target recommendation tool based on the performance evaluation score includes: The performance evaluation score is compared with a first threshold and a second threshold, wherein the first threshold is greater than the second threshold; If the performance evaluation score is greater than the first threshold, the corresponding historical performance index is adjusted upward according to the gain coefficient; if the performance evaluation score is less than the second threshold, the corresponding historical performance index is adjusted downward according to the attenuation coefficient, wherein the gain coefficient is greater than the target value and the attenuation coefficient is less than the target value.
8. A product recommendation device based on the MCP protocol, characterized in that, include: The acquisition module is used to acquire user profile data, user historical behavior data, current recommendation scenario information, and item feature data of candidate items for the target user; The first determining module is used to input the user profile data, the user historical behavior data, and the current recommendation scenario information as input data into a large language model, so as to determine at least one candidate recommendation tool from multiple initial recommendation tools through the large language model, wherein the initial recommendation tools follow the MCP protocol, and different candidate recommendation tools run different recommendation algorithms; The second determining module is used to perform multiple rounds of optimization processing on the candidate recommendation tools based on the item feature data and the historical performance indicators of the candidate recommendation tools, so as to determine the target recommendation tool to be used and the corresponding fusion weight from the candidate recommendation tools; The first calculation module is used to call each of the target recommendation tools in parallel through the execution interface defined by the MCP protocol. Each target recommendation tool calculates a recommendation score based on the user's historical behavior data and the item feature data of the candidate items, thereby generating an initial item recommendation list corresponding to each target recommendation tool. The initial item recommendation list includes the item identifier and recommendation score of each candidate item. The second calculation module is used to perform weighted calculation on the recommendation score of the same item in different initial item recommendation lists according to the fusion weight of the target recommendation tool, so as to obtain the weighted score of each item. The sorting module is used to sort the items in descending order according to the weighted score and generate a recommended list of target items.
9. An electronic device comprising a memory, a processor, a communication interface, and a communication bus, wherein the memory stores a computer program executable on the processor, and the memory and the processor communicate via the communication bus and the communication interface, characterized in that... When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable medium having processor-executable non-volatile program code, characterized in that, The program code causes the processor to execute the method of any one of claims 1 to 7.