Commodity service recommendation method and system

By training the recommendation model locally on the client and uploading it to the service terminal for aggregation, combined with the reorder optimization of the large language model, the challenge of data privacy protection in traditional recommendation systems is solved, and efficient and accurate product and service recommendations are achieved under the premise of protecting privacy.

CN119557519APending Publication Date: 2025-03-04PEKING UNIV

Patent Information

Application Number
CN202510131974.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-06
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

Traditional recommendation systems have challenges in data privacy protection, and centralized storage of user data can lead to privacy leakage and security issues, especially in the context of increasingly stringent requirements by laws and regulations such as the General Data Protection Regulations.

Method used

By training the recommendation model locally on the client, using the user historical interaction behavior dataset within the client, generate the local recommendation model and upload it to the service terminal. The service terminal aggregates the local recommendation models of multiple clients to generate a global recommendation model. The client processes user data based on the global recommendation model, generates the initial candidate recommendation set, and reorders and optimizes through the large language model, and finally outputs the service recommendation results through similarity verification.

Benefits of technology

On the premise of protecting user data privacy, accurate product and service recommendations are achieved, improving the prediction capabilities and user experience of the recommendation system, and avoiding the risk of data privacy leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557519A_ABST
    Figure CN119557519A_ABST
Patent Text Reader

Abstract

The invention provides a commodity service recommendation method and system, and belongs to the technical field of artificial intelligence, and the method comprises the steps: receiving a global recommendation model issued by a service terminal; processing the historical interaction behavior data set of the user in the client based on the global recommendation model to obtain an initial candidate recommendation set; a preset cue word template is filled with the initial candidate recommendation set and the historical interaction behavior data set, and recommended cue words are generated; inputting the recommendation prompt words into the large language model to obtain a reordering recommendation candidate set output by the large language model; and performing similarity verification on the initial candidate recommendation set and the reordering recommendation candidate set of each user, screening out unmatched recommendation items in the initial candidate recommendation set, and outputting a service recommendation result. According to the method, distributed collaboration of federal learning and semantic comprehension and generation capability of a large language model are combined, so that accurate commodity service recommendation is realized on the premise of protecting data privacy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a product service recommendation method and system. Background Art

[0002] With the rapid development of information technology and artificial intelligence, recommendation systems have been widely used in e-commerce, video streaming, online education, healthcare and other fields, becoming an important tool for improving user experience and improving platform operation efficiency. Recommendation systems predict users' interests by analyzing their historical behaviors, preferences and characteristics, and recommend products or services to them. In this process, traditional recommendation systems mainly rely on collaborative filtering, matrix decomposition and deep learning-based models such as convolutional neural networks, recurrent neural networks and self-attention mechanisms.

[0003] However, these traditional methods face the following major challenges in practical applications: First, data privacy issues. Traditional recommendation systems usually require centralized storage of user data to build global models. However, centralized data storage may lead to privacy leakage, data abuse, and security issues. With the increasing demand for data privacy protection from users and the introduction of relevant laws and regulations such as the General Data Protection Regulation (GDPR), how to achieve accurate product and service recommendations while protecting data privacy has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present invention provides a product and service recommendation method, system, electronic device and storage medium, which are used to solve the defects in the prior art and realize accurate product and service recommendation under the premise of protecting data privacy.

[0005] The present invention provides a commodity service recommendation method, which is applied to a client and includes the following steps: Obtaining a local recommendation model, and uploading the local recommendation model to a service terminal; Receiving a global recommendation model sent by the service terminal, where the global recommendation model is obtained by aggregating local recommendation models of various clients by the service terminal; Processing the historical interaction behavior dataset of users in the client based on the global recommendation model to obtain an initial candidate recommendation set; Filling the initial candidate recommendation set and the historical interaction behavior data set into a preset prompt word template to generate a recommendation prompt word; Inputting the recommendation prompt words into a large language model to obtain a re-ranked recommendation candidate set output by the large language model; A similarity check is performed on each user's initial candidate recommendation set and the re-ranked recommendation candidate set, unmatched recommendation items in the initial candidate recommendation set are screened out, and a service recommendation result is output.

[0006] According to a commodity service recommendation method provided by the present invention, the local recommendation model is obtained by training the client, and the training method of the local recommendation model specifically includes: Obtain the historical interaction behavior dataset of all users in the client; Using at least one interactive behavior data in at least one of the historical interactive behavior data sets as a training sample, and using the next interactive behavior data of the interactive behavior data as a training label; Inputting the training sample into the model to be trained to obtain the predicted interaction behavior data output by the model to be trained; Constructing a loss function based on all of the training labels and all of the predicted interaction behavior data; Taking the value of minimizing the loss function as a training goal, the model to be trained is trained to obtain the local recommendation model.

[0007] According to a commodity service recommendation method provided by the present invention, the similarity check is performed on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, unmatched recommendation items in the initial candidate recommendation set are screened out, and the service recommendation result is output, which specifically includes: Inputting each user's initial candidate recommendation set and re-ranked recommendation candidate set into the text embedding model respectively to obtain a first embedding data set and a second embedding data set for each user; Select any first embedding vector from the first embedding data set, determine a second embedding vector corresponding to the first embedding vector in the second embedding data set, and calculate the cosine similarity between each first embedding vector and the corresponding second embedding vector; Target recommendation data is screened out from each of the initial candidate recommendation sets according to all of the cosine similarities to obtain a recommendation result for each user.

[0008] According to a method for recommending goods and services provided by the present invention, the method of filtering out target recommendation data from each of the initial candidate recommendation sets according to all the cosine similarities to obtain a recommendation result for each user specifically includes: Determine at least one target embedding vector from all the first embedding vectors, wherein the cosine similarity corresponding to the target embedding vector is greater than a preset threshold; Target recommendation data corresponding to the target embedding vector is screened out from the initial candidate recommendation set to obtain the recommendation result.

[0009] The present invention also provides a commodity service recommendation method, which is applied to a service terminal and comprises the following steps: Receiving local recommendation models uploaded by multiple clients; Aggregating all the local recommendation models to obtain a global recommendation model, wherein the global recommendation model is used to process the historical interaction behavior dataset of users in the client to obtain an initial candidate recommendation set; The global recommendation model is sent to each of the clients, so that each of the clients fills the initial candidate recommendation set and the historical interaction behavior data set into a preset prompt word template according to the initial candidate recommendation set, generates recommendation prompt words, and inputs the recommendation prompt words into the large language model to obtain the re-ranked recommendation candidate set output by the large language model, and performs a similarity check on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, screens out unmatched recommendation items in the initial candidate recommendation set, and outputs a service recommendation result.

[0010] According to a commodity service recommendation method provided by the present invention, aggregating all the local recommendation models to obtain a global recommendation model specifically includes: Determining a first model parameter of each of the local recommendation models; Summing all the first model parameters and calculating the average value to obtain the second model parameter; The parameters of the initial global model are updated according to the second model parameters to obtain the global recommendation model.

[0011] The present invention also provides a commodity service recommendation system, which is applied to a client and includes the following modules: An uploading module, used to obtain a local recommendation model and upload the local recommendation model to a service terminal; A first receiving module is used to receive a global recommendation model sent by the service terminal, where the global recommendation model is obtained by aggregating local recommendation models of various clients by the service terminal; A first processing module, configured to process a historical interaction behavior dataset of users in the client based on the global recommendation model to obtain an initial candidate recommendation set; The first processing module is further used to fill the initial candidate recommendation set and the historical interaction behavior data set into a preset prompt word template to generate a recommendation prompt word; The first processing module is further used to input the recommendation prompt word into the large language model to obtain a re-ranked recommendation candidate set output by the large language model; The first processing module is further used to perform similarity verification on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, filter out unmatched recommendation items in the initial candidate recommendation set, and output service recommendation results.

[0012] The present invention also provides a commodity service recommendation system, which is applied to a service terminal and includes the following modules: A second receiving module is used to receive local recommendation models uploaded by multiple clients; A second processing module is used to aggregate all the local recommendation models to obtain a global recommendation model, and the global recommendation model is used to process the historical interaction behavior data set of users in the client to obtain an initial candidate recommendation set; A sending module is used to send the global recommendation model to each of the clients, so that each of the clients fills the initial candidate recommendation set and the historical interaction behavior data set into a preset prompt word template according to the initial candidate recommendation set, generates recommendation prompt words, and inputs the recommendation prompt words into the large language model to obtain the re-ranked recommendation candidate set output by the large language model, and performs similarity verification on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, screens out unmatched recommendation items in the initial candidate recommendation set, and outputs service recommendation results.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the product and service recommendation method as described above is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for recommending goods and services.

[0015] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned commodity and service recommendation methods.

[0016] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: By obtaining the local recommendation model and uploading it to the service terminal, the client can model the local data in a distributed training manner under the premise of protecting the privacy of user data, and upload the model parameters to the service terminal instead of the user data, thereby ensuring privacy security while providing decentralized and diverse data features for the subsequent generation of the global model. By receiving the global recommendation model issued by the service terminal, the client can use the global model generated by the service terminal after aggregating multiple local recommendation models to integrate the behavioral characteristics and preference patterns of different clients, thereby making up for the problem of insufficient generalization ability of a single client model due to limited data size. By inputting the historical interaction behavior dataset of each user in the client into the global recommendation model, the client can generate an initial candidate recommendation set covering the user's possible points of interest based on the comprehensive capabilities of the global model. By inputting the initial candidate recommendation set and the historical interaction behavior dataset of each user into the preset prompt word template to generate the recommendation prompt word for each user, the recommendation task can be converted into a natural language processing task, so that the user behavior and the candidate recommendation items are clearly associated semantically, thereby providing structured and semantically clear input for the subsequent large language model. By inputting each recommendation prompt into the large language model, the client can use the powerful semantic understanding and generation capabilities of the large language model to re-rank and optimize the candidate recommendation set. By performing similarity verification on each user's initial candidate recommendation set and the re-ranked candidate recommendation set, it is possible to effectively filter out recommendation items that do not match user needs, especially filter out hallucination recommendation items generated by the large language model, thereby improving the accuracy of recommendation results and achieving accurate product and service recommendations while protecting data privacy. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 This is one of the flow charts of the commodity service recommendation method provided by the present invention.

[0019] Figure 2 This is the second flow chart of the commodity service recommendation method provided by the present invention.

[0020] Figure 3 This is the third flow chart of the commodity service recommendation method provided by the present invention.

[0021] Figure 4 This is the fourth flow chart of the commodity service recommendation method provided by the present invention.

[0022] Figure 5 This is the fifth flow chart of the commodity service recommendation method provided by the present invention.

[0023] Figure 6 This is the sixth flow chart of the commodity service recommendation method provided by the present invention.

[0024] Figure 7 It is a structural diagram of the commodity service recommendation system provided by the present invention.

[0025] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] It should be noted that, in the description of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The orientation or positional relationship indicated by the terms "upper", "lower", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the system or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.

[0028] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged when appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" means at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0029] Combine the following Figure 1-Figure 8 The present invention describes the commodity service recommendation method, system, electronic device and storage medium provided by the present invention.

[0030] Figure 1 This is one of the flow charts of the commodity service recommendation method provided by the present invention. The method can first be applied to the client, such as Figure 1 As shown, including but not limited to the following steps: Step 101: Obtain a local recommendation model and upload the local recommendation model to a service terminal.

[0031] In the design of the recommendation system, the process of obtaining the local recommendation model and uploading it to the service terminal is based on the need to protect user data privacy and realize distributed collaborative recommendation. The training of the local recommendation model mainly relies on the user's historical interaction behavior dataset in the client, which contains the user's click, browse, purchase and other behavior information. This information is highly personalized, but due to the need for privacy protection, this data cannot be directly uploaded to the service terminal. By training the recommendation model locally on the client, accurate modeling of user historical behavior can be achieved, while avoiding the risk of leakage of user data during network transmission.

[0032] The following embodiments will explain in detail the specific training method of the local recommendation model.

[0033] In one possible implementation, refer to Figure 2 , Figure 2 This is the second flow chart of the commodity service recommendation method provided by the present invention. The local recommendation model is trained by the following steps: Step 201: Obtain the historical interaction behavior dataset of all users in the client.

[0034] Step 202: taking at least one interactive behavior data in at least one historical interactive behavior data set as a training sample, and taking the next interactive behavior data of the interactive behavior data as a training label.

[0035] Step 203: input the training sample into the model to be trained to obtain the predicted interaction behavior data output by the model to be trained.

[0036] Step 204: Construct a loss function based on all training labels and all predicted interaction behavior data.

[0037] Step 205: Taking the value of minimizing the loss function as the training objective, the model to be trained is trained to obtain a local recommendation model.

[0038] In the recommendation system, the historical interaction behavior dataset of each user in the client is the core data source for building the local recommendation model. By analyzing the user's behavior data, the model can learn the user's preference pattern and predict his or her future interaction behavior. Due to the need for data privacy protection, this data is restricted to local processing and modeling on the client. The goal of obtaining this data is to ensure that the recommendation model can achieve efficient learning of user personalized behavior with sufficient sample support.

[0039] Specifically, in step 201, the client extracts the historical interaction behavior dataset of all users from the local database. Each record usually contains a timestamp, interaction type (such as click, purchase, favorite, etc.), interaction target (such as the identifier of the product or service), and context features (such as device type, geographic location, etc.). After preprocessing, these data are used to train the model.

[0040] In step 202, each piece of historical interaction behavior data is used as a training sample, and the next interaction behavior data corresponding to the behavior is used as a training label. The intention of this design is to capture the sequential characteristics of user behavior, that is, the user's behavior at a certain point in time may directly affect his next action. For example, after browsing a certain category of goods, the user is more likely to click on similar goods, or after searching for specific keywords, he is more inclined to buy goods related to the keyword. Through this way of constructing samples and labels, the model can learn the temporal dependencies between user behaviors.

[0041] In step 203, the training samples are input into the model to be trained, and the model generates predicted interactive behavior data based on the input data. The model to be trained can be a deep neural network with strong nonlinear fitting capabilities, so that it can capture complex user behavior characteristics. During the prediction process, the model calculates based on the input features and generates a predicted value of the user's possible next behavior.

[0042] In step 204, the difference between the model's predicted output and the actual behavior label is measured by the cross entropy loss function. Assume that the user's historical interaction behavior dataset in the client is , each piece of data contained in It consists of training samples x and corresponding training labels y. Input x represents the user's historical behavior characteristics, such as browsing history, click type, etc.; label y represents the user's next interactive behavior goal, such as purchasing a certain product or clicking on a certain service.

[0043] The predicted output of the model can be expressed as ,in is the model's prediction result for input x, usually a probability distribution, indicating the possibility of users choosing different behavior goals. The difference between the actual label y and the cross entropy loss function is expressed as: ; in, represents the cross entropy loss; Indicates that in the entire data set Perform the expected operation on the samples (i.e. take the average value); is the loss of a single sample (x, y), specifically: ; Where C represents the number of categories of interactive behaviors, is the distribution of the true label on category c (such as the value of 1 or 0 in one-hot encoding), is the probability of class c predicted by the model.

[0044] Through the above formula, the loss function can measure the prediction performance of the model on the entire dataset. A larger loss value means that the model prediction deviates greatly from the actual behavior, while a smaller loss value means that the model captures the user's behavior pattern more accurately.

[0045] In the specific implementation, the calculation of the loss function is automatically completed by the deep learning framework (such as TensorFlow or PyTorch). The predicted output of the model and the actual label are calculated through the built-in cross entropy loss module of the framework to calculate the average loss value of each batch of samples, and the result is used to guide the optimization of model parameters.

[0046] In step 205, the parameters of the model are iteratively updated through an optimization algorithm with the goal of minimizing the loss function. Common optimization methods include gradient descent and its variants (such as the Adam optimization algorithm), which can efficiently adjust the model parameters to make it more accurate in predicting user behavior. After multiple rounds of training, when the value of the loss function converges to a preset threshold or reaches the training round limit, a local recommendation model is finally generated.

[0047] Through steps 201 to 205, the client successfully trains a recommendation model based on local data, and can generate personalized prediction results based on user behavior characteristics. This design not only utilizes the rich behavioral data in the client, but also avoids the risk of leakage of user privacy data. After the training is completed, the parameters of the local recommendation model can be uploaded to the service terminal to provide support for the construction of the global recommendation model. In this way, the requirements of data privacy protection are met, and the prediction ability of the recommendation system is improved through local modeling, laying the foundation for the subsequent recommendation process.

[0048] Step 102: receiving a global recommendation model sent by the service terminal. The global recommendation model is obtained by aggregating local recommendation models of various clients by the service terminal.

[0049] Specifically, after receiving the local recommendation models uploaded by each client, the service terminal will use the aggregation algorithm to integrate the parameters of these models to generate a global recommendation model. The global recommendation model is a comprehensive abstraction of the local recommendation models of each client, which includes the behavior patterns of a wider user group. After the service terminal completes the generation of the global recommendation model, it sends the model to each client. By receiving and loading the global recommendation model, the client can predict the user's historical interaction behavior data based on it.

[0050] When the client receives the global recommendation model, the model parameter file is usually encrypted to ensure data security. For example, a secure communication protocol (such as TLS) is used to transmit the model file to prevent the data from being stolen or tampered with during transmission. After the client receives the global recommendation model, it will store it locally for subsequent prediction tasks.

[0051] Step 103: Process the historical interaction behavior dataset of users in the client based on the global recommendation model to obtain an initial candidate recommendation set.

[0052] In the recommendation system, inputting the historical interaction behavior dataset of each user in the client into the global recommendation model is an important step in generating the initial candidate recommendation set, and is also the basis for the subsequent recommendation prompt construction and sorting optimization. Through the predictive ability of the global recommendation model, the user's historical behavior can be combined with the global data features to generate a candidate recommendation set that covers the user's potential interests, thereby providing high-quality alternatives for personalized recommendations.

[0053] The global recommendation model is generated by the service terminal based on the aggregation of local recommendation model parameters uploaded by each client, and has strong generalization ability. Because it integrates the user behavior patterns of multiple clients, it can effectively capture a wider range of interest characteristics. On the client side, the historical interaction behavior dataset is the input of the model prediction, which usually includes the user's browsing history, purchase behavior, interaction time, and context information. After preprocessing, these data are input into the global recommendation model to predict the user's possible next behavior or interest point.

[0054] In the specific implementation process, the global recommendation model accepts the user's historical behavior data set as input, and generates a list of candidate recommendation items that the user may be interested in through the calculation process of deep learning models such as neural networks. The output of the global recommendation model is usually a probability distribution, which indicates the user's preference for different recommended items. By sorting these probability values, several items with high rankings are selected as the initial candidate recommendation set. For example, if the probability value output by the model corresponds to a product or service number, the initial candidate recommendation set is the specific product or service pointed to by these numbers.

[0055] By inputting the user's historical interaction behavior data into the global recommendation model, the client can make full use of the prediction ability of the global model and combine the user's individual characteristics with the global data characteristics. The final generated initial candidate recommendation set lays the foundation for the subsequent prompt word construction and intelligent sorting, which can significantly improve the accuracy of the recommendation system.

[0056] Step 104: Fill the initial candidate recommendation set and the historical interaction behavior data set into the preset prompt word template to generate the recommendation prompt word.

[0057] In the recommendation system, inputting each user's initial candidate recommendation set and historical interaction behavior dataset into the preset prompt word template to generate each user's recommendation prompt words is a key step to improve the personalization and accuracy of recommendation results. By constructing recommendation prompt words, the user's behavioral characteristics and the information of candidate recommendation items can be semantically combined to provide clear and structured input for the processing of the large language model, thereby realizing intelligent re-ranking of the candidate recommendation set.

[0058] The initial candidate recommendation set generated by the global recommendation model is based on the prediction of the user's historical behavior, and contains several products or services that may be in line with the user's interests. The historical interactive behavior dataset is a record of the user's actual past behavior, including information such as clicks, purchases, and browsing. These data can reflect the user's interests, preferences, and behavioral habits. However, directly using these two parts of data for sorting may have problems such as lack of intuitive expression and weak relevance. Therefore, it is an important means to improve the understanding and processing capabilities of large language models by converting user behavior data and candidate recommendation items into natural language prompts through preset prompt word templates.

[0059] Specifically, the preset prompt word template is a predefined format used to convert user historical behaviors and candidate recommendation items into structured natural language input. The construction of the prompt word template may include the following: Introduce user behavior context, for example: "Based on the user's recent browsing history, including [product A], [product B]..." Combine candidate recommendation items, for example: "Recommend the following products, arranged in the order in which the user may be interested: [Candidate 1], [Candidate 2]..."; Add guide words, such as: "Please sort these products according to user preferences."

[0060] Through this design, the generated recommendation prompt words can clearly describe the user's historical behavior and the requirements of the current recommendation task, allowing the large language model to fully understand the relationship between the user's preferences and candidate recommendation items at the semantic level.

[0061] After the prompt words are generated, the text information will be passed as input to the large language model. Since the large language model has powerful natural language understanding and generation capabilities, it can comprehensively analyze the user's interest patterns and candidate item features based on the prompt word content, thereby generating personalized ranking results for each user.

[0062] Step 105: Input the recommendation prompt words into the large language model to obtain a re-ranked recommendation candidate set output by the large language model.

[0063] In the recommendation system, inputting each recommendation prompt word into the large language model and generating a re-ranked recommendation candidate set for each user is an important step to achieve optimization of recommendation results. By utilizing the powerful natural language processing capabilities of the large language model, the initial candidate recommendation set can be more deeply understood and ranked, thereby generating recommendation results that better meet the user's personalized needs.

[0064] The initial candidate recommendation set is generated by the global recommendation model and can cover the user's possible interests, but its ranking is based only on the simple association between the user's historical behavior and the candidate items, lacking higher-level semantic optimization. The recommendation prompt word is a natural language input generated by combining the user's historical interaction behavior dataset with the initial candidate recommendation set. The large language model can analyze the semantic information of the prompt word, deeply explore the user's interest pattern and the characteristics of the candidate items, and re-rank them on this basis to output an optimized re-ranked recommendation candidate set.

[0065] In the specific implementation, the large language model uses zero-shot learning to perform ranking optimization. This means that no additional training is required for specific recommendation tasks, and recommendation optimization can be completed only through prompt words and the powerful language understanding ability of the pre-trained model. The content of the recommendation prompt word usually includes the user's behavioral background and a list of candidate recommendation items, and uses the guiding language to request the large language model to sort the candidate items according to the user's interests. The prompt word is passed to the large language model through the input interface, and the large language model generates a re-ranked list of recommendation items based on its built-in knowledge and semantic reasoning capabilities.

[0066] During the processing of the large language model, the ranking of each candidate recommendation item may include: similar items mentioned in the user's historical behavior, the characteristics of the candidate item itself (such as category, price, evaluation, etc.), and the user's potential preference characteristics. The large language model combines these factors to perform multi-dimensional analysis and optimization on the candidate recommendation set to ensure that the output re-ranked recommendation candidate set can meet user needs to the greatest extent possible.

[0067] Step 106: Perform similarity verification on the initial candidate recommendation set and the re-ranked candidate recommendation set for each user, filter out unmatched recommendation items in the initial candidate recommendation set, and output the service recommendation result.

[0068] In the recommendation system, similarity verification of each user's initial candidate recommendation set and re-ranked candidate recommendation set is a key step to ensure the credibility of recommendation results and optimize user experience. Through similarity verification, mismatched recommendation items can be effectively screened out, especially false or irrelevant hallucination recommendation items that may be generated by large language models during the re-ranking process, thereby outputting more reliable service recommendation results.

[0069] The re-ranked recommendation candidate set generated by the large language model is based on the result of semantic optimization, which is theoretically more in line with user needs. However, since the model may misunderstand or over-speculate the prompt words, the re-ranking results may contain hallucination recommendations that are not directly related to the initial candidate recommendation set. These mismatched recommendations not only fail to meet user needs, but may also have a negative impact on the user experience. Therefore, through the similarity verification mechanism, the initial candidate recommendation set is compared with the re-ranked recommendation candidate set item by item, which can eliminate hallucination recommendations and ensure that the output recommendation results are true and relevant.

[0070] In one possible implementation, refer to Figure 3 , Figure 3 This is the third flow chart of the commodity service recommendation method provided by the present invention. Step 106 specifically includes steps 301-303: Step 301: Input each user's initial candidate recommendation set and re-ranked recommendation candidate set into the text embedding model respectively to obtain a first embedding data set and a second embedding data set for each user.

[0071] In the recommendation system, each user's initial candidate recommendation set and re-ranked candidate recommendation set are input into the text embedding model to obtain the first embedding data set and the second embedding data set for each user, which is an important pre-step for the subsequent similarity verification. By converting the recommended items into high-dimensional semantic embedding vectors, the similarity between the recommended items can be better quantified, providing a data basis for screening matching recommended items.

[0072] The initial candidate recommendation set is the prediction result output by the global recommendation model, which contains the recommended items that the user may be interested in; while the re-ranked recommendation candidate set is the optimized ranking result generated by the large language model based on the recommendation prompt words. These two sets represent the recommendation results at different stages, and their consistency directly determines the credibility of the final recommendation results. Since these recommended items are usually presented in text form (such as product names, descriptions, etc.), they need to be mapped to a high-dimensional vector space through a text embedding model to facilitate the subsequent calculation of the similarity between them.

[0073] In the specific implementation, the text embedding model is a pre-trained deep learning model that can convert the input text into a vector representation of fixed dimensions. The model is usually trained based on large-scale corpus and has the ability to capture the semantic features of the text. For example, BERT, GPT or similar natural language processing models can be used as embedding generators. For each recommendation item in the initial candidate recommendation set, its text description is converted into a high-dimensional vector by calling the embedding model. These vector sets constitute the first embedding dataset. Similarly, the same operation is performed on each recommendation item in the re-ranked recommendation candidate set to generate a second embedding dataset.

[0074] Through this process, the first embedding dataset and the second embedding dataset represent the vector representations of the initial candidate recommendation set and the re-ranked candidate recommendation set in the semantic space respectively. These embedding vectors can not only retain the text information of the recommended items, but also capture their semantic relevance, such as product category, purpose, keywords in the description, etc. This lays the foundation for calculating the similarity of the recommended items in the subsequent steps.

[0075] Step 302: Select any first embedding vector from the first embedding data set, determine a second embedding vector corresponding to the first embedding vector in the second embedding data set, and calculate the cosine similarity between each first embedding vector and the corresponding second embedding vector.

[0076] In the recommendation system, calculating the cosine similarity between each first embedding vector in the first embedding data set and each second embedding vector in the second embedding data set for each user is the core step to quantify the matching degree of the recommended items. By calculating the cosine similarity, the semantic consistency between the initial candidate recommendation set and the re-ranked candidate recommendation set can be measured in the vector space, thereby providing data support for the subsequent screening of matching recommended items.

[0077] The first embedding dataset consists of embedding vectors generated by the text embedding model for the recommended items in the initial candidate recommendation set, and the second embedding dataset consists of embedding vectors generated by the recommended items in the re-ranked recommendation candidate set. These two embedding datasets respectively represent the representation of the recommendation results of different stages of the recommendation system in the semantic space. Since the generation logic of the initial candidate recommendation set and the re-ranked recommendation candidate set is different and there is a certain inconsistency, it is necessary to calculate the degree of association between them through cosine similarity.

[0078] Specifically, cosine similarity expresses the similarity of two vectors by calculating the cosine value of the angle between them. The formula is: ; in, is the i-th first embedding vector, is the i-th second embedding vector, the numerator is the dot product of the two vectors, and the denominator is the product of the modulus of the two vectors. The dot product reflects the directional relationship of the vectors, and the modulus is used for normalization calculation to ensure that the value of cosine similarity is between [-1, 1], where 1 indicates a complete match and -1 indicates a complete mismatch.

[0079] In actual operation, for each user, each embedding vector in the first embedding data set is compared with each embedding vector in the second embedding data set one by one, and the cosine similarity between the two is calculated. This process can be efficiently implemented through vectorized calculation, for example, using matrix operations to parallelize the similarity calculation of multiple embedding vectors. The calculation results form a similarity matrix, and each element of the matrix represents the similarity between a certain recommended item in the initial candidate recommendation set and a certain recommended item in the re-ranked recommendation candidate set.

[0080] By calculating cosine similarity, the recommendation system can quantify the degree of match between the initial candidate recommendation set and the re-ranked candidate recommendation set, providing key data support for the subsequent screening steps. This calculation method has many effects: first, cosine similarity is an efficient and intuitive similarity measurement method, suitable for dealing with the matching problem of high-dimensional embedded vectors; second, cosine similarity can capture the semantic relevance of recommended items, making the final recommendation results more in line with user needs; finally, the similarity matrix constructed based on cosine similarity provides comprehensive support for screening and optimizing recommended items, improving the accuracy and reliability of the recommendation system.

[0081] Step 303: Filter target recommendation data from each initial candidate recommendation set according to all cosine similarities to obtain recommendation results for each user.

[0082] In the recommendation system, filtering out target recommendation data from the initial candidate recommendation set based on all cosine similarities is an important step to ensure that the recommendation results are consistent with user needs. By filtering out highly matched recommendation items, we can eliminate recommendation items that do not meet user interests, especially hallucination recommendation items that may be introduced during the generation of large language models, thereby improving the accuracy and reliability of recommendation results.

[0083] After the calculation of cosine similarity is completed, a similarity matrix is ​​obtained, in which each element represents the similarity between a certain recommendation item in the initial candidate recommendation set and a certain recommendation item in the re-ranked recommendation candidate set. In order to filter out the target recommendation data that meets the user's needs, it is necessary to perform a threshold determination on the values ​​in the similarity matrix to distinguish between matching and non-matching recommendation items.

[0084] In one possible implementation, refer to Figure 4 , Figure 4 This is the fourth flow chart of the commodity service recommendation method provided by the present invention. Step 303 specifically includes steps 401-402: Step 401: Determine at least one target embedding vector from all first embedding vectors, and the cosine similarity corresponding to the target embedding vector is greater than a preset threshold.

[0085] In the specific implementation process, for each first embedding vector, first extract its similarity value with all second embedding vectors in the calculated similarity matrix. Then, by comparing these similarity values, select the vector that meets the preset threshold as the candidate target embedding vector. The preset threshold is used to filter out the recommended items with low matching degree with the re-ranked recommendation candidate set, ensuring that only vectors with high semantic relevance are retained.

[0086] On the basis of threshold determination, a sorting mechanism can also be introduced. For example, for the first embedding vector that meets the threshold condition, sort it in descending order according to its maximum similarity value, and select several vectors with the highest ranking as the final target embedding vector. Through this process, the quality of the target recommendation data can be further optimized, so that the final recommendation result is both relevant and diverse.

[0087] This step can be efficiently implemented through vectorized computing, using parallel processing capabilities to quickly filter and sort target embedding vectors. At the same time, by adjusting the preset threshold and the number of target embedding vectors according to the scene requirements, it can flexibly adapt to different recommendation goals, such as retaining fewer but more relevant recommendations in high-precision scenarios, or appropriately lowering the threshold in diversity demand scenarios to expand the range of target recommendation data.

[0088] Step 402: Filter out target recommendation data corresponding to the target embedding vector from the initial candidate recommendation set to obtain a recommendation result.

[0089] The target embedding vectors are vectors selected by the matching condition with the preset threshold and the similarity sorting mechanism in step 401. These vectors represent the semantic features of the recommended items in the initial candidate recommendation set that are highly matched with the re-ranked recommendation candidate set. In order to convert these semantic features into actual recommended items, it is necessary to find the recommended data corresponding to each target embedding vector in the initial candidate recommendation set.

[0090] In the specific implementation process, each target embedding vector has a one-to-one corresponding index relationship with the recommended items in the initial candidate recommendation set. When generating the first embedding data set, the system has recorded the identifier of the corresponding recommended item for each embedding vector. Therefore, when filtering the target recommended data, it is only necessary to quickly find the corresponding recommended item according to the index of the target embedding vector and add it to the target recommended data set.

[0091] During the screening process, if the number of target embedding vectors is large, a certain number limit can be introduced, such as retaining the top-K recommended items with the highest similarity, to control the scale of the recommendation results and avoid too many recommended items affecting the user's selection efficiency. In addition, the target recommendation data can be sorted according to the similarity value so that users can see the most relevant recommended items first, further improving the user experience of the recommendation system.

[0092] In one possible implementation, refer to Figure 5 , Figure 5 This is the fifth flow chart of the commodity service recommendation method provided by the present invention. The method can also be applied to a service terminal, including steps 501-503: Step 501: receiving local recommendation models uploaded by multiple clients.

[0093] In the recommendation system, receiving local recommendation models uploaded by multiple clients is the starting point for the service terminal to build a global recommendation model, and is also one of the core steps to achieve distributed collaborative recommendation. By collecting local recommendation models from each client, the service terminal can integrate the behavioral characteristics of different user groups and provide extensive data support for the generation of global recommendation models, thereby improving the generalization ability and overall performance of the recommendation system.

[0094] The local recommendation model of each client is trained in the client based on its user historical interaction behavior data set, and the model parameters include personalized behavior characteristics for different user groups. Due to the need for data privacy protection, these clients will not directly upload user data, but upload the training results of the local model (usually model parameters or gradients) to the service terminal. This not only avoids the privacy leakage of user data, but also makes full use of distributed data resources to support the optimization of the global model.

[0095] In the specific implementation, after the client completes the training of the local recommendation model, it will encapsulate the key parameters of the model into an encrypted file and upload it to the service terminal using a secure communication protocol (such as TLS). During the transmission process, the service terminal confirms the integrity and authenticity of the data through an encryption verification mechanism. For example, a unique verification value (such as a hash value) can be generated for each uploaded file to ensure that the file has not been tampered with during the transmission process.

[0096] After receiving these uploaded model files, the service terminal will classify and store them according to the client's identifier. Each file usually contains model parameters and related metadata (such as the data scale and feature dimensions of the client training). This information will provide basic data support for subsequent model aggregation and optimization. In addition, to ensure the real-time and robustness of the system, the service terminal can set a receiving timeout mechanism, that is, client models that are not uploaded within the specified time will be temporarily ignored, but can be received again in the next round of updates.

[0097] The importance of this process lies in that by receiving the local recommendation models of multiple clients, the service terminal can obtain distributed and diverse data features, laying the foundation for the construction of a global recommendation model. At the same time, this design takes into account the needs of data privacy protection and system performance optimization.

[0098] Step 502: Aggregate all local recommendation models to obtain a global recommendation model. The global recommendation model is used to process the historical interaction behavior data set of users in the client to obtain an initial candidate recommendation set.

[0099] In the recommendation system, aggregating all local recommendation models to obtain a global recommendation model is the core step to achieve distributed collaborative recommendation. By aggregating local recommendation models uploaded by multiple clients, the service terminal can integrate the user behavior characteristics of different clients to generate a global recommendation model with stronger generalization ability, thereby improving the overall performance of the system and the coverage of recommendation results.

[0100] The local recommendation model is trained by each client based on its historical user interaction behavior data, and contains the behavioral characteristics of a specific user group within the client. However, the data size of a single client is limited, and the user behavior distribution may be highly heterogeneous, which makes the local recommendation model insufficient in generalization and prediction accuracy. By aggregating the local recommendation models of each client into a global recommendation model, the behavioral characteristics of multiple clients can be effectively integrated, thereby improving the model's ability to adapt to diverse user needs.

[0101] In one possible implementation, refer to Figure 6 , Figure 6 This is the sixth flow chart of the commodity service recommendation method provided by the present invention. Step 502 specifically includes steps 601-603: Step 601: Determine the first model parameter of each local recommendation model.

[0102] Step 602: sum up all first model parameters and calculate the average value to obtain second model parameters.

[0103] Step 603: Update the parameters of the initial global model according to the second model parameters to obtain a global recommendation model.

[0104] In the specific implementation, after the service terminal receives the local recommendation models uploaded by multiple clients, it first needs to parse each model file to extract its first model parameters (such as the weight or gradient of the model). The local recommendation model is usually stored in a structured format (such as JSON, Protobuf, etc.), and the parameters and metadata it contains need to be compatible with the parsing logic of the service terminal. The purpose of extracting the first model parameters is to uniformly process the key information in each client model and provide a basis for subsequent aggregation calculations.

[0105] Next, we use the federated learning aggregation algorithm for integration. The commonly used aggregation method is weighted average, where the weights are determined based on the training data size or other indicators of each client. Suppose the first model parameter uploaded by client k is , then the second model parameter of the global recommendation model is It can be calculated by the following formula: ; In specific operations, the service terminal first classifies and organizes all uploaded model parameters by client and records the metadata of each model (such as data size). Then, the model parameters of each client are aggregated using the weighted average formula mentioned above to generate the parameters of the global recommendation model. In this process, other aggregation strategies can be introduced according to scenario requirements, such as ignoring some client models with low data quality, or assigning higher weights to specific clients.

[0106] After the second model parameters are calculated, the service terminal applies them to the initial global model, updates the model weights or structural parameters, and thus obtains the final global recommendation model. The initial global model can be a pre-trained model or a randomly initialized model, and its role is to provide a basic framework for the global recommendation model. During the update process, the service terminal integrates the second model parameters into the initial global model by replacement or incremental update. After the update is completed, the global recommendation model has the ability to integrate the data features of multiple clients and can provide high-quality recommendation services on each client.

[0107] Step 503: Send the global recommendation model to each client, so that each client fills the initial candidate recommendation set and the historical interaction behavior data set into the preset prompt word template according to the initial candidate recommendation set, generates recommendation prompt words, and inputs the recommendation prompt words into the large language model to obtain the re-ranked recommendation candidate set output by the large language model, and performs similarity verification on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, screens out unmatched recommendation items in the initial candidate recommendation set, and outputs the service recommendation results.

[0108] In the specific implementation, the service terminal will encapsulate the parameters of the global recommendation model into a standardized model file and send it to each client through a secure communication protocol (such as TLS). During the distribution process, the service terminal assigns a unique identifier to each client to ensure the accuracy of the model parameter distribution. In order to prevent data from being tampered with or stolen during transmission, the model file will be processed using an encryption mechanism, and a checksum will be generated before transmission to verify the integrity of the file after the client receives it.

[0109] After receiving the global recommendation model, the client will first perform an integrity check on the model file. After the check passes, the client stores it locally and loads the global recommendation model into its recommendation system to predict the user's recommendation results. While loading the model, the client may adapt the model parameters, such as adjusting the parameter structure to match the client's hardware environment or optimizing computing efficiency. In addition, to ensure the real-time performance of the model, the service terminal will periodically update the global recommendation model and send it to each client so that the system can dynamically adapt to changes in user behavior.

[0110] Reference Figure 7 , Figure 7: is a structural diagram of the commodity service recommendation system provided by the present invention, the system is applied to the client, and includes: The upload module is used to obtain the local recommendation model and upload the local recommendation model to the service terminal; A first receiving module is used to receive a global recommendation model sent by a service terminal, where the global recommendation model is obtained by aggregating local recommendation models of various clients by the service terminal; The first processing module is used to process the historical interaction behavior data set of users in the client based on the global recommendation model to obtain an initial candidate recommendation set; The first processing module is further used to fill the initial candidate recommendation set and the historical interaction behavior data set into the preset prompt word template to generate the recommendation prompt word; The first processing module is further used to input the recommendation prompt words into the large language model to obtain a re-ranked recommendation candidate set output by the large language model; The first processing module is also used to perform similarity verification on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, filter out unmatched recommendation items in the initial candidate recommendation set, and output service recommendation results.

[0111] In a possible implementation, the system further includes a model training module, which is used to: Obtain the historical interaction behavior dataset of all users in the client; Using at least one interactive behavior data in at least one historical interactive behavior data set as a training sample, and using the next interactive behavior data of the interactive behavior data as a training label; Input the training samples into the model to be trained to obtain the predicted interactive behavior data output by the model to be trained; Construct a loss function based on all training labels and all predicted interaction behavior data; Taking the value of minimizing the loss function as the training goal, the model to be trained is trained to obtain a local recommendation model.

[0112] In a possible implementation manner, the first processing module is further configured to: Inputting each user's initial candidate recommendation set and re-ranked recommendation candidate set into the text embedding model respectively to obtain a first embedding data set and a second embedding data set for each user; Select any first embedding vector from the first embedding data set, determine a second embedding vector corresponding to the first embedding vector in the second embedding data set, and calculate the cosine similarity between each first embedding vector and the corresponding second embedding vector; According to all cosine similarities, the target recommendation data is filtered out from each initial candidate recommendation set to obtain the recommendation results for each user.

[0113] In a possible implementation manner, the first processing module is further configured to: Determine at least one target embedding vector from all the first embedding vectors, wherein the cosine similarity corresponding to the target embedding vector is greater than a preset threshold; The target recommendation data corresponding to the target embedding vector is filtered out from the initial candidate recommendation set to obtain the recommendation result.

[0114] In a possible implementation manner, the system is also applied to a service terminal, including: A second receiving module is used to receive local recommendation models uploaded by multiple clients; The second processing module is used to aggregate all local recommendation models to obtain a global recommendation model, and the global recommendation model is used to process the historical interaction behavior data set of users in the client to obtain an initial candidate recommendation set; The sending module is used to send the global recommendation model to each client, so that each client fills the initial candidate recommendation set and the historical interaction behavior data set into the preset prompt word template according to the initial candidate recommendation set, generates recommendation prompt words, and inputs the recommendation prompt words into the large language model to obtain the re-ranked recommendation candidate set output by the large language model, and performs similarity verification on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, screens out the unmatched recommendation items in the initial candidate recommendation set, and outputs the service recommendation results.

[0115] In a possible implementation manner, the second processing module is further configured to: Determining first model parameters of each local recommendation model; The second model parameters are obtained by summing up all the first model parameters and calculating the average value; The parameters of the initial global model are updated according to the second model parameters to obtain a global recommendation model.

[0116] It should be noted that the commodity and service recommendation system provided by the present invention can execute the commodity and service recommendation method of any of the above-mentioned embodiments during specific operation, which will not be described in detail in this embodiment.

[0117] Figure 8 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 8As shown, the electronic device may include: a processor 810 (processor), a communication interface 820 (CommunicationsInterface), a memory 830 (memory) and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the commodity service recommendation method, which includes: obtaining a local recommendation model and uploading the local recommendation model to the service terminal; receiving a global recommendation model issued by the service terminal, the global recommendation model is obtained by the service terminal aggregating the local recommendation models of each client; processing the historical interaction behavior data set of the user in the client based on the global recommendation model to obtain an initial candidate recommendation set; filling the initial candidate recommendation set and the historical interaction behavior data set into a preset prompt word template to generate a recommendation prompt word; inputting the recommendation prompt word into the large language model to obtain a re-ranked recommendation candidate set output by the large language model; performing similarity verification on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, filtering out the unmatched recommendation items in the initial candidate recommendation set, and outputting the service recommendation result.

[0118] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0119] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the commodity service recommendation method provided by the above-mentioned embodiments, and the method includes: obtaining a local recommendation model and uploading the local recommendation model to a service terminal; receiving a global recommendation model issued by the service terminal, the global recommendation model is obtained after the service terminal aggregates the local recommendation models of each client; based on the global recommendation model, processing the historical interaction behavior data set of users in the client to obtain an initial candidate recommendation set; filling the initial candidate recommendation set and the historical interaction behavior data set into a preset prompt word template to generate recommendation prompt words; inputting the recommendation prompt words into a large language model to obtain a re-ordered recommendation candidate set output by the large language model; performing similarity verification on the initial candidate recommendation set and the re-ordered recommendation candidate set of each user, filtering out unmatched recommendation items in the initial candidate recommendation set, and outputting service recommendation results.

[0120] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when executed by a processor to execute the commodity service recommendation method provided by the above-mentioned embodiments, the method comprising: obtaining a local recommendation model and uploading the local recommendation model to a service terminal; receiving a global recommendation model issued by the service terminal, the global recommendation model being obtained after the service terminal aggregates the local recommendation models of each client; processing the historical interaction behavior data set of users in the client based on the global recommendation model to obtain an initial candidate recommendation set; filling the initial candidate recommendation set and the historical interaction behavior data set into a preset prompt word template to generate a recommendation prompt word; inputting the recommendation prompt word into a large language model to obtain a re-ranked recommendation candidate set output by the large language model; performing a similarity check on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, filtering out unmatched recommendation items in the initial candidate recommendation set, and outputting a service recommendation result.

[0121] The system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0122] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for recommending goods and services, characterized in that: Applied to the client, including: Obtaining a local recommendation model, and uploading the local recommendation model to a service terminal; Receiving a global recommendation model sent by the service terminal, where the global recommendation model is obtained by aggregating local recommendation models of various clients by the service terminal; Processing the historical interaction behavior dataset of users in the client based on the global recommendation model to obtain an initial candidate recommendation set; Filling the initial candidate recommendation set and the historical interaction behavior data set into a preset prompt word template to generate a recommendation prompt word; Inputting the recommendation prompt words into a large language model to obtain a re-ranked recommendation candidate set output by the large language model; A similarity check is performed on each user's initial candidate recommendation set and the re-ranked recommendation candidate set, unmatched recommendation items in the initial candidate recommendation set are screened out, and a service recommendation result is output.

2. The commodity service recommendation method according to claim 1, characterized in that: The local recommendation model is obtained by training the client, and the training method of the local recommendation model specifically includes: Obtain the historical interaction behavior dataset of all users in the client; Using at least one interactive behavior data in at least one of the historical interactive behavior data sets as a training sample, and using the next interactive behavior data of the interactive behavior data as a training label; Inputting the training sample into the model to be trained to obtain the predicted interaction behavior data output by the model to be trained; Constructing a loss function based on all of the training labels and all of the predicted interaction behavior data; Taking the value of minimizing the loss function as a training goal, the model to be trained is trained to obtain the local recommendation model.

3. The commodity service recommendation method according to claim 1, characterized in that: The similarity check is performed on the initial candidate recommendation set and the re-ranked candidate recommendation set of each user, unmatched recommendation items in the initial candidate recommendation set are filtered out, and the service recommendation result is output, specifically including: Inputting each user's initial candidate recommendation set and re-ranked recommendation candidate set into the text embedding model respectively to obtain a first embedding data set and a second embedding data set for each user; Select any first embedding vector from the first embedding data set, determine a second embedding vector corresponding to the first embedding vector in the second embedding data set, and calculate the cosine similarity between each first embedding vector and the corresponding second embedding vector; Target recommendation data is screened out from each of the initial candidate recommendation sets according to all of the cosine similarities to obtain a recommendation result for each user.

4. The commodity service recommendation method according to claim 3, characterized in that: The step of selecting target recommendation data from each of the initial candidate recommendation sets according to all the cosine similarities to obtain a recommendation result for each user specifically includes: Determine at least one target embedding vector from all the first embedding vectors, wherein the cosine similarity corresponding to the target embedding vector is greater than a preset threshold; Target recommendation data corresponding to the target embedding vector is screened out from the initial candidate recommendation set to obtain the recommendation result.

5. A method for recommending goods and services, characterized in that: Applied to service terminals, including: Receiving local recommendation models uploaded by multiple clients; Aggregating all the local recommendation models to obtain a global recommendation model, wherein the global recommendation model is used to process the historical interaction behavior dataset of users in the client to obtain an initial candidate recommendation set; The global recommendation model is sent to each of the clients, so that each of the clients fills the initial candidate recommendation set and the historical interaction behavior data set into a preset prompt word template according to the initial candidate recommendation set, generates recommendation prompt words, and inputs the recommendation prompt words into the large language model to obtain the re-ranked recommendation candidate set output by the large language model, and performs a similarity check on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, screens out unmatched recommendation items in the initial candidate recommendation set, and outputs a service recommendation result.

6. The commodity service recommendation method according to claim 5, characterized in that: Aggregating all the local recommendation models to obtain a global recommendation model specifically includes: Determining a first model parameter of each of the local recommendation models; Summing all the first model parameters and calculating the average value to obtain the second model parameter; The parameters of the initial global model are updated according to the second model parameters to obtain the global recommendation model.

7. A product service recommendation system, characterized in that: Applied to the client, including: An uploading module, used to obtain a local recommendation model and upload the local recommendation model to a service terminal; A first receiving module is used to receive a global recommendation model sent by the service terminal, where the global recommendation model is obtained by aggregating local recommendation models of various clients by the service terminal; A first processing module, configured to process a historical interaction behavior dataset of users in the client based on the global recommendation model to obtain an initial candidate recommendation set; The first processing module is further used to fill the initial candidate recommendation set and the historical interaction behavior data set into a preset prompt word template to generate a recommendation prompt word; The first processing module is further used to input the recommendation prompt word into the large language model to obtain a re-ranked recommendation candidate set output by the large language model; The first processing module is further used to perform similarity verification on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, filter out unmatched recommendation items in the initial candidate recommendation set, and output service recommendation results.

8. A product service recommendation system, characterized in that: Applied to service terminals, including: A second receiving module is used to receive local recommendation models uploaded by multiple clients; A second processing module is used to aggregate all the local recommendation models to obtain a global recommendation model, and the global recommendation model is used to process the historical interaction behavior data set of users in the client to obtain an initial candidate recommendation set; A sending module is used to send the global recommendation model to each of the clients, so that each of the clients fills the initial candidate recommendation set and the historical interaction behavior data set into a preset prompt word template according to the initial candidate recommendation set, generates recommendation prompt words, and inputs the recommendation prompt words into the large language model to obtain the re-ranked recommendation candidate set output by the large language model, and performs similarity verification on the initial candidate recommendation set and the re-ranked recommendation candidate set of each user, screens out unmatched recommendation items in the initial candidate recommendation set, and outputs service recommendation results.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method for recommending goods and services as described in any one of claims 1 to 4 is implemented, or the method for recommending goods and services as described in any one of claims 5 to 6 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for recommending goods and services as described in any one of claims 1 to 4 is implemented, or the method for recommending goods and services as described in any one of claims 5 to 6 is implemented.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for recommending goods and services as described in any one of claims 1 to 4 is implemented, or the method for recommending goods and services as described in any one of claims 5 to 6 is implemented.

Citation Information

Patent Citations

  • Federal recommendation method and device for improving privacy and robustness, equipment and storage medium

    CN115455471A

  • Target recommendation method and device

    CN116703454A

  • Sequencing method and device for search recommendation words and electronic equipment

    CN117874354A

  • Ai-based recommendation method and apparatus, electronic device, and storage medium

    US20220215032A1

Cited By

  • Business travel recommendation method and system based on collaborative filtering and recurrent neural network

    CN120086445A

  • A Business Trip Recommendation Method and System Based on Collaborative Filtering and Recurrent Neural Network

    CN120086445B

  • Credit service recommendation system, method, device, storage medium and program product

    CN121051307A

  • A drill bit recommendation method, device and equipment

    CN122654381A