A data recommendation method, related device and data recommendation system

Through federated learning and krum aggregation rules, a global recommendation model is constructed, which solves the problem of single dimensionality of user characteristic data and data security, improves the accuracy and robustness of product recommendation, and ensures the security of user privacy.

CN113761350BActive Publication Date: 2024-09-20BEIJING JINGDONG ZHENSHI INFORMATION TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202110252347.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-08
Publication Date
2024-09-20
Estimated Expiration
2041-03-08

AI Technical Summary

Technical Problem

User-related feature data has a single dimension, resulting in low accuracy of product recommendations, and is vulnerable to malicious attacks during the federated learning process, affecting data security.

Method used

Using the federated learning method, the client locally trains a local recommendation model and shares data to build a global recommendation model, combined with krum aggregation rules and weighted average technology to ensure data security and model robustness.

Benefits of technology

It improves the accuracy of product recommendation, ensures the security of user privacy data and the robustness of the learning process, and realizes a personalized recommendation service that benefits many parties.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113761350B
    Figure CN113761350B
Patent Text Reader

Abstract

The present invention discloses a data recommendation method, related devices and systems, and relates to the field of computer technology. A specific implementation of the method includes: the first client uses a local user behavior data set to train a local first local recommendation model, and sends the trained first sharable data to a server; the first client downloads global shared data from the server, and the global shared data is calculated by the server based on the first sharable data and the second sharable data set; the first client uses the global shared data to update the first local recommendation model to train the global recommendation model, and after the global recommendation model training is completed, the global recommendation model is used to recommend object data to the user. This implementation can solve the problem of the single dimension of the user's relevant feature data, improve the accuracy of the recommendation, and ensure the security of privacy data when subjected to malicious attacks during the learning process, thereby improving the robustness of learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data recommendation method, related devices and a data recommendation system. Background Art

[0002] According to business needs, websites, apps (applications) or mini-programs, the homepage will recommend relevant object data to users based on the user's relevant characteristics, such as product data. At present, the scheme for e-commerce organizations to recommend product data to users is mainly based on the user's relevant characteristic data. For example, based on the user's browsing history, purchase history, collection history, attention history and other relevant data within the e-commerce, product data is recommended to users through algorithms.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] The user's relevant feature data has a single dimension and the recommendation accuracy is low. Summary of the invention

[0005] In view of this, the embodiments of the present invention provide a data recommendation method, related devices and data recommendation system, which can solve the problem of the single dimension of the user's relevant feature data, improve the accuracy of the recommendation, and ensure the security of privacy data when subjected to malicious attacks during the learning process, thereby improving the robustness of learning.

[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a data recommendation method is provided.

[0007] A data recommendation method includes: a first client uses a local user behavior data set to train a local first local recommendation model, and sends the trained first sharable data to a server; the first client downloads global shared data from the server, the global shared data is calculated by the server based on the first sharable data and a second sharable data set, and the second sharable data set includes one or more second sharable data sent to the server by the second client; the first client uses the global shared data to update the first local recommendation model to train a global recommendation model, and after the global recommendation model is trained, the global recommendation model is used to recommend object data matching the corresponding user behavior data to users.

[0008] Optionally, the global shared data includes parameters of the global recommendation model and the loss function gradient of the global recommendation model; the first client uses the global shared data to update the first local recommendation model, including: the first client updates the parameters of the first local recommendation model and the loss function gradient of the first local recommendation model according to the parameters of the global recommendation model and the loss function gradient of the global recommendation model, and the first sharable data includes the parameters and loss function gradient of the first local recommendation model.

[0009] Optionally, the first client updates the parameters of the first local recommendation model in the following manner: the first client calculates the product of the learning rate of the first local recommendation model and the gradient of the loss function of the global recommendation model, and calculates the difference between the current parameters of the first local recommendation model and the product, to obtain the updated parameters of the first local recommendation model.

[0010] Optionally, the local user behavior data set of the first client is a collection of one of the following data: user consumption behavior data, user social behavior data, and user operation behavior data on an object.

[0011] According to another aspect of an embodiment of the present invention, a data recommendation method is provided.

[0012] A data recommendation method comprises: a server receives sharable data sent by clients in a client set, wherein the sharable data is obtained by the clients training their respective local recommendation models using their respective user behavior data sets; the server calculates global shared data based on each of the sharable data, wherein the global shared data is used by the clients to update their respective local recommendation models so as to train a global recommendation model, and the global recommendation model is used by the clients to recommend object data matching the corresponding user behavior data to their respective users.

[0013] Optionally, the sharable data sent by the client includes parameters of the local recommendation model of the client, and the global shared data includes parameters of the global recommendation model; the server calculates the global shared data based on each of the sharable data, including: randomly selecting the local recommendation models of some or all of the clients in the client set as target local recommendation models, and sorting the parameters of each of the target local recommendation models according to a first sorting rule; based on the sorted parameters of each of the target local recommendation models, removing the maximum parameters of the first number and the minimum parameters of the second number, and calculating the average of the remaining parameters to determine the parameters of the global recommendation model.

[0014] Optionally, the sharable data sent by the client includes parameters of the local recommendation model of the client, and the global shared data includes parameters of the global recommendation model; the server calculates the global shared data based on the sharable data, including: randomly selecting the local recommendation models of some or all clients in the client set as target local recommendation models, and sorting the parameters of each target local recommendation model according to a second sorting rule; calculating the median of the parameters of each of the sorted target local recommendation models, and if the total number of parameters of each of the target local recommendation models is an even number, calculating the average of the two middle parameters in the sorted parameters to determine the parameters of the global recommendation model.

[0015] Optionally, the global shared data also includes a loss function gradient of the global recommendation model. The global loss function is obtained by weighted averaging the loss functions of the target local recommendation models, and the loss function gradient of the global recommendation model is calculated based on the global loss function.

[0016] Optionally, according to a set percentage, local recommendation models of some or all clients in the client set are randomly selected as the target local recommendation model.

[0017] According to yet another aspect of an embodiment of the present invention, a first client for data recommendation is provided.

[0018] A first client for data recommendation, comprising: a first local recommendation model training module, used to train a local first local recommendation model using a local user behavior data set, and send the trained first sharable data to a server; a global shared data download module, used to download global shared data from the server, the global shared data is calculated by the server based on the first sharable data and a second sharable data set, the second sharable data set includes one or more second sharable data sent to the server by a second client; a first local recommendation model updating module, used to update the first local recommendation model using the global shared data to train a global recommendation model, and after the global recommendation model is trained, use the global recommendation model to recommend object data matching the corresponding user behavior data to users.

[0019] Optionally, the global shared data includes parameters of the global recommendation model and the loss function gradient of the global recommendation model; the first local recommendation model update module is also used to: update the parameters of the first local recommendation model and the loss function gradient of the first local recommendation model according to the parameters of the global recommendation model and the loss function gradient of the global recommendation model, and the first shareable data includes the parameters and loss function gradient of the first local recommendation model.

[0020] Optionally, the first local recommendation model update module updates the parameters of the first local recommendation model in the following manner: calculating the product of the learning rate of the first local recommendation model and the gradient of the loss function of the global recommendation model, and calculating the difference between the current parameters of the first local recommendation model and the product, to obtain the updated parameters of the first local recommendation model.

[0021] Optionally, the local user behavior data set of the first client is a collection of one of the following data: user consumption behavior data, user social behavior data, and user operation behavior data on an object.

[0022] According to yet another aspect of an embodiment of the present invention, a server for data recommendation is provided.

[0023] A server for data recommendation, comprising: a sharable data receiving module, used to receive sharable data sent by clients in a client set, wherein the sharable data is obtained by the clients training their respective local recommendation models using their respective user behavior data sets; a global shared data calculation module, used to calculate global shared data based on the sharable data, wherein the global shared data is used by the clients to update their respective local recommendation models to train a global recommendation model, and the global recommendation model is used by the clients to recommend object data matching the corresponding user behavior data to their respective users.

[0024] Optionally, the sharable data sent by the client includes parameters of the local recommendation model of the client, and the global shared data includes parameters of the global recommendation model; the global shared data calculation module is also used to: randomly select the local recommendation models of some or all clients in the client set as target local recommendation models, and sort the parameters of each target local recommendation model according to a first sorting rule; according to the sorted parameters of each target local recommendation model, remove the maximum parameters of the first number and the minimum parameters of the second number, and calculate the average value of the remaining parameters to determine the parameters of the global recommendation model.

[0025] Optionally, the sharable data sent by the client includes parameters of the local recommendation model of the client, and the global shared data includes parameters of the global recommendation model; the global shared data calculation module is also used to: randomly select the local recommendation models of some or all clients in the client set as target local recommendation models, and sort the parameters of each target local recommendation model according to a second sorting rule; calculate the median of the parameters of each of the sorted target local recommendation models, and if the total number of parameters of each of the target local recommendation models is an even number, calculate the average of the two middle parameters in the sorted parameters to determine the parameters of the global recommendation model.

[0026] Optionally, the global shared data also includes a loss function gradient of the global recommendation model. The global loss function is obtained by weighted averaging the loss functions of the target local recommendation models, and the loss function gradient of the global recommendation model is calculated based on the global loss function.

[0027] Optionally, according to a set percentage, local recommendation models of some or all clients in the client set are randomly selected as the target local recommendation model.

[0028] According to yet another aspect of an embodiment of the present invention, a data recommendation system is provided.

[0029] A data recommendation system includes: a plurality of clients and a server for data recommendation provided by an embodiment of the present invention, wherein the plurality of clients include a first client for data recommendation provided by an embodiment of the present invention.

[0030] According to yet another aspect of the embodiments of the present invention, an electronic device is provided.

[0031] An electronic device includes: one or more processors; a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the data recommendation method provided by an embodiment of the present invention.

[0032] According to yet another aspect of an embodiment of the present invention, a computer readable medium is provided.

[0033] A computer readable medium stores a computer program, which, when executed by a processor, implements a data recommendation method provided in an embodiment of the present invention.

[0034] One embodiment of the above invention has the following advantages or beneficial effects: the first client trains the local first local recommendation model using the local user behavior data set, and sends the first sharable data obtained by the training to the server; the first client downloads the global shared data from the server, the global shared data is calculated by the server based on the first sharable data and the second sharable data set, and the second sharable data set includes one or more second sharable data sent to the server by the second client; the first client updates the first local recommendation model using the global shared data to train the global recommendation model, and after the global recommendation model training is completed, the global recommendation model is used to recommend object data matching the corresponding user behavior data to the user. It can solve the problem of the single dimension of the user's relevant feature data, improve the accuracy of the recommendation, and ensure the security of the privacy data when it is attacked maliciously during the learning process, thereby improving the robustness of the learning.

[0035] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0037] Figure 1 is a schematic diagram of the main flow of a data recommendation method according to an embodiment of the present invention;

[0038] Figure 2 is a schematic diagram of the main flow of a data recommendation method according to another embodiment of the present invention;

[0039] Figure 3 is a schematic diagram of a process of federated learning according to an embodiment of the present invention;

[0040] Figure 4 is a schematic diagram of main modules of a first client for data recommendation according to an embodiment of the present invention;

[0041] Figure 5 is a schematic diagram of main modules of a server for data recommendation according to an embodiment of the present invention;

[0042] Figure 6 is a schematic diagram of the main components of a data recommendation system according to an embodiment of the present invention;

[0043] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0044] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0046] Figure 1 It is a main flow chart of a data recommendation method according to an embodiment of the present invention.

[0047] like Figure 1As shown, a data recommendation method according to an embodiment of the present invention mainly includes the following steps S101 to S103. The data recommendation method according to this embodiment may be executed by a first client for data recommendation.

[0048] Step S101: The first client trains a local first local recommendation model using a local user behavior data set, and sends the trained first sharable data to the server.

[0049] The local user behavior data set of the first client may be a collection of one of the following data: user consumption behavior data, user social behavior data, and user operation behavior data on an object.

[0050] The object may be a product or a copy, etc.

[0051] User consumption behavior data may be consumption flow data of users in banking institutions; user social behavior data may be social behavior data of users in social institutions, such as chat records and browsing records in users' social software; user operation behavior data on objects may be browsing, following, and purchasing behavior data of users in e-commerce institutions.

[0052] Accordingly, the first client may specifically be a client of an institution such as a banking platform, a social platform, or an e-commerce platform.

[0053] The first sharable data may include parameters and loss function gradients of a first local recommendation model, that is, a local recommendation model of the first client.

[0054] Step S102: the first client downloads global shared data from the server. The global shared data is calculated by the server based on the first sharable data and the second sharable data set. The second sharable data set includes the second sharable data sent to the server by one or more second clients.

[0055] The second client is also a client for data recommendation, with the same function as the first client, and at least one second client is a client of a different type from the first client. Taking three clients as an example, the first client is a client of a banking platform, and the two second clients may be clients of a social platform and an e-commerce platform, respectively.

[0056] The global shared data includes the parameters of the global recommendation model and the loss function gradient of the global recommendation model.

[0057] The global recommendation model refers to a unified recommendation model jointly trained by various clients (first client, second client).

[0058] Step S103: The first client updates the first local recommendation model using the global shared data to train the global recommendation model. After the global recommendation model training is completed, the global recommendation model is used to recommend object data matching the corresponding user behavior data to the user.

[0059] The first client updates the first local recommendation model using the global shared data, which may include: the first client updates the parameters of the first local recommendation model and the loss function gradient of the first local recommendation model according to the parameters of the global recommendation model and the loss function gradient of the global recommendation model.

[0060] The first client can update the parameters of the first local recommendation model in the following manner: the first client calculates the product of the learning rate of the first local recommendation model and the gradient of the loss function of the global recommendation model, and calculates the difference between the current parameters of the first local recommendation model and the product, to obtain the updated parameters of the first local recommendation model.

[0061] The first client may update the loss function gradient of the first local recommendation model in the following manner: the first client calculates the updated loss function gradient of the first local recommendation model according to the parameters of the global recommendation model and the updated parameters of the local first local recommendation model.

[0062] Figure 2 It is a main flow chart of a data recommendation method according to another embodiment of the present invention.

[0063] like Figure 2 As shown, a data recommendation method according to an embodiment of the present invention mainly includes the following steps S201 to S202. The data recommendation method according to this embodiment may be executed by a server for data recommendation.

[0064] Step S201: the server receives sharable data sent by clients in a client set, where the sharable data is obtained by the clients training their respective local recommendation models using their respective user behavior data sets.

[0065] The shareable data sent by the client may include parameters of the client's local recommendation model.

[0066] Step S202: The server calculates global shared data based on various sharable data. The global shared data is used by the clients to update their respective local recommendation models to train the global recommendation model. The global recommendation model is used by the clients to recommend object data that matches the corresponding user behavior data to their respective users.

[0067] The global shared data may include parameters of the global recommendation model.

[0068] The global shared data may also include the loss function gradient of the global recommendation model. The global loss function is obtained by weighted averaging the loss functions of the target local recommendation models, and the loss function gradient of the global recommendation model is calculated based on the global loss function.

[0069] The server calculates global shared data based on various sharable data, which may include: randomly selecting local recommendation models of some or all clients in the client set as target local recommendation models, and uniformly sorting the parameters of each target local recommendation model according to a first sorting rule; based on the parameters of each sorted target local recommendation model, removing the maximum parameters of the first number and the minimum parameters of the second number, and calculating the average of the remaining parameters to determine the parameters of the global recommendation model.

[0070] The server calculates the global shared data based on the sharable data, which may include: randomly selecting the local recommendation models of some or all clients in the client set as the target local recommendation models, and uniformly sorting the parameters of each target local recommendation model according to the second sorting rule; calculating the median of the parameters of each target local recommendation model after sorting, and if the total number of parameters of each target local recommendation model is an even number, calculating the average of the two middle parameters in the sorted parameters, and determining the parameters of the global recommendation model based on the calculated median or the average.

[0071] The local recommendation models of some or all clients in the client set may be randomly selected as the target local recommendation model according to a set percentage.

[0072] The following takes the intelligent retail commodity recommendation sharing model based on Krum aggregation rule and federated learning as an example to introduce the data recommendation method of the embodiment of the present invention in detail. Krum is an SGD (stochastic steepest descent) method with Byzantine fault tolerance.

[0073] In view of the shortcomings of the current algorithm and single data source for commodity recommendation, as well as the stability problem of existing federated learning, the embodiment of the present invention proposes a smart retail commodity recommendation sharing model based on Krum aggregation rules and federated learning. Among them, federated learning is a machine learning framework that can ensure that multiple institutions use data and model machine learning under the requirements of user privacy protection, data security and compliance with regulations. The data source (i.e., user behavior data set) for commodity recommendation cannot be limited to the e-commerce's own data (i.e., user operation behavior data on objects). The data involved in commodity recommendation should be user purchasing power, user personal preferences, and commodity characteristics. The three aspects, and user purchasing power can be obtained from the bank's cash flow (i.e., user consumption behavior data), user personal preferences can be obtained from chat records and browsing records (i.e., user social behavior data) in social software, and commodity characteristics can be obtained from commodity information in e-commerce. Then, the data of these three parties are integrated for deep learning to obtain the final commodity recommendation model (i.e., global recommendation model), but the user behavior data set comes from different institutions, and the data involved are all private data of each institution, which cannot be exposed to the outside, and the data of each institution is usually heterogeneous, and traditional machine learning models cannot be directly learned on heterogeneous data. At present, traditional machine learning methods cannot effectively solve the above problems. Therefore, an embodiment of the present invention proposes a smart retail product recommendation sharing model based on Krum aggregation rules and federated learning. Through federated learning, the clients of various institutions jointly build machine learning models without exporting the data of each institution, which fully protects user privacy and data security, provides users with personalized product recommendation services, achieves common benefits for multiple parties, and solves the problem of heterogeneity of users and user feature data. In view of the problem that federated learning is vulnerable to malicious attacks by participants, the embodiment of the present invention adopts Krum aggregation rules to ensure data security in federated learning.

[0074] Figure 3 4 is a flowchart of federated learning according to an embodiment of the present invention.

[0075] The process of federated learning is as follows Figure 3 As shown, the banking institution is set as enterprise A, the social software institution is set as enterprise B, and the e-commerce institution is set as enterprise C. Each institution builds a product recommendation model (i.e., a global recommendation model) based on the basic information of users and the basic information of products (i.e., user behavior data sets). The data between the institutions are not transmitted to each other and the clients of each institution are in an equal position.

[0076] In federated learning, encrypted sample alignment is performed on the user behavior dataset. Since the user groups of each institution do not completely overlap, collaborator D (i.e., the server) uses encrypted user sample alignment technology to confirm the common users of all parties on the premise that enterprise A, enterprise B, and enterprise C (specifically, the clients of each enterprise) do not disclose their respective data, and at the same time do not expose non-overlapping users, so as to train the model through the information of public users.

[0077] After aligning the encrypted samples of the user behavior dataset, the encrypted model training is performed. In order to ensure the confidentiality of the data during the training process, it is necessary to use collaborator D for encrypted training. The training process can be as follows: (1) Collaborator D distributes the public key to enterprise A, enterprise B and enterprise C (specifically, to the client of each enterprise) to encrypt the data that needs to be exchanged during the training process (such as shareable data, etc.); (2) Enterprise A, enterprise B and enterprise C exchange the intermediate results (such as shareable data, etc.) used to calculate the gradient in encrypted form; (3) Enterprise A, enterprise B and enterprise C perform calculations based on the encrypted gradient values ​​respectively, and summarize the results to collaborator D. Collaborator D calculates the total gradient value (i.e., the gradient of the loss function of the global recommendation model) based on the summary results and decrypts it; (4) Collaborator D sends the decrypted gradient (i.e., the gradient of the loss function of the global recommendation model) back to enterprise A, enterprise B and enterprise C respectively, and enterprise A, enterprise B and enterprise C update the parameters of their respective models (i.e., the local recommendation model) according to the gradient.

[0078] Among them, the number of banking institutions, the number of social software institutions, and the number of e-commerce institutions can all be one or more.

[0079] The technical solution of the embodiment of the present invention is mainly divided into two parts: local model training and joint model training.

[0080] In local model training, banking institutions, social software institutions and e-commerce institutions build and train their own local recommendation models based on convolutional neural networks according to their local user behavior data sets. The local recommendation models can be used to judge the user's consumption level and suitable product types. Among them, convolutional neural networks have the characteristics of local connection and weight sharing, which enables the local recommendation model to identify tiny local features, which is conducive to extracting complete feature information of user feature data and better realizing classification tasks. At the same time, the structure of convolutional neural networks is highly compatible with the federated learning framework, which can improve the uniformity of the model.

[0081] In the joint model training, the institutional clients participating in the federated learning collaborate to train and obtain the joint product recommendation model, that is, the global recommendation model. The number of institutional clients such as banks, social software and e-commerce participating in the federated learning is set to C, and each institutional client has its own local private data (that is, the local user behavior data set)

[0082] in, is the eigenvector, is the corresponding label. The size of the dataset of the cth institutional client participating in federated learning is n c Throughout the federated learning, the goal is for each institution to establish a product recommendation model through a shared data set. At the same time, the user behavior data of each institution is retained locally on the client side of each institution to ensure the security of the privacy data of each institution's users.

[0083] Before participating in the training of the product recommendation model, each institutional client calculates the loss function gradient of its local recommendation model through its local user behavior data set and the parameters of the local recommendation model. The learning objectives for the non-convex neural network model are:

[0084]

[0085] Among them, this formula represents minimizing the loss function defined by the parameter vector w of the existing data samples (x, y). The loss function of the entire system can be defined as the average value of the loss function l of n data samples.

[0086] In the joint product recommendation model, C institutional clients have their own local private datasets |D i |=n c , where n represents the size of all data involved in building the entire joint product recommendation model, so there is Therefore, the loss function of the entire system can be further explained as: C institutional clients use local datasets D i The aggregation of each local recommendation model obtained through training, so the objective equation is expressed as:

[0087]

[0088]

[0089] The server first initializes the parameters of the product recommendation model (i.e., the parameters of the global recommendation model). In each round of iteration (the iteration time or number of iterations is denoted as t=1, 2, 3...), a certain percentage F of institutional clients are randomly selected from all institutional clients participating in the joint training as target institutional clients to communicate directly with the server. The parameters of the global recommendation model are determined by the parameters of the local recommendation models of each target institutional client (i.e., each target local recommendation model), and the loss function gradient of the global recommendation model is calculated based on the global loss function.

[0090] The server can randomly select the local recommendation models of some or all clients in the client set as the target local recommendation model through the krum aggregation rule. The krum aggregation rule is to select a model similar to other models from multiple local models as the global model. Even if the selected local model comes from a damaged working node device, since the local model from the damaged working node device is similar to the local models of other possible normal working node devices, the impact that the local model from the damaged working node device can produce will be limited.

[0091] The krum aggregation rule can include two methods: trimmed mean and median. The trimmed mean aggregation rule is to sort the parameters of each target local recommendation model according to the first sorting rule; according to the parameters of each target local recommendation model after sorting, remove the first number of maximum parameters and the second number of minimum parameters, and calculate the average value of the remaining parameters to determine the parameters of the global recommendation model. Specifically, according to the first sorting rule, for each parameter of the local recommendation model, taking the jth parameter as an example, the server sorts the jth parameters of the m local recommendation models, deletes the largest and smallest β parameters, and calculates the average value of the remaining m-2β parameters as the jth parameter of the global recommendation model, where β is the enhancement coefficient, which is generally greater than 2 and ensures that the number obtained by m-2β is close to the number of participants (i.e., clients) participating in establishing the model. The median clustering rule is to sort the parameters of each target local recommendation model according to the second sorting rule. The second sorting rule is the same as the first sorting rule and will not be repeated here. The median of the parameters of each target local recommendation model after sorting is calculated. If the total number of parameters of each target local recommendation model is an even number, the average of the two parameters in the middle of the sorted parameters is calculated, and the parameters of the global recommendation model are determined according to the median or the average of the two parameters in the middle. Specifically, for the jth model parameter, the server will sort the jth parameters of the m local recommendation models and use the median as the jth parameter of the global recommendation model. When m is an even number, the median is the average of the two parameters in the middle. Like the trimmed mean clustering rule, when the objective function is strongly convex, the median clustering rule can also achieve the best-order error rate.

[0092] Each client participating in federated learning downloads the parameters of the global recommendation model and the global loss function of the global recommendation model (i.e., globally shared data) from the server. Each client updates the parameters of its own local recommendation model with a fixed learning rate η, the parameters of the global recommendation model, and the global loss function of the global recommendation model. Each client calculates the product of the learning rate of its own local recommendation model and the gradient of the loss function of the global recommendation model, and calculates the difference between the current parameters of its own local recommendation model and the product to obtain the updated parameters of each local recommendation model. Each client updates the parameters of its own local recommendation model based on the updated parameters of the local recommendation model and the product recommendation model parameters w t Update the gradient f of the average loss on each private dataset c ,

[0093] f c =▽L c (x c ,y c ;w t ), and sends the sharable data including the parameters of the updated local recommendation model to the server to update the global recommendation model. The local recommendation model may be a non-convex neural network model.

[0094] Specifically, the model parameter vector at time t+1 is iterated from the model parameter vector at time t. The specific iteration method is: the model parameter w at time t+1 t+1 (i.e. the updated parameters of the local recommendation model) is equal to the model parameter w at time t t (i.e. the current parameters of the local recommendation model) minus the fixed learning rate η (i.e. the learning rate of the local recommendation model) multiplied by the gradient of the loss function (specifically the gradient of the loss function of the global recommendation model) ▽l(x,y;w), we have:

[0095] w t+1 ←w t -η▽l(x,y;w)

[0096] To further refine the representation of the loss function gradient, the loss function gradient can be the aggregation of the local loss functions of the C institutional clients participating in federated learning (i.e., the loss functions of the local recommendation models), which are:

[0097]

[0098]

[0099] Among them, f c is the model parameter W of the cth institutional client at the current time t t Next, we calculate the gradient of the average loss on our private dataset.

[0100] For each institutional client c, Then we have:

[0101]

[0102] In one embodiment, each institutional client takes appropriate gradient update measures and evaluates the product recommendation model using their own local private customer information data. The server forms a shared product recommendation model by weighted averaging the parameters of the local product recommendation model on the server, and transmits the updated model parameters back to all institutional clients participating in the next round of federated learning. The whole process will continue for T iterations. The algorithm process is as follows:

[0103] Input: private user data of banks, social software vendors, and e-commerce companies, that is, local user behavior datasets of each client;

[0104] The output is: a product recommendation model system based on federated learning, that is, a global recommendation model;

[0105] ServerUpdate: \\Initialize the product recommendation model parameter w0, which is the initialization parameter of the global recommendation model;

[0106] For each round t=1,2,...T execute:

[0107] Randomly select max(F*C,1) institutional clients from all institutional clients participating in federated learning, denoted as set N t .

[0108] For each institutional client c∈N t (|N t |=K) Parallel execution:

[0109]

[0110]

[0111] BankUpdate(c,w): \\Execute on the Cth institution

[0112] Data preprocessing: Use SMOTE (Synthetic Minority Oversampling Technique) method to balance the original data set;

[0113] w←w t

[0114] B←Dataset D n Divide into data blocks (batch) of size B

[0115] For each local Epoch i, execute from 1 to E;

[0116] Execute for each data block (batch) b∈B;

[0117] w←w-η▽(x,y;w)

[0118] Return the model parameter w and product recommendation accuracy α to the server.

[0119] Among them, F is the ratio of the number of clients participating in each round of federated learning training, B is the number of local BatchSize, BatchSize is the batch size, that is, the number of samples selected for each training, E is the number of local Epochs, Epoch means the number of times all samples in the training set are used for training. t is the index of the current round number, η is the learning rate, and ɑ is the accuracy of the detection model, which can be calculated by the loss function.

[0120] Figure 4 4 is a schematic diagram of main modules of a first client for data recommendation according to an embodiment of the present invention.

[0121] like Figure 4 As shown, the first client 400 for data recommendation according to an embodiment of the present invention mainly includes: a first local recommendation model training module 401, a global shared data downloading module 402, and a first local recommendation model updating module 403.

[0122] The first local recommendation model training module 401 is used to train a local first local recommendation model using a local user behavior data set, and send the trained first sharable data to a server.

[0123] The global shared data download module 402 is used to download global shared data from the server. The global shared data is calculated by the server based on the first sharable data and the second sharable data set. The second sharable data set includes the second sharable data sent to the server by one or more second clients.

[0124] The first local recommendation model updating module 403 is used to update the first local recommendation model using the global shared data to train the global recommendation model. After the global recommendation model training is completed, the global recommendation model is used to recommend object data matching the corresponding user behavior data to the user.

[0125] In one embodiment, the global shared data may include parameters of the global recommendation model and the loss function gradient of the global recommendation model; the first local recommendation model update module is specifically used to: update the parameters of the first local recommendation model and the loss function gradient of the first local recommendation model according to the parameters of the global recommendation model and the loss function gradient of the global recommendation model, and the first shareable data includes the parameters and loss function gradient of the first local recommendation model.

[0126] In one embodiment, the first local recommendation model update module updates the parameters of the first local recommendation model in the following manner: calculating the product of the learning rate of the first local recommendation model and the gradient of the loss function of the global recommendation model, and calculating the difference between the current parameters of the first local recommendation model and the product, to obtain the updated parameters of the first local recommendation model.

[0127] In one embodiment, the local user row of the first client may be a data set including one of the following data sets: user consumption behavior data, user social behavior data, and user operation behavior data on an object.

[0128] The contents already introduced in the above embodiments will not be described in detail in this embodiment.

[0129] Figure 5 4 is a schematic diagram of main modules of a server for data recommendation according to an embodiment of the present invention.

[0130] like Figure 5 As shown, the first client 400 for data recommendation according to an embodiment of the present invention mainly includes: a sharable data receiving module 501 and a global shared data calculating module 502 .

[0131] The sharable data receiving module 501 is used to receive sharable data sent by clients in the client set. The sharable data is obtained by the clients training their respective local recommendation models using their respective user behavior data sets.

[0132] The global shared data calculation module 502 is used to calculate the global shared data based on each shareable data. The global shared data is used by the client to update their respective local recommendation models to train the global recommendation model. The global recommendation model is used by the client to recommend object data matching the corresponding user behavior data to their respective users.

[0133] In one embodiment, the sharable data sent by the client may include parameters of the client's local recommendation model, and the global shared data includes parameters of the global recommendation model; the global shared data calculation module is specifically used to: randomly select the local recommendation models of some or all clients in the client set as target local recommendation models, and sort the parameters of each target local recommendation model according to a first sorting rule; according to the parameters of each sorted target local recommendation model, remove the maximum parameters of the first number and the minimum parameters of the second number, and calculate the average value of the remaining parameters to determine the parameters of the global recommendation model.

[0134] In one embodiment, the sharable data sent by the client may include parameters of the client's local recommendation model, and the global shared data includes parameters of the global recommendation model; the global shared data calculation module is specifically used to: randomly select the local recommendation models of some or all clients in the client set as the target local recommendation models, and sort the parameters of each target local recommendation model according to the second sorting rule; calculate the median of the parameters of each target local recommendation model after sorting, and if the total number of parameters of each target local recommendation model is an even number, calculate the average of the two middle parameters in the sorted parameters to determine the parameters of the global recommendation model.

[0135] In one embodiment, the global shared data may also include a loss function gradient of the global recommendation model. The global loss function is obtained by weighted averaging the loss functions of the target local recommendation models, and the loss function gradient of the global recommendation model is calculated based on the global loss function.

[0136] In one embodiment, according to a set percentage, local recommendation models of some or all clients in the client set are randomly selected as target local recommendation models.

[0137] The contents already introduced in the above embodiments will not be described in detail in this embodiment.

[0138] Figure 6 It is a schematic diagram of the main structure of a data recommendation system according to an embodiment of the present invention.

[0139] like Figure 6 As shown, a data recommendation system 600 according to an embodiment of the present invention mainly includes: a first client 601 for data recommendation, and a server 602 for data recommendation, and also includes a second client 603, and the number of the second client 603 can be multiple. Figure 6 A second client 603 is shown as an example.

[0140] The contents already introduced in the above embodiments will not be described in detail in this embodiment.

[0141] Figure 7An exemplary system architecture 700 is shown to which the data recommendation method, client, server or data recommendation system according to the embodiment of the present invention can be applied.

[0142] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0143] Users can use terminal devices 701, 702, and 703 to interact with server 705 through network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0144] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0145] The server 705 may be a server that provides various services, such as a backend management server (only for example) that supports shopping websites browsed by users using the terminal devices 701, 702, and 703. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only for example) to the terminal device.

[0146] It should be noted that the data recommendation method provided in the embodiment of the present invention can be executed by the server 705 or the terminal devices 701, 702, 703. Accordingly, the server 705 can be used as the server for data recommendation in the embodiment of the present invention, and the client for data recommendation in the embodiment of the present invention (such as the first client and the second client) can be set in the terminal devices 701, 702, 703. The server 705 and the terminal devices 701, 702, 703 can constitute the data recommendation system of the embodiment of the present invention.

[0147] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0148] Reference below Figure 8, which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention. Figure 8 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0149] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0150] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0151] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.

[0152] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0153] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0154] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor including a first local recommendation model training module, a global shared data download module, and a first local recommendation model update module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the first local recommendation model training module may also be described as "a module for training a local first local recommendation model using a local user behavior data set, and sending the trained first sharable data to a server."

[0155] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: a first client trains a local first local recommendation model using a local user behavior data set, and sends the trained first sharable data to a server; the first client downloads global shared data from the server, the global shared data is calculated by the server based on the first sharable data and the second sharable data set, and the second sharable data set includes one or more second sharable data sent to the server by the second client; the first client updates the first local recommendation model using the global shared data to train the global recommendation model, and after the global recommendation model training is completed, the global recommendation model is used to recommend object data matching the corresponding user behavior data to the user.

[0156] According to the technical solution of the embodiment of the present invention, the first client trains the local first local recommendation model with the local user behavior data set, and sends the first sharable data obtained by the training to the server; the first client downloads the global shared data from the server, the global shared data is calculated by the server based on the first sharable data and the second sharable data set, and the second sharable data set includes one or more second sharable data sent to the server by the second client; the first client updates the first local recommendation model with the global shared data to train the global recommendation model, and after the global recommendation model training is completed, the global recommendation model is used to recommend object data matching the corresponding user behavior data to the user. It can solve the problem of single dimension of user's relevant feature data, improve the accuracy of product recommendation, ensure the security of privacy data when federated learning is attacked maliciously, and improve the robustness of federated learning.

[0157] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A data recommendation method, characterized in that: include: The first client trains a local first local recommendation model using a local user behavior data set, and sends the trained first sharable data to the server; The first client downloads global shared data from the server, where the global shared data is calculated by the server according to the first sharable data and the second sharable data set, where the second sharable data set includes second sharable data sent to the server by one or more second clients; The first client updates the first local recommendation model using the global shared data to train a global recommendation model, and after the global recommendation model is trained, uses the global recommendation model to recommend object data matching the corresponding user behavior data to the user; The sharable data sent by the client includes parameters of the local recommendation model of the client, and the global shared data includes parameters of the global recommendation model; The parameters of the global recommendation model are obtained in the following manner: randomly selecting local recommendation models of some or all clients in the client set as target local recommendation models, and sorting the parameters of each target local recommendation model according to a first sorting rule; according to the sorted parameters of each target local recommendation model, removing the maximum parameters of the first quantity and the minimum parameters of the second quantity, and calculating the average value of the remaining parameters to determine the parameters of the global recommendation model; The first client updates the parameters of the first local recommendation model in the following manner: the first client calculates the product of the learning rate of the first local recommendation model and the gradient of the loss function of the global recommendation model, and calculates the difference between the current parameters of the first local recommendation model and the product, to obtain the updated parameters of the first local recommendation model.

2. The method according to claim 1, characterized in that The global shared data also includes the loss function gradient of the global recommendation model; The first client updates the first local recommendation model using the global shared data, including: The first client updates the parameters of the first local recommendation model and the loss function gradient of the first local recommendation model according to the parameters of the global recommendation model and the loss function gradient of the global recommendation model, and the first shareable data includes the parameters and the loss function gradient of the first local recommendation model.

3. The method according to claim 1, characterized in that The local user behavior data set of the first client is a collection of one of the following data: user consumption behavior data, user social behavior data, and user operation behavior data on an object.

4. A data recommendation method, characterized in that: include: The server receives sharable data sent by clients in the client set, where the sharable data is obtained by the clients training their respective local recommendation models using their respective user behavior datasets; The server calculates global shared data according to each of the sharable data, and the global shared data is used by the clients to update their respective local recommendation models to train a global recommendation model, and the global recommendation model is used by the clients to recommend object data matching the corresponding user behavior data to their respective users; The sharable data sent by the client includes parameters of the local recommendation model of the client, and the global shared data includes parameters of the global recommendation model; The server calculates global shared data according to each of the sharable data, including: randomly selecting local recommendation models of some or all of the clients in the client set as target local recommendation models, and sorting the parameters of each of the target local recommendation models according to a first sorting rule; according to the sorted parameters of each of the target local recommendation models, removing the maximum parameters of the first quantity and the minimum parameters of the second quantity, and calculating the average values ​​of the remaining parameters to determine the parameters of the global recommendation model; The clients update the parameters of their respective local recommendation models in the following manner: the clients calculate the product of the learning rate of their respective local recommendation models and the gradient of the loss function of the global recommendation model, and calculate the difference between the current parameters of their respective local recommendation models and the product to obtain the updated parameters of their respective local recommendation models.

5. The method according to claim 4, characterized in that The server calculates global shared data according to each of the sharable data, and further comprises: Randomly selecting local recommendation models of some or all clients in the client set as target local recommendation models, and sorting parameters of each target local recommendation model according to a second sorting rule; The median of the parameters of each of the target local recommendation models after sorting is calculated. If the total number of parameters of each of the target local recommendation models is an even number, the average of the two middle parameters of the sorted parameters is calculated to determine the parameters of the global recommendation model.

6. The method according to claim 4 or 5, characterized in that: The global shared data also includes the loss function gradient of the global recommendation model. The global loss function is obtained by weighted averaging the loss functions of the target local recommendation models, and the loss function gradient of the global recommendation model is calculated based on the global loss function.

7. The method according to claim 4 or 5, characterized in that: According to a set percentage, the local recommendation models of some or all clients in the client set are randomly selected as the target local recommendation model.

8. A first client for data recommendation, characterized in that: include: A first local recommendation model training module, used to train a local first local recommendation model using a local user behavior data set, and send the trained first sharable data to a server; a global shared data downloading module, configured to download global shared data from the server, wherein the global shared data is calculated by the server according to the first sharable data and the second sharable data set, wherein the second sharable data set includes second sharable data sent to the server by one or more second clients; A first local recommendation model updating module is used to update the first local recommendation model using the global shared data to train a global recommendation model. After the global recommendation model is trained, the global recommendation model is used to recommend object data matching the corresponding user behavior data to the user. The parameters of the first local recommendation model are updated in the following manner: the product of the learning rate of the first local recommendation model and the gradient of the loss function of the global recommendation model is calculated, and the difference between the current parameters of the first local recommendation model and the product is calculated to obtain the updated parameters of the first local recommendation model. The sharable data sent by the client includes parameters of the local recommendation model of the client, and the global shared data includes parameters of the global recommendation model; The parameters of the global recommendation model are obtained in the following manner: randomly selecting local recommendation models of some or all clients in the client set as target local recommendation models, and sorting the parameters of each target local recommendation model according to a first sorting rule; based on the sorted parameters of each target local recommendation model, removing the maximum parameters of the first number and the minimum parameters of the second number, and calculating the average value of the remaining parameters to determine the parameters of the global recommendation model.

9. A server for data recommendation, characterized in that: include: A sharable data receiving module, used to receive sharable data sent by clients in a client set, wherein the sharable data is obtained by the clients training their respective local recommendation models using their respective user behavior data sets; A global shared data calculation module, used to calculate global shared data based on each of the sharable data, the global shared data is used by the clients to update their respective local recommendation models to train a global recommendation model, and the global recommendation model is used by the clients to recommend object data matching the corresponding user behavior data to their respective users; The sharable data sent by the client includes parameters of the local recommendation model of the client, and the global shared data includes parameters of the global recommendation model; The server calculates global shared data according to each of the sharable data, including: randomly selecting local recommendation models of some or all of the clients in the client set as target local recommendation models, and sorting the parameters of each of the target local recommendation models according to a first sorting rule; according to the sorted parameters of each of the target local recommendation models, removing the maximum parameters of the first quantity and the minimum parameters of the second quantity, and calculating the average values ​​of the remaining parameters to determine the parameters of the global recommendation model; The clients update the parameters of their respective local recommendation models in the following manner: the clients calculate the product of the learning rate of their respective local recommendation models and the gradient of the loss function of the global recommendation model, and calculate the difference between the current parameters of their respective local recommendation models and the product to obtain the updated parameters of their respective local recommendation models.

10. A data recommendation system, characterized in that: include: A plurality of clients for data recommendation and a server for data recommendation as claimed in claim 9, wherein the plurality of clients include the first client as claimed in claim 8.

11. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

12. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • CNN-LFM model-based recommendation method and system and storage medium

    CN108985899A

  • Information recommendation model training method and information recommendation method and device

    CN110069715A

  • Security defense method for data manipulation attacks in federated learning

    CN111460443A

  • Personalized model training method and system combining federated learning and user portrait

    CN112329940A

  • Recommendation model training method and device, terminal equipment and storage medium

    CN112446507A