Information recommendation method based on gradient shuffling and related device
By shuffling and encrypting gradient parameters during training, and combining them with the latent vector parameters of neighbor clients in graph neural networks, the problems of insufficient recommendation accuracy and privacy protection in traditional recommendation algorithms are solved, achieving more efficient information recommendation and user data security.
Patent Information
- Application Number
- CN202310368921.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-03
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-04-03
AI Technical Summary
Traditional recommendation algorithms rely on users' historical information for modeling, resulting in insufficient recommendation accuracy. Furthermore, directly uploading user data to third-party servers fails to effectively protect user privacy.
Gradient shuffling technology is used to shuffle the training gradient parameters during training. This protects user data privacy through encryption and shuffling, while improving the accuracy of the recommendation model by utilizing graph neural networks and the latent vector parameters of neighbor clients.
This improves the accuracy of information recommendations while protecting user data privacy and avoiding the risk of information leakage.
Smart Images

Figure CN116383504B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of information recommendation, and particularly relates to an information recommendation method and system based on gradient shuffling, an intelligent terminal and a computer readable storage medium. BACKGROUND
[0002] In the process of social and technological development, people's demand for information is increasing, however, with the rapid rise of the Internet, the emergence of massive information makes users unable to accurately obtain the desired content, therefore, intelligent recommendation for each person's demand, formulating a personalized recommendation method solves this problem, the existing technology has the problem that in the traditional recommendation algorithm, a large amount of historical information of the user needs to be used, and the collected historical information is directly uploaded to a third-party server for training, which is not conducive to protecting the privacy of user information data.
[0003] Therefore, the prior art still needs to be improved and developed. SUMMARY
[0004] The main purpose of the present application is to provide an information recommendation method based on gradient shuffling and related equipment, aiming at solving the problem that the traditional recommendation algorithm only uses historical information for modeling, such as search, browsing and other common information, which is not conducive to improving the accuracy of the recommendation algorithm, and directly collecting the historical information of the user and uploading it to a third-party server for training, which is not conducive to protecting the privacy of user information data.
[0005] In order to achieve the purpose, the first aspect of the present application provides an information recommendation method based on gradient shuffling, wherein the information recommendation method based on gradient shuffling comprises:
[0006] obtaining the parameters of the historical rating items of the target object, wherein the historical rating items are the items that have been used and rated by the target object;
[0007] obtaining a plurality of to-be-recommended items, and obtaining the recommendation score corresponding to each to-be-recommended item according to the parameters of the historical rating items, the plurality of to-be-recommended items and the trained information recommendation model, wherein in the training process, each training client performs gradient shuffling on the training gradient parameters based on a preset gradient shuffling manner, and uploads the training gradient parameters to a center server for training, the training gradient parameters are the gradient vector of the predicted rating obtained according to the parameters of the training historical rating items, the training to-be-recommended items and the information recommendation model, and the parameters of the training historical rating items and the training to-be-recommended items correspond to the parameters of the historical rating items and the to-be-recommended items one by one respectively;
[0008] According to the recommendation scores corresponding to the to-be-recommended items, a target recommendation item is selected from the to-be-recommended items, and the target recommendation item is pushed to the target object.
[0009] Optionally, the information recommendation model is trained according to the following steps:
[0010] According to the parameters of the training historical scoring items, the training to-be-recommended item, and the information recommendation model, each training client calculates a predicted score corresponding to the training to-be-recommended item, and obtains the training gradient parameter according to the predicted score.
[0011] Each training client sends the training gradient parameter to a third-party server to trigger the third-party server to shuffle the training gradient parameter to obtain a shuffled training gradient parameter.
[0012] Each training client triggers the third-party server to upload each shuffled training gradient parameter to the center server to trigger the center server to construct center training data according to the received shuffled training gradient parameter to train the information recommendation model.
[0013] Optionally, according to the parameters of the training historical scoring items, the training to-be-recommended item, and the information recommendation model, each training client calculates a predicted score corresponding to the training to-be-recommended item, and obtains the training gradient parameter according to the predicted score, including:
[0014] Each training client corresponds to a training neighbor client, and the training neighbor client has an association relationship with the training client.
[0015] According to the parameters of the training neighbor client and the parameters of the training historical scoring items, an aggregation operation is performed to obtain an implicit vector of each training client, wherein the parameters of the training historical scoring items are implicit vectors of the training historical scoring items, and the parameters of the training neighbor client are implicit vectors of the training neighbor client.
[0016] According to the implicit vectors of each training client and the parameters of the training historical scoring items, an inner product operation is performed to obtain a predicted score corresponding to the training to-be-recommended item.
[0017] According to the predicted score and a preset first formula, a training gradient parameter of the predicted score is obtained.
[0018] Optionally, each training client sends the training gradient parameter to a third-party server to trigger the third-party server to shuffle the training gradient parameter to obtain a shuffled training gradient parameter, including:
[0019] Each of the training clients triggers the central server to generate a public key and a private key, and triggers the central server to broadcast the public key to each of the training clients;
[0020] Each of the training clients encrypts the training gradient parameter corresponding thereto according to the public key, obtains a training gradient encrypted parameter, and sends each of the training gradient encrypted parameters to the third-party server;
[0021] Each of the training clients triggers the third-party server to shuffle all the training gradient encrypted parameters to obtain shuffled training gradient encrypted parameters, and triggers the third-party server to send all the shuffled training gradient encrypted parameters to the central server;
[0022] Each of the training clients triggers the central server to decrypt all the shuffled training gradient encrypted parameters according to the private key to obtain the shuffled training gradient parameters.
[0023] Optionally, each of the training clients triggers the third-party server to upload each of the shuffled training gradient parameters to the central server, so as to trigger the central server to construct central training data according to the received shuffled training gradient parameters to train the specific process of the information recommendation model:
[0024] Each of the training clients triggers the central server to aggregate all the shuffled training gradient parameters to obtain global gradient parameters;
[0025] Each of the training clients triggers the central server to update a global vector table according to the global gradient parameters, wherein the global vector table includes the latent vector of each of the training clients and the latent vector of each of the training historical rating items;
[0026] Each of the training clients downloads the global vector table from the central server, and obtains a predicted rating corresponding to the training to-be-recommended item according to the updated latent vector of the training client and the latent vector of the training historical rating item;
[0027] According to the predicted rating and the training rating, the model parameters of the information recommendation model are adjusted, and the step of inputting the parameters of the training historical rating item and the training to-be-recommended item into the information recommendation model is continued to be executed until a preset training condition is met, so as to obtain a trained information recommendation model.
[0028] Optionally, the preset training condition is that when the accuracy of the predicted rating does not improve for five consecutive training rounds, the model training is ended.
[0029] Optionally, the to-be-recommended item includes a commodity link, an advertisement or a video.
[0030] The second aspect of the present application provides a gradient shuffle-based information recommendation system, comprising:
[0031] a parameter acquisition module configured to acquire parameters of historical scoring items of a target object, wherein the historical scoring items are items that have been used and scored by the target object;
[0032] a recommendation score acquisition module configured to acquire a plurality of to-be-recommended items, and acquire a recommendation score corresponding to each of the to-be-recommended items according to the parameters of the historical scoring items, the to-be-recommended items, and a trained information recommendation model, wherein in a training process, each training client performs gradient shuffling on training gradient parameters based on a preset gradient shuffling manner, and uploads the training gradient parameters to a central server for training, the training gradient parameters are gradient vectors of predicted scores obtained according to parameters of training historical scoring items, training to-be-recommended items, and the information recommendation model, and the parameters of the training historical scoring items and the training to-be-recommended items one-to-one correspond to the parameters of the historical scoring items and the to-be-recommended items, respectively;
[0033] a recommendation module configured to select a target recommendation item from the to-be-recommended items according to the recommendation score corresponding to each of the to-be-recommended items, and push the target recommendation item to the target object.
[0034] The third aspect of the present application provides an intelligent terminal, comprising a memory, a processor, and a gradient shuffle-based information recommendation program stored in the memory and executable on the processor, wherein the gradient shuffle-based information recommendation program, when executed by the processor, implements the steps of any one of the gradient shuffle-based information recommendation methods.
[0035] The fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a gradient shuffle-based information recommendation program, and the gradient shuffle-based information recommendation program, when executed by a processor, implements the steps of any one of the gradient shuffle-based information recommendation methods.
[0036] From the above, in the present application, the parameters of the historical scoring items of the target object are obtained, wherein the historical scoring items are the items that the target object has used and scored; a plurality of recommended items are obtained, and the recommendation scores corresponding to each of the recommended items are obtained according to the parameters of the historical scoring items, the plurality of recommended items and the trained information recommendation model, wherein in the training process, each training client performs gradient shuffling on the training gradient parameters based on a preset gradient shuffling manner, and uploads to the center server for training, the training gradient parameters are the gradient vectors of the predicted scores obtained according to the training parameters of the historical scoring items, the training recommended items and the information recommendation model, and the training parameters of the historical scoring items and the training recommended items correspond to the parameters of the historical scoring items and the recommended items respectively; the target recommended item is selected from the plurality of recommended items according to the recommendation scores corresponding to each of the recommended items, and the target recommended item is pushed to the target object.
[0037] Compared with the prior art, the present application provides an information recommendation method based on gradient shuffling, obtaining the parameters of the historical scoring items of the target object and a plurality of recommended items, obtaining the recommendation scores corresponding to each of the recommended items according to the parameters of the historical scoring items, the plurality of recommended items and the trained information recommendation model, and pushing the target recommended item to the target object from the plurality of recommended items according to the recommendation scores, in the training process of the information recommendation model, obtaining the hidden vector of the training client according to the neighbor client hidden vector parameters of the training client and the training parameters of the historical scoring items, and then obtaining the predicted score of the training recommended item, in order to protect the information of the training client, the training gradient parameters are shuffled, the training gradient parameters are the gradient vectors corresponding to the predicted scores, the center server aggregates the shuffled training gradient parameters and updates the global vector table to train the information recommendation model, which is beneficial to improve the accuracy of information recommendation, and since the training gradient parameters of the training client are shuffled, the correspondence between the training gradient parameters and each of the training clients is disturbed, so that the center server cannot directly obtain the information data of the training client, which is beneficial to improve the security of user data in the training process, thereby protecting the privacy of user data. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0039] Figure 1This is a schematic diagram of an information recommendation method based on gradient shuffling provided in an embodiment of the present invention;
[0040] Figure 2 This is an embodiment of the present invention. Figure 1 A detailed flowchart of step S200 is shown below;
[0041] Figure 3 This is an embodiment of the present invention. Figure 2 A detailed flowchart of step S202 is shown below;
[0042] Figure 4 This is an embodiment of the present invention. Figure 2 A detailed flowchart of step S203 is shown below;
[0043] Figure 5 This is a schematic diagram of an information protection recommendation method based on a federated graph neural network provided in an embodiment of the present invention;
[0044] Figure 6 This is a schematic diagram of an information protection recommendation algorithm based on a federated graph neural network provided in an embodiment of the present invention;
[0045] Figure 7 This is a schematic diagram of the structure of the information recommendation system based on gradient shuffling provided in an embodiment of the present invention;
[0046] Figure 8 This is a block diagram illustrating the internal structure of a smart terminal provided in an embodiment of the present invention. Detailed Implementation
[0047] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0048] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0049] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0050] It should also be further understood that the term "and / or" as used in the specification and in the claims, if present, means one or more of the items it conjoins and is intended to cover the possibilities of also using "only one of the items" and "all of the items".
[0051] As used in this specification and claims, the terms "if' can be construed to mean "when" or "upon" or "in response to determining" or "in response to ascertaining," depending on the context. Similarly, the phrase "if it is determined" or "if it is ascertained" can be construed to mean "upon determining" or "in response to determining" or "upon ascertaining" or "in response to ascertaining," depending on the context.
[0052] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0053] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be practiced without the specific details. In other instances, well-known methods, procedures, and components have not been described in detail so as not to obscure the present application. As such, the present application is not limited to the specific embodiments disclosed in the following description.
[0054] With the rapid rise of the Internet, the amount of information that users can access is increasing, but it is increasingly difficult to accurately obtain the desired content. The emergence of information recommendation algorithms can target specific recommendations based on user interests, which is more effective than non-targeted push of the same project. However, traditional recommendation algorithms only use historical information for modeling, such as search, browsing, and other such general information, which is not conducive to improving the accuracy of the recommendation algorithm. Moreover, due to the large amount of user behavior data, data processing poses a challenge to accurate recommendations, and further improvement in the accuracy of the recommendation method is needed. Furthermore, directly collecting user historical information and uploading it to a third-party server for training, on the one hand, if users authorize sensitive information to be provided to the platform for training of the information recommendation model, the platform may engage in information misuse, and in the interaction between the platform and the user, personal information may be stolen by potential malicious users, resulting in information leakage. In cross-platform interactions, information sharing between platforms is not entirely reliable, and there is a serious risk of information leakage. In order to better balance privacy protection and recommendation performance, it is not conducive to protecting the privacy of user information data.
[0055] To solve at least one of the problems, in the present application, parameters of a historical scoring item of a target object are acquired, wherein the historical scoring item is an item that has been used and scored by the target object; a plurality of to-be-recommended items are acquired, and a recommendation score corresponding to each of the to-be-recommended items is acquired according to the parameters of the historical scoring item, the plurality of to-be-recommended items, and a trained information recommendation model, wherein in a training process, each training client performs gradient shuffling on a training gradient parameter based on a preset gradient shuffling manner, and uploads the training gradient parameter to a center server for training, the training gradient parameter is a gradient vector of a predicted score obtained according to a training historical scoring item parameter, a training to-be-recommended item, and the information recommendation model, and the training historical scoring item parameter and the training to-be-recommended item one-to-one correspond to the historical scoring item parameter and the to-be-recommended item, respectively; a target recommendation item is selected and acquired from the plurality of to-be-recommended items according to the recommendation score corresponding to each of the to-be-recommended items, and the target recommendation item is pushed to the target object.
[0056] Compared with the prior art, the present application provides an information recommendation method based on gradient shuffling, parameters of a historical scoring item of a target object and a plurality of to-be-recommended items are acquired, a recommendation score corresponding to each of the to-be-recommended items is acquired according to the parameters of the historical scoring item, the plurality of to-be-recommended items, and a trained information recommendation model, and a target recommendation item is pushed to the target object from the plurality of to-be-recommended items according to the recommendation score, in a training process of the information recommendation model, a hidden vector of a training client is obtained according to a neighbor client hidden vector parameter of the training client and a training historical scoring item parameter, and a predicted score of a training to-be-recommended item is further obtained, in order to protect the information of the training client, a training gradient parameter is shuffled, the training gradient parameter is a gradient vector corresponding to the predicted score, a center server aggregates the shuffled training gradient parameter and updates a global vector table to train the information recommendation model, which is beneficial to improve the accuracy of information recommendation, and since the training gradient parameter of the training client is shuffled, the correspondence between the training gradient parameter and each of the training clients is disturbed, so that the center server cannot directly acquire information data of the training client, which is beneficial to improve the security of user data in the training process, thereby protecting the privacy of user information data.
[0057] Exemplary method
[0058] As Figure 1 shown, the embodiment of the present application provides an information recommendation method based on gradient shuffling, specifically, the method comprises the following steps:
[0059] In step S100, parameters of a historical scoring item of a target object are acquired, wherein the historical scoring item is an item that has been used and scored by the target object.
[0060] In this embodiment, the target object obtains the recommendation scores corresponding to each of the to-be-recommended items through the trained information recommendation model in the respective client according to the parameters of the historical scoring items and the preset to-be-recommended items, so that obtaining the parameters of the historical scoring items of the target object is the first step to obtain the recommendation scores. In one application scenario, the to-be-recommended items include product links, advertisements or videos, and in another application scenario, information recommendation can also be performed on public accounts, web pages, application software and the like, which are not limited here.
[0061] According to the historical behavior of the target object, the used items are scored according to the degree of preference to obtain the static scores of the used items, for example, the target object scores the used item A as five stars, that is, very satisfied, and scores the used item B as one star, that is, very dissatisfied. The used and scored items A and B are used as historical scoring items to further obtain the parameters of the historical scoring items.
[0062] In step S200, a plurality of to-be-recommended items are obtained, and the recommendation scores corresponding to each of the to-be-recommended items are obtained according to the parameters of the historical scoring items, the plurality of to-be-recommended items and the trained information recommendation model, wherein the trained information recommendation model performs gradient shuffling on the training gradient parameters based on a preset gradient shuffling manner in each training client during the training process and uploads to the center server for training, the training gradient parameters are gradient vectors of predicted scores obtained according to the parameters of training historical scoring items, training to-be-recommended items and the information recommendation model, and the parameters of the training historical scoring items and the training to-be-recommended items correspond to the parameters of the historical scoring items and the to-be-recommended items one by one, respectively.
[0063] In this embodiment, the recommendation scores corresponding to each of the to-be-recommended items are obtained by inputting the to-be-recommended items and the parameters of the historical scoring items into the trained information recommendation model, wherein the to-be-recommended items are a plurality of items that are not used and scored by the target object.
[0064] In the process of training the information recommendation model, a plurality of training clients participate in the model training. In this embodiment, the parameters of the training historical scoring items and the training to-be-recommended items of each training client are input into the untrained information recommendation model, each training client needs to perform gradient shuffling on the training gradient parameters based on a preset gradient shuffling manner, and upload the training gradient parameters to the center server to trigger the center server to update the global vector table for training according to the training gradient parameters, wherein the training gradient parameters are gradient vectors of predicted scores obtained according to the parameters of the training historical scoring items, the training to-be-recommended items and the information recommendation model. The training client, the parameters of the training historical scoring items and the training to-be-recommended items appearing in the process of training the information recommendation model have a one-to-one correspondence with the target object, the parameters of the historical scoring items and the to-be-recommended items appearing in the process of using the information recommendation model.
[0065] In step S300, the target recommendation item is selected from the plurality of to-be-recommended items according to the recommendation score corresponding to each to-be-recommended item, and the target recommendation item is pushed to the target object.
[0066] In this embodiment, the target recommendation item is selected from the plurality of to-be-recommended items according to the recommendation score corresponding to each to-be-recommended item obtained in steps S100 and S200, and the target recommendation item is pushed to the target object. The target recommendation item is one item with the highest recommendation score or several items with higher recommendation scores, which are not specifically limited here.
[0067] In this embodiment, the information recommendation model is trained according to the following steps. Specifically, as shown in FIG. 2, the step S200 includes: Figure 2
[0068] In step S201, each training client calculates the predicted score corresponding to the training to-be-recommended item according to the parameters of the training historical scoring items, the training to-be-recommended item and the information recommendation model, and obtains the training gradient parameters according to the predicted score.
[0069] In this embodiment, the predicted score corresponding to the training to-be-recommended item is obtained through the following four steps.
[0070] First, the training neighbor client corresponding to each training client is obtained, wherein the training neighbor client has an association relationship with the training client.
[0071] The traditional information recommendation algorithm only uses historical information for modeling, such as search, browsing and other common information, and the embodiment uses a graph neural network to model the historical behavior of the user, introduces the concept of neighbor users, and overcomes the shortcomings of traditional information recommendation technology that cannot use high-order information. In the embodiment, the training neighbor client refers to the client of the training neighbor user, and the training neighbor client corresponding to each training client needs to be obtained. In one application scenario, the training neighbor client is a friend or an object of attention of the training client. For example, if there is no social relationship in the entire system, the neighbor user refers to a user who has purchased the same item as the target object. For example, user 1 has purchased items a and b, user 2 has purchased items a and c, and user 1 and user 2 have both purchased the same item a, so user 1 and user 2 are neighbor users of each other.
[0072] In the second step, the parameters of the training neighbor client and the parameters of the training historical scoring item are aggregated to obtain the latent vector of each training client, wherein the parameters of the training historical scoring item are the latent vector of the training historical scoring item, and the parameters of the training neighbor client are the latent vector of the training neighbor client.
[0073] In the embodiment, the graph neural network is used to assign a random vector to the training neighbor client, and the random vector assigned to the training neighbor client is called the latent vector of the training neighbor client.
[0074] Suppose the score of the training client u on the historical item is R ui , the set is all training neighbor clients of the training client u The set records all items scored by user u, and the graph neural network is used to perform aggregation algorithm on the latent vector e v of the training neighbor client and the latent vector e i of the training historical scoring item to obtain the latent vector e u of each training client, as shown in formula (1):
[0075]
[0076] wherein Aggregate represents an aggregation operation, h u represents the result of aggregation in each round of training, and Update represents updating e u using the aggregated h u .
[0077] It should be noted that the embodiment provides a general framework of a graph neural network, and does not specifically limit the type of graph neural network model adopted. In an application scenario, a graph convolution network, a graph attention network, a gated graph neural network, etc. can be used, and a suitable graph neural network is selected according to actual needs in different learning tasks.
[0078] In a fourth step, inner product operation is performed according to the latent vector of each training client and the latent vector of the training historical scoring item, to obtain a predicted score corresponding to the training to-be-recommended item.
[0079] In the embodiment, the latent vector e u of the training client and the latent vector i i of the training historical scoring item are used to model the score R ui , as shown in formula (2):
[0080]
[0081] wherein, is the predicted score corresponding to the training to-be-recommended item, is the transpose of e u .
[0082] Further, the root mean square error value of the predicted score is calculated according to the obtained predicted score corresponding to the training to-be-recommended item, to measure the accuracy of the predicted score. In the training process of the information recommendation model, when the accuracy of the predicted score no longer improves after continuous multiple rounds of training (for example, five rounds of training), the model training is ended, and a trained information recommendation model is obtained.
[0083] In the embodiment, the training gradient parameter of the predicted score is obtained according to the obtained predicted score corresponding to the training to-be-recommended item and a preset first formula, wherein the training gradient parameter is a gradient vector of the predicted score, as shown in formula (3):
[0084]
[0085] wherein, Θ represents a learning parameter, which includes the latent vector of the training client, the latent vector of the historical scoring item, and a model parameter in the information recommendation model, wherein represents the number of training historical scoring items.
[0086] In step S202, each training client sends the training gradient parameter to the third-party server, to trigger the third-party server to shuffle the training gradient parameter to obtain a shuffled training gradient parameter.
[0087] In this embodiment, the training gradient parameter is the gradient vector of the prediction score. In the process of training the model, the conventional information recommendation method usually makes the training client upload the gradient vector of each training client to the center server for aggregation, so as to jointly learn the parameters of all the training clients. However, the gradient vector of each training client contains a large amount of private information of the training client. If the original gradient vector is not protected, an external device may still infer the original data of the training client according to the original gradient vector, and therefore it is not conducive to protecting the privacy of user information data.
[0088] The improvement scheme proposed in this embodiment is that, based on the federated learning framework, the gradient vector is sent to the third-party server for shuffling before being sent to the center server by the training client. In order to solve the problem that the third-party server may eavesdrop on user privacy, the gradient vector is encrypted before being sent to the third-party server for shuffling. Specifically, as shown in Figure 3 The step S202 includes:
[0089] In step S2021, each training client triggers the center server to generate a public key and a private key, and triggers the center server to broadcast the public key to each training client.
[0090] In this embodiment, each training client triggers the center server to generate a pair of keys, including a public key and a private key, for encryption and decryption of the training data uploaded by each training client to the center server.
[0091] In step S2022, each training client encrypts the training gradient parameter corresponding to each training client according to the public key, obtains a training gradient encryption parameter, and sends each training gradient encryption parameter to the third-party server.
[0092] In this embodiment, the introduced third-party server is a shuffler, and each training client encrypts the training gradient parameter by using an encryption function Enc(·; pk) to obtain a training gradient encryption parameter As shown in formula (4):
[0093]
[0094] It should be noted that the encryption function used in this embodiment is only one application scenario, and there is no limitation on which asymmetric encryption algorithm is used. In actual application, a corresponding asymmetric encryption algorithm can be selected according to actual needs.
[0095] Step S2023, each training client triggers the third-party server to shuffle all the training gradient encryption parameters to obtain shuffled training gradient encryption parameters, and triggers the third-party server to send all the shuffled training gradient encryption parameters to the center server.
[0096] Most mainstream federated learning frameworks use differential privacy or homomorphic encryption technology to further protect the privacy of user information data. However, the calculation overhead of homomorphic encryption is too large, and it will greatly increase the storage burden of the training client. In addition, even if differential privacy protection is used for the gradient, it is difficult to protect the set of items scored by the training client in the past, and even reduces the accuracy of the information recommendation model.
[0097] To this end, in order to solve this problem, the training gradient parameters are encrypted in the embodiment, and then shuffled. The third-party server performs element-level rearrangement on the received training gradient encryption parameters (that is, all training gradient encryption parameters are respectively arranged in a group according to each dimension, and all elements in the same group are randomly reordered). For example, if the gradient vector is a d-dimensional column vector, n gradient vectors are arranged horizontally to obtain a d×n matrix, and the element-level rearrangement is to rearrange each row of the matrix respectively.
[0098] In the embodiment, by shuffling the training gradient encryption parameters, the shuffled training gradient encryption parameters are obtained The anonymity of the training gradient encryption parameters is increased, the correspondence between the original gradient and the training client is disturbed under the protection of the ciphertext, the information contained in the training gradient parameters is protected, and the purpose of protecting the privacy of user information data is achieved.
[0099] Step S2024, each training client triggers the center server to decrypt all the shuffled training gradient encryption parameters according to the private key to obtain the shuffled training gradient parameters.
[0100] In the embodiment, the center server uses the decryption function Dec(·;sk) to decrypt the shuffled training gradient encryption parameters to obtain the shuffled training gradient parameters, as shown in formula (5):
[0101]
[0102] Among them, the shuffled training gradient encryption parameters are
[0103] Step S203, each training client triggers the third-party server to upload the shuffled training gradient parameters to the center server, so as to trigger the center server to construct center training data according to the received shuffled training gradient parameters to train the information recommendation model.
[0104] Specifically, as shown in Figure 4 The step S203 includes:
[0105] Step S2031, each training client triggers the center server to aggregate all the shuffled training gradient parameters to obtain a global gradient parameter.
[0106] In this embodiment, since the shuffling process of the third-party server does not interfere with the aggregation of the gradient vector, the aggregation of the shuffled gradient vector on the center server and the direct aggregation of the original gradient vector are equivalent, only the correspondence between the original gradient vector and the training client is disturbed, thereby facilitating the protection of the privacy of user information data, and the aggregation operation is shown in formula (6):
[0107]
[0108] Wherein, is the gradient vector of the shuffled predicted score, S is a set of users participating in training in the current training round, and g is a global gradient vector aggregated by the center server.
[0109] In each round of federated training, the server randomly selects C = |S| user corresponding clients to participate in training, and then uses the gradient descent method to update all trainable parameters, wherein the trainable parameters include: the latent vector of the training client, the latent vector of the training historical rating item and the model parameter of the information recommendation model.
[0110] Step S2032, each training client triggers the center server to update a global vector table according to the global gradient parameter, wherein the global vector table includes the latent vector of all the training clients and the latent vector of all the training historical rating items.
[0111] In this embodiment, the center server aggregates the mixed training gradient parameters (i.e. local gradient vectors) to obtain the global gradient parameter (i.e. global gradient vector), and updates the global vector table for the next round of model training.
[0112] Step S2033, each training client downloads the global vector table from the center server, and obtains the predicted score corresponding to the training to-be-recommended item according to the updated latent vector of the training client and the latent vector of the training historical rating item.
[0113] In this embodiment, each training client downloads the updated global vector table from the center server, and obtains a new round of predicted scores according to the formula (2) based on the updated hidden vector of the training client and the hidden vector of the training historical scoring item, and then calculates the accuracy of the new round of predicted scores, and if the accuracy does not improve and remains the same for a plurality of consecutive rounds, the model training is completed, and if the accuracy improves compared with that of the last round of predicted scores, the next round of training is entered.
[0114] In step S2034, the model parameters of the information recommendation model are adjusted according to the predicted score and the training score, and the step of inputting the parameters of the training historical scoring item and the training item to be recommended into the information recommendation model is continued until a preset training condition is met, so as to obtain a trained information recommendation model.
[0115] In this embodiment, the predicted score obtained in each round of training is compared with the training score, and the predicted score obtained in the process of model training should be closer and closer to the training score. The model parameters of the information recommendation model are adjusted according to the predicted score and the training score. In one application scenario, the predicted score is measured by accuracy, and in another application scenario, the loss value of the predicted score and the training score can be calculated, and the model parameters are adjusted according to the loss value, until a trained information recommendation model is obtained.
[0116] An information protection recommendation method based on a federated graph neural network is provided in the embodiments of the present application, and specifically as shown in Figure 5 .
[0117] In the process of training the information recommendation model, the training neighbor client of the training client is obtained, the hidden vector e v of the training neighbor client and the hidden vector e i of the training historical scoring item are input into the graph neural network to obtain the hidden vector e u of the training client, the predicted score is obtained according to the hidden vector of the training client, the gradient vector of the predicted score is obtained according to the predicted score, the gradient of the gradient vector and the model parameter is encrypted, the encrypted data is uploaded to the shuffler for shuffling, the shuffled data is uploaded to the center server, the mixed data is aggregated on the center server, and the model parameters and the global vector table in the information recommendation model are updated, wherein the global vector table includes the hidden vector e u of the training client and the hidden vector e i of the training historical scoring item, the next round of training is performed according to the updated e u and e i , and a new score is predicted.
[0118] The embodiment of the present application also provides an information protection recommendation algorithm based on a federated graph neural network, and specific codes are as shown in the following: Figure 6
[0119] Input parameters C, η, pk, sk, wherein, is a set of all items scored by the user u, is a set of all training neighbor clients v of the training client u, C is a center server randomly extracting C training clients, pk is an encryption function, sk is a decryption function, η is a learning rate, and Θ is a parameter to be learned in the information recommendation model.
[0120] As can be seen from the above, in the present application, the parameters of the historical scoring items of the target object are obtained, wherein the historical scoring items are the items that have been used and scored by the target object; a plurality of to-be-recommended items are obtained, and a recommendation score corresponding to each to-be-recommended item is obtained according to the parameters of the historical scoring items, the plurality of to-be-recommended items and a trained information recommendation model, wherein in the training process, each training client performs gradient shuffling on a training gradient parameter based on a preset gradient shuffling mode, and uploads the training gradient parameter to a center server for training, the training gradient parameter is a gradient vector of a predicted score obtained according to a training parameter of a historical scoring item, a training to-be-recommended item and the information recommendation model, and the training parameter of the historical scoring item and the training to-be-recommended item one-to-one correspond to the parameter of the historical scoring item and the to-be-recommended item respectively; a target recommendation item is obtained from the plurality of to-be-recommended items according to the recommendation score corresponding to each to-be-recommended item, and the target recommendation item is pushed to the target object.
[0121] Compared with the prior art, the present application provides a gradient shuffle-based information recommendation method, parameters of a historical scoring item of a target object and a plurality of to-be-recommended items are obtained, a recommendation score corresponding to each of the to-be-recommended items is obtained according to the parameters of the historical scoring item, the plurality of to-be-recommended items and a trained information recommendation model, the target recommendation item is pushed to the target object from the plurality of to-be-recommended items according to the recommendation score, in the training process of the information recommendation model, the hidden vector of the training client is obtained according to the neighbor client hidden vector parameter of the training client and the parameter of the training historical scoring item, and then the predicted score of the training to-be-recommended item is obtained, in order to protect the information of the training client, the training gradient parameter is shuffled, the training gradient parameter is a gradient vector corresponding to the predicted score, the center server aggregates the shuffled training gradient parameter and updates the global vector table to train the information recommendation model, which is helpful to improve the accuracy of information recommendation, and since the training gradient parameter of the training client is shuffled, the corresponding relationship between the training gradient parameter and each of the training clients is disturbed, so that the center server cannot directly obtain the information data of the training client, which is helpful to improve the security of user data in the training process, thereby protecting the privacy of user information data.
[0122] Exemplary device
[0123] The present application also provides a gradient shuffle-based information recommendation system, as shown in the accompanying drawings, the gradient shuffle-based information recommendation system comprises: Figure 7
[0124] The parameter acquisition module 410 is configured to acquire parameters of a historical scoring item of a target object, wherein the historical scoring item is an item that has been used and scored by the target object.
[0125] The recommendation score acquisition module 420 is configured to acquire a plurality of to-be-recommended items, and obtain a recommendation score corresponding to each of the to-be-recommended items according to the parameters of the historical scoring item, the plurality of to-be-recommended items and a trained information recommendation model, wherein in the training process, each training client performs gradient shuffle on a training gradient parameter based on a preset gradient shuffle manner, and uploads the training gradient parameter to a center server for training, the training gradient parameter is a gradient vector of a predicted score obtained according to parameters of training historical scoring items, training to-be-recommended items and the information recommendation model, and the parameters of the training historical scoring items and the training to-be-recommended items correspond to the parameters of the historical scoring item and the to-be-recommended items one by one, respectively.
[0126] The recommendation module 430 is configured to select and acquire a target recommendation item from the plurality of to-be-recommended items according to the recommendation score corresponding to each of the to-be-recommended items, and push the target recommendation item to the target object.
[0127] It should be noted that the division of the various modules of the information recommendation system based on gradient shuffling is not unique and is not specifically limited herein.
[0128] Based on the embodiments, the present application further provides an intelligent terminal, a principle block diagram of which can be as shown in Figure 8 The intelligent terminal includes a processor and a memory. The memory of the intelligent terminal includes an information recommendation program based on gradient shuffling, and the memory provides an environment for the running of the information recommendation program based on gradient shuffling. The information recommendation program based on gradient shuffling, when executed by the processor, implements the steps of any one of the information recommendation methods based on gradient shuffling. It should be noted that the intelligent terminal can further include other functional modules or units, which are not specifically limited herein.
[0129] Those skilled in the art can understand that Figure 8 The principle block diagram shown in the above figure is only a block diagram of part of the structure related to the present application, and does not constitute a limitation on the intelligent terminal to which the present application is applied. Specifically, the intelligent terminal can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0130] The present application further provides a computer readable storage medium, which stores an information recommendation program based on gradient shuffling. The information recommendation program based on gradient shuffling, when executed by a processor, implements the steps of any one of the information recommendation methods based on gradient shuffling provided by the embodiments of the present application.
[0131] It should be understood that the sequence numbers of the steps in the embodiments do not mean the order of execution. The execution order of the processes should be determined according to their functions and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0132] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the functional units and modules is taken as an example. In actual application, the functions can be completed by different functional units and modules according to needs, i.e., the internal structure of the system is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or software. In addition, the specific names of the functional units and modules are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the system can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0133] In the embodiments described above, each embodiment is described with emphasis on different aspects. Those skilled in the art can refer to the relevant description of other embodiments for the parts not described or recorded in detail in a certain embodiment.
[0134] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0135] In the embodiments provided by the present application, it should be understood that the disclosed system / smart terminal and method can be implemented in other ways. For example, the system / smart terminal embodiments described above are only schematic. The division of the modules or units is only a logical function division. There can be another division for actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0136] The integrated modules / units, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the embodiment method can also be completed by computer programs instructing related hardware, and the computer programs can be stored in a computer readable storage medium. The computer programs can be executed by a processor to implement the steps of the various method embodiments. The computer programs include computer program codes, which can be in the form of source codes, object codes, executable files or some intermediate forms. The computer readable medium can include any entity or device capable of carrying the computer program codes, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the computer readable storage medium can include appropriate additions or subtractions according to the requirements of legislation and patent practice in the jurisdiction.
[0137] The above-described embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand; it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements are not the essence of the corresponding technical solutions, which deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for information recommendation based on gradient shuffle, characterized in that, The method comprises: obtaining parameters of historical scoring items of a target object, wherein the historical scoring items are items that have been used and scored by the target object; obtaining a plurality of to-be-recommended items, and obtaining a recommendation score corresponding to each of the to-be-recommended items according to the parameters of the historical scoring items, the plurality of to-be-recommended items, and a trained information recommendation model, wherein in a training process, each training client performs gradient shuffling on training gradient parameters based on a preset gradient shuffling manner, and uploads the training gradient parameters to a center server for training, the training gradient parameters are gradient vectors of predicted scores obtained according to training parameters of historical scoring items, training to-be-recommended items, and the information recommendation model, and the training parameters of historical scoring items and the training to-be-recommended items one-to-one correspond to the parameters of the historical scoring items and the to-be-recommended items, respectively; The information recommendation model is trained according to the following steps: each training client obtains a predicted score corresponding to the training to-be-recommended item according to the training parameters of historical scoring items, the training to-be-recommended item, and the information recommendation model, and obtains the training gradient parameters according to the predicted score; each training client sends the training gradient parameters to a third-party server to trigger the third-party server to perform shuffling on the training gradient parameters to obtain shuffled training gradient parameters; each training client triggers the third-party server to upload each of the shuffled training gradient parameters to the center server to trigger the center server to construct center training data according to the received shuffled training gradient parameters to train the information recommendation model; each training client sends the training gradient parameters to a third-party server to trigger the third-party server to perform shuffling on the training gradient parameters to obtain shuffled training gradient parameters, comprising: each training client triggers the center server to generate a public key and a private key, and triggers the center server to broadcast the public key to each training client; each training client encrypts the training gradient parameters corresponding to each training client according to the public key to obtain training gradient encryption parameters, and sends each training gradient encryption parameter to the third-party server; each training client triggers the third-party server to perform shuffling on all the training gradient encryption parameters to obtain shuffled training gradient encryption parameters, and triggers the third-party server to send all the shuffled training gradient encryption parameters to the center server; each training client triggers the center server to decrypt all the shuffled training gradient encryption parameters according to the private key to obtain the shuffled training gradient parameters; The specific process in which each training client triggers the third-party server to upload each of the shuffled training gradient parameters to the center server to trigger the center server to construct center training data according to the received shuffled training gradient parameters to train the information recommendation model: each training client triggers the center server to aggregate all the shuffled training gradient parameters to obtain global gradient parameters; The training clients trigger the central server to update a global vector table according to the global gradient parameters, where the global vector table includes latent vectors of all the training clients and latent vectors of all the training historical rating items; The training clients download the global vector table from the central server, and obtain a predicted rating corresponding to the training to-be-recommended item according to the updated latent vectors of the training clients and the training historical rating items; According to the predicted rating and the training rating, the model parameters of the information recommendation model are adjusted, and the step of inputting the parameters of the training historical rating items and the training to-be-recommended item into the information recommendation model is continuously performed until a preset training condition is met, so as to obtain a trained information recommendation model; According to the recommendation scores corresponding to the to-be-recommended items, a target recommendation item is selected from a plurality of to-be-recommended items, and the target recommendation item is pushed to the target object.
2. The gradient shuffle-based information recommendation method according to claim 1, characterized in that, The training clients calculate the predicted rating corresponding to the training to-be-recommended item according to the parameters of the training historical rating items, the training to-be-recommended item and the information recommendation model, and obtain the training gradient parameters according to the predicted rating, including: obtaining training neighbor clients corresponding to each training client, where the training neighbor clients have an association relationship with the training client; performing aggregation operation on the parameters of the training neighbor clients and the parameters of the training historical rating items to obtain the latent vectors of the training clients, where the parameters of the training historical rating items are the latent vectors of the training historical rating items, and the parameters of the training neighbor clients are the latent vectors of the training neighbor clients; performing inner product operation on the latent vectors of each training client and the latent vectors of the training historical rating items to obtain the predicted rating corresponding to the training to-be-recommended item; obtaining the training gradient parameters of the predicted rating according to the predicted rating and a preset first formula.
3. The gradient shuffle-based information recommendation method according to claim 1, characterized in that, The preset training condition is that the model training is ended when the accuracy of the predicted rating does not improve for five consecutive training rounds.
4. The gradient shuffle-based information recommendation method of claim 1, wherein, The to-be-recommended items include product links, advertisements or videos.
5. A gradient shuffle-based information recommendation system, characterized by, The gradient shuffle-based information recommendation is used to implement the gradient shuffle-based information recommendation method in any one of claims 1-4, and the system includes: a parameter acquisition module configured to acquire parameters of historical rating items of a target object, where the historical rating items are items that have been used and rated by the target object; The recommendation score obtaining module is configured to obtain a plurality of to-be-recommended items, and obtain a recommendation score corresponding to each of the to-be-recommended items according to the parameter of the historical scoring item, the plurality of to-be-recommended items, and a trained information recommendation model. In the training process, each training client performs gradient shuffling on a training gradient parameter based on a preset gradient shuffling manner, and uploads the training gradient parameter to a center server for training. The training gradient parameter is a gradient vector of a predicted score obtained according to a parameter of a training historical scoring item, a training to-be-recommended item, and the information recommendation model. The training historical scoring item and the training to-be-recommended item each one-to-one correspond to the historical scoring item and the to-be-recommended item, respectively. The recommendation module is configured to select a target recommended item from the plurality of to-be-recommended items according to the recommendation score corresponding to each of the to-be-recommended items, and push the target recommended item to the target object.
6. A smart terminal, characterized by The intelligent terminal includes a memory, a processor, and a gradient-shuffling-based information recommendation program stored in the memory and executable on the processor. When the gradient-shuffling-based information recommendation program is executed by the processor, the steps of the gradient-shuffling-based information recommendation method according to any one of claims 1-4 are implemented.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a gradient-shuffling-based information recommendation program. When the gradient-shuffling-based information recommendation program is executed by the processor, the steps of the gradient-shuffling-based information recommendation method according to any one of claims 1-4 are implemented.
Citation Information
Patent Citations
Federated learning-based recommendation model training method, terminal and storage medium
CN110297848A
Federal learning method and device based on splitting shuffling, equipment and medium
CN115442036A