Target sample recommendation method based on data privacy protection of both parties

By employing federated learning and homomorphic encryption algorithms, and using the data party to calculate sample similarity locally and utilize the encrypted XGBoost model, the problem of data leakage in enterprise customer acquisition is solved, achieving the protection of data privacy for both parties and efficient recommendation of target samples.

CN115269983BActive Publication Date: 2025-12-16SHANGHAI LIGHT TREE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210899031.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-28
Publication Date
2025-12-16
Estimated Expiration
2042-07-28

AI Technical Summary

Technical Problem

In the process of enterprise customer acquisition, existing data purchase methods lead to data leakage, and service purchase methods lead to the leakage of customer information of the demand side, making it difficult to protect the data privacy of both the demand side and the data provider at the same time.

Method used

By employing federated learning and homomorphic encryption algorithms, the data provider calculates sample similarity locally and uses the encrypted XGBoost model to recommend target samples, ensuring that the data provider does not know the real customer information of the demand side, and that the data provider's non-target sample information is not leaked.

Benefits of technology

It enables efficient recommendation of target samples without data leakage, protects the data privacy of both the demand side and the data provider, and improves the security of data transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269983B_ABST
    Figure CN115269983B_ABST
Patent Text Reader

Abstract

The application discloses a target sample recommendation method based on data privacy protection of both parties. The data party calculates the similarity between each candidate sample in the local computing database and each training sample provided by the demand party for federated learning. Since the data party cannot know the sample label corresponding to each training sample provided by the demand party in the federated learning environment, the data party cannot judge whether the training sample participating in the similarity calculation is a real customer existing in the demand party, thereby protecting the existing real customer information of the demand party from being leaked. Meanwhile, since the sample similarity calculation is performed locally at the data party, the demand party cannot know the specific information of each candidate sample participating in the similarity calculation, thereby ensuring that the non-target sample information of the data party is not leaked. In addition, in the target sample prediction stage, the data party only recommends the samples predicted as positive examples to the demand party as target samples through an XGBoost model, thereby ensuring that the data information of the non-target samples in the recommended samples is not leaked.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of customer expansion, and particularly relates to a target sample recommendation method based on data privacy protection of both parties. BACKGROUND

[0002] At present, enterprises expand customers mainly in two ways: data purchase and service purchase.

[0003] The first way is data purchase, that is, an enterprise as a customer expansion demand party (hereinafter referred to as a demand party) purchases all potential customer sample data from a data service provider as a data holder (hereinafter referred to as a data party), and then uses a sample similarity calculation method to match target samples with high similarity to existing customers from all potential customer sample data. In this scheme, the data party discloses all or a large amount of data in plaintext to the demand party. The disadvantages of this scheme are obvious: for the demand party, the purchase of full-amount sample data requires higher purchase cost, and the proportion of the number of target samples of the demand party in the full-amount data may be low, so the purchase of full-amount data is not cost-effective. For the data party, the provision of full-amount data in plaintext to the demand party causes the data information of some non-target samples to be disclosed to the demand party, resulting in data information leakage.

[0004] The second way is service purchase, that is, the demand party provides its existing customer information data to the data party, the data party extracts customer features of the existing customers according to the data provided by the demand party, and then trains a similarity calculation model using the customer features as samples, and uses the trained similarity calculation model to calculate the similarity of all samples in the database, and provides a list of new customers with high similarity to the demand party. The disadvantages of this scheme are: the demand party needs to disclose its existing customer information data to the data party, which also causes information leakage for the demand party.

[0005] In summary, in the data purchase way, the data party wants to disclose only the data of target samples to the demand party, while ensuring that the data privacy of non-target samples in the full-amount data is not leaked; in the service purchase way, the demand party wants its existing customer information data not to be obtained by the data party, so as to protect the disclosure of the existing customer information of the enterprise. Therefore, how to simultaneously satisfy the data privacy not to be leaked in the above-mentioned application scenarios for the demand party and the data party has become a technical problem to be solved in this field. SUMMARY

[0006] The present application provides a target sample recommendation method based on data privacy protection of both parties to ensure the data privacy of both the demand party and the data party not to be leaked and improve the security of data transaction.

[0007] To achieve this purpose, the present application adopts the following technical scheme:

[0008] Provided is a target sample recommendation method based on two-party data privacy protection, comprising the following steps:

[0009] S1, the data party performs federated learning according to the training sample id provided by the demand party, and obtains an XGBoost model encrypted by a homomorphic encryption algorithm as a federated learning model;

[0010] S2, under the federated learning environment, the data party calculates the similarity between each candidate sample in its local database and each training sample provided by the demand party for federated learning, sorts and filters the candidate samples according to the similarity from high to low, and obtains M pieces of recommended samples;

[0011] S3, the data party classifies and predicts the M pieces of recommended samples by using the federated learning model trained in step S1 locally, and recommends several pieces of recommended samples predicted as positive examples to the demand party as target samples.

[0012] Preferably, the training samples provided by the demand party for federated learning include data samples of customer groups in the target field as positive examples and data samples of customer groups in non-target fields as negative examples.

[0013] Preferably, the homomorphic encryption algorithm in step S1 includes a paillier homomorphic encryption algorithm.

[0014] Preferably, in step S2, the cosine similarity is used to calculate the similarity between each candidate sample and each training sample.

[0015] Preferably, in step S1, the method steps for encrypting the XGBoost model by using the paillier homomorphic encryption algorithm include:

[0016] S11, the demand party generates a paillier public and private key and saves it locally, before building each tree, the demand party calculates the first-order derivative and second-order derivative of each sample according to the true value of the sample label and the predicted value of the current sample, and encrypts them by using the locally generated paillier public key;

[0017] S12: the demand party sends the encrypted first-order derivative and second-order derivative of the sample to the data party, in the calculation of each tree node splitting information, the data party calculates the sum of the first-order derivative and second-order derivative ciphertext of the left and right child node samples generated after the current splitting point is split for each splittable point of each feature in the local, and sends the sum ciphertext to the demand party;

[0018] S13: the demand party decrypts the sum ciphertext by using the locally saved private key to obtain the corresponding plaintext.

[0019] The present application has the following beneficial effects:

[0020] 1. In the target sample prediction stage, the XGBoost model saves the tree structure and leaf node scores in the demand side, and the data side only saves the feature and feature split point value information required for splitting each non-leaf node in the tree, and cannot restore the overall tree model, so that the prediction value of each sample is not obtained in the prediction stage, thereby ensuring that the existing real customer sample information of the demand side is not known by the data side;

[0021] 2. The data side calculates the similarity between each candidate sample in the local database and each training sample provided by the demand side for federated learning. Since the data side cannot know the sample label corresponding to each training sample provided by the demand side in the federated learning environment, it cannot determine whether the training sample participating in the similarity calculation is the existing real customer of the demand side, thereby protecting the existing real customer information of the demand side from being leaked to a certain extent. At the same time, since the sample similarity calculation is performed locally in the data side, the demand side cannot obtain the specific information of each candidate sample participating in the similarity calculation, thereby ensuring that the non-target sample information of the data side is not leaked;

[0022] 3. The data side locally classifies and predicts the recommended samples by using the trained federated learning model, and only recommends the recommended samples predicted as positive examples to the demand side, thereby ensuring that the data information of the non-target samples in the recommended samples is not leaked. BRIEF DESCRIPTION OF DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0024] Figure 1 is the implementation step diagram of the target sample recommendation method based on the data privacy protection of both sides provided by an embodiment of the present application;

[0025] Figure 2 is the logic diagram of the target sample recommendation method based on the data privacy protection of both sides provided by the embodiment of the present application;

[0026] Figure 3 is the sample alignment method flowchart based on RSA encryption used in the federated learning of the present embodiment;

[0027] Figure 4 is the method step diagram of the XGBoost model trained by federated learning and paillier homomorphic encryption.

[0028] Figure 5 is a method step diagram for predicting the target sample required by the demand side from the local database of the data side using the XGBoost model after paillier homomorphic encryption;

[0029] Figure 6 is a public key and private key generation flowchart of the paillier homomorphic encryption algorithm;

[0030] Figure 7 is an encryption and decryption flowchart for generating public and private keys using the paillier homomorphic encryption algorithm;

[0031] Figure 8 is a flowchart of encryption and decryption calculation of the XGBoost model using the paillier homomorphic encryption algorithm;

[0032] Figure 9 is an RSA public and private key generation flowchart.

[0033] Figure 10 is a detail diagram of the XGBoost overall model and single tree model. DETAILED DESCRIPTION

[0034] The technical solutions of the present application will be further described below in combination with the drawings and through specific embodiments.

[0035] Among them, the drawings are only used for example explanation, and the representation is only a schematic diagram, not a physical diagram, and cannot be understood as a limitation of the patent; in order to better illustrate the embodiments of the present application, some components of the drawings will be omitted, enlarged or reduced, and do not represent the size of the actual product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings can be omitted.

[0036] The same or similar reference numerals in the drawings of the embodiments of the present application correspond to the same or similar components; in the description of the present application, it should be understood that if the terms "upper", "lower", "left", "right", "inner", "outer" and the like indicate the orientation or positional relationship shown in the drawings, only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore the terms describing the positional relationship in the drawings are only used for example explanation, and cannot be understood as a limitation of the patent, for those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0037] In the description of the present application, unless otherwise explicitly specified and limited, if the term "connection" or the like appears to indicate the connection relationship between components, the term should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or it can be integrated; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium; it can be the internal communication of two components or the interaction relationship between two components. For those skilled in the art, the specific meaning of the above-mentioned terms in the present application can be understood according to the specific circumstances.

[0038] The implementation process of the target sample recommendation method based on two-party data privacy protection provided by the embodiment of the present application is specifically described as follows:

[0039] Suppose that the demand side A currently has N pieces of customer group data in a certain target field as positive example samples for federated learning modeling. In order to protect the data privacy of the positive example samples, some data of customer groups in non-target fields are introduced as negative example samples, and the positive example samples and the negative example samples constitute the training sample set provided by the demand side for federated learning modeling. In order to simulate the unbalanced sample situation in reality, the number of negative example samples is preferably N times the number of positive example samples, for example, there are 10N samples in the training sample set, 9N of which are negative example samples and N of which are positive example samples.

[0040] Then, the demand side A performs federated learning modeling with the data side B by using the constructed training sample set. The demand side A has positive and negative example labels of the training samples, and the local database of the data side B has all sample features of the training samples provided by the demand side A. However, since it is in a federated learning environment, the data side B cannot obtain the label information of each sample in the training samples, that is, the data side B cannot determine which samples in the training samples are real customer samples of the demand side A in the target field and which samples are non-real customer samples in the non-target field, so that the real customer information of the demand side A is ensured not to be disclosed to the data side B. In federated learning, after sample alignment, parameter updating and other steps, a federated learning model participated by the demand side A and the data side B is trained. In the present embodiment, the sample alignment method is described in detail in the following Figure 3 , specifically as follows:

[0041] Step one: the initiator initiates a sample alignment task, and the participants respond to the task to participate in alignment. There is only one initiator, and there can be multiple participants. Each participant generates a pair of RSA keys {n, e, d} and sends the public key {n, e} to the initiator. The steps of RSA generation are described in detail in the following Figure 7 In the present scenario, the initiator is the demand side, and the participants are the data sides.

[0042] Step two: the initiator generates a set of random masks {r i},each group of random masks has the same number as the local sample number of the initiator, and the initiator saves each group of random masks and the corresponding relationship of the participants. After the mask is encrypted by the public key of the participant and multiplied by the hashed sample id, the encrypted sample id r i e Hash(id i ), the encrypted sample id is sent to the participant.

[0043] Step three: after receiving the encrypted id sent by the initiator, the participant uses the private key to perform power multiplication calculation (r i e Hash(id i ) d , to obtain the encrypted initiator id containing the private key and the random mask: r i Hash(id i ) d ; at the same time, the participant encrypts the initiator id and the participant id in the same form by hashing and RSA private key to obtain the same encrypted form of the participant id: Hash(id i ) d , and sends the initiator id and the participant id in this form to the initiator.

[0044] Step four: after receiving the initiator sample id and the participant sample id encrypted by the RSA private key, the initiator first eliminates the random mask of the initiator sample id to obtain: Hash(id i ) d At this time, the encrypted form of the id is completely consistent with the encrypted form of the participant, so the intersection calculation between the two is performed, and finally the intersection of the initiator and the participant sample id is obtained.

[0045] Federated learning is a distributed machine learning technology, and its core idea is to train a distributed model among multiple data sources with local data, without exchanging local individual or sample data, but only by exchanging model parameters or intermediate results, to build a global model based on virtual fused data, so as to realize the balance between data privacy protection and data sharing calculation, that is, the new application paradigm of "data available but invisible" and "data not moving model moving". In this application, how to train the federated learning model based on the training sample provided by the demander A and the data in the local database of the data B is not the scope of the application for which protection is claimed, so the training process of the federated learning model is not described in detail here.

[0046] It should be noted that the federated learning model used in the present application is an XGBoost model encrypted by a homomorphic encryption algorithm (such as a paillier homomorphic encryption algorithm). Using the XGBoost model encrypted by the homomorphic encryption algorithm as the federated learning model can ensure the security of the local data of both the demand side A and the data side B. The principle is as follows:

[0047] If a logistic regression model using homomorphic encryption is used, the weights of the sample data features will be saved by the data side B. In the prediction stage, the data side B can obtain the prediction value of each sample according to the calculation result of each sample feature and weight in its local database, and then sort the prediction values to obtain the users with high scores. It can be inferred that the target customer portrait of the demand side A is leaked, causing the target customer information of the demand side to be leaked to the data side.

[0048] The XGBoost model can save only the tree structure and leaf node scores in the demand side A, and the data side B only saves the feature and feature split point value information required for splitting each non-leaf node of the tree. The overall tree model cannot be restored, and the prediction value of each training sample provided by the demand side A cannot be obtained in the prediction stage, so the target customer information of the demand side A will not be leaked to the data side B.

[0049] After the construction of the federated learning model is completed, the data side B calculates the similarity between each candidate sample in its local database and each training sample provided by the demand side for federated learning under the federated learning environment, and then sorts and filters the candidate samples in descending order of similarity to obtain M recommended samples. It should be noted that under the federated learning environment, the data side B cannot know the classification label corresponding to each training sample provided by the demand side A, i.e. it cannot determine which training sample is the real customer of the demand side A in the target field or the non-target field customer supplemented by the demand side A as a negative example sample, so it is ensured that the target customer group information of the demand side A will not be leaked to the data side B in the similarity calculation.

[0050] In the present embodiment, the cosine similarity calculation method is preferably used to calculate the similarity between each candidate sample in the local database of the data side B and each training sample provided by the demand side A. The cosine similarity calculation method is an existing similarity calculation method, and therefore the specific calculation process of the cosine similarity will not be described.

[0051] Finally, the data side B classifies and predicts the M recommended samples locally using the trained federated learning model, and recommends several recommended samples predicted as positive examples to the demand side as target samples.

[0052] Therefore, as shown in Figure 1 the target sample recommendation method based on the privacy protection of both sides of the present embodiment comprises the following steps:

[0053] S1, the data party performs federated learning according to the training sample id provided by the demand party, and obtains an XGBoost model encrypted by a homomorphic encryption algorithm (preferably a paillier homomorphic encryption algorithm) as a federated learning model. The method for encrypting the XGBoost model using the paillier homomorphic encryption algorithm is as shown in Figure 8 , and specifically comprises:

[0054] Step one: first, the label party generates a paillier public and private key, and saves it to the local. Before constructing each tree, the label party needs to calculate the first-order derivative and the second-order derivative value of each sample according to the local sample label true value and the current sample prediction value (the specific calculation method is described below), and encrypt it through the locally generated paillier public key. The specific encryption process is shown in Figure 7 . In this example, the label party is the demand party.

[0055] Step two: the label party sends the encrypted sample first-order derivative and second-order derivative to the participant. In the calculation of each tree node splitting information, the participant calculates the sum value of the first-order derivative and the second-order derivative ciphertext of the left and right child nodes generated after the current splitting point is split for each splittable point of each feature in the local, and sends the sum value ciphertext to the label party. In this example, the participant is the data party.

[0056] Step three: the label party obtains the first-order derivative and the second-order derivative ciphertext sum value corresponding to each splittable point of each feature sent by the participant, and decrypts it through the locally saved private key to obtain the corresponding plaintext. The subsequent process can be calculated directly through the plaintext.

[0057] The training method of the XGBoost model encrypted by the homomorphic encryption algorithm is described in detail in Figure 4 , and specifically comprises:

[0058] Step one: the demand party generates a paillier public and private key: public key (n, e), private key (λ, μ), and saves it to the local. The public key is used to encrypt the first-order derivative and the second-order derivative calculation results of the sample. The paillier public and private key generation steps are described in Figure 6 .

[0059] Step two: the demand party calculates the first-order derivative and the second-order derivative according to the sample prediction value and the sample true label in the current training round. Since the scene of the present application is binary classification, the loss function adopts cross-entropy loss. Assuming that the current prediction probability of each sample i is p i , the true label value is y i , the first-order derivative g i = p i -y i , and the second-order derivative h i = pi (1-p i ). Then, the demand side encrypts the first and second derivative values of each sample using the generated Paillier public key, and the encryption process is shown in Figure 7 If the current training round is the first tree, the prediction probability of each sample being a positive example can be initialized to 0.5, and the calculation is performed on this value. Finally, the demand side sends the encrypted first and second derivatives of the samples to the data side.

[0060] Step three: The data side maps the sample features according to the histogram bins it owns, i.e., according to the pre-set parameters: the number of histogram bins b, each feature is divided into b equal frequency bins, and the original feature value of each sample is mapped to the index number of the bin to which the feature belongs. The result of mapping the sample features to the bins is saved locally.

[0061] Step four: The data side generates the histogram of each feature of the current tree node according to the sample set in the node, then traverses each bin point on each feature histogram, and divides the samples in the current node into left and right child nodes according to the point, then calculates the encrypted first and second derivative sums of the samples in the left child node. Thus, each bin point of each feature can calculate a two-tuple of the first and second derivative sum values, the data side replaces the feature name and division node with a random index, saves the correspondence between the feature name and the index locally, and sends the index and the corresponding first and second derivative ciphertexts to the demand side.

[0062] Step five: The demand side receives the index and the first and second derivative sum ciphertexts sent by the data side, and decrypts them, the decryption process is shown in Figure 7 The demand side calculates the total first derivative G and the total second derivative H of the samples in the current node, traverses each received index and derivative two-tuple, and subtracts the left total first derivative G L and the left total second derivative H L of the corresponding two-tuple from the samples in the current node to obtain the total first derivative G R and the total second derivative H R of the right child node, and calculates the gain score corresponding to the index: where λ is a regular hyperparameter. The demand side traverses all the indexes, finds the index corresponding to the optimal score according to the score, and if the current tree level has not reached the maximum depth of the tree and the current optimal score is greater than a pre-set threshold, the demand side sends the index corresponding to the optimal score to the data side, and enters step six. If the current tree level reaches the maximum depth of the tree or the current optimal score is less than the pre-set threshold, the division of the child node is stopped, and step seven is entered.

[0063] Step six: the data party finds the corresponding feature name and split point in the index and feature name and split point corresponding information saved locally according to the received optimal partition index, and divides the samples in the current node into two child nodes according to the feature and split point, and saves the partition feature and split point required by the tree node to the local. Enter step four to calculate the next node.

[0064] Step seven: the demand party calculates the prediction value of the current leaf node according to the gradient sum of all samples on the current leaf node, and the calculation formula is: Where λ is a regular hyperparameter. The demand party saves the prediction value corresponding to the leaf node to the local.

[0065] Step eight: after the prediction values of all leaf nodes are calculated, the whole tree is constructed, and the demand party updates the prediction value of each sample according to the prediction value of the leaf node. The specific operation is: the prediction value of each sample on the current tree is the prediction value of the leaf node into which the sample falls, and after obtaining the prediction of each sample on the tree, the prediction value of the sample is updated by adding it to the existing prediction value of the sample. After the update is completed, enter step three to start the construction of the next tree from the root node.

[0066] When the training is completed, that is, the generated tree has reached the pre-set training round number n, the generated n trees are saved for use in the implementation of the prediction task. The model example after training can refer to Figure 10 .

[0067] S2, in the federated learning environment, the data party calculates the similarity between each candidate sample in its local database and each training sample provided by the demand party for federated learning, sorts and filters the candidate samples according to the similarity from high to low, and obtains M pieces of recommended samples;

[0068] S3, the data party classifies and predicts the M pieces of recommended samples using the federated learning model trained in step S1 locally, and recommends several pieces of recommended samples predicted as positive examples to the demand party as target samples. Specifically, the method for predicting target samples using the homomorphic encryption XGBoost model is described in Figure 5 , and the method is as follows:

[0069] Step one: initialize all sample prediction values according to the loss function. In this case, the loss function is the cross-entropy loss of binary classification, so the prediction probability of each sample predicted as a positive example can be set to 0.5, and on this basis, the first tree of the n trees saved after training is used to predict the prediction samples.

[0070] Step two: starting from the root node of the current tree, divide the prediction samples for each node. According to the division feature and division point information corresponding to the tree node saved by the data party, find the feature and division point of the current tree node, and divide the samples in the current node into two child nodes according to the feature and division point. Enter the left and right child nodes in turn, and further divide the samples in the left and right child nodes. For details of non-leaf node information, please refer to Figure 10 .

[0071] Step three: if the leaf node of the current tree model is entered, the demand party needs to find the prediction value corresponding to the current leaf node according to the prediction value information of the leaf node saved locally during training, and take the prediction value as the prediction value of the prediction sample in the current tree in the leaf node. For details of leaf node information, please refer to Figure 10 .

[0072] Step four: when all prediction samples in the current tree fall into the leaf node, the demand party adds the prediction value of the sample in the current tree to the prediction value corresponding to the sample, and performs prediction on the next tree. When all tree predictions are completed, the prediction value corresponding to each sample is taken as the prediction value of the sample under the current model.

[0073] The effectiveness of the target sample recommendation method based on data privacy protection of both parties provided by the application is tested and verified. The experimental data is IMDB movie review public data, and the experimental purpose is text similarity recommendation. The IMDB data set is 50,000 pieces of comment data in the Internet Movie Database (IMDB), and positive and negative comments each account for 50%. In this experiment, 26,000 pieces of data in the data set are extracted as test experiments, of which the demand party has 1,000 pieces of data, and the data party has 25,000 pieces of data. The demand party has 100 positive examples and 900 negative examples as a confusion sample set, and the data party B holds 25,000 pieces of data, of which 24,000 are negative examples and 1,000 are positive examples, which are used to simulate the sample imbalance phenomenon caused by the small proportion of positive examples in the real scene.

[0074] The verification method is as follows:

[0075] The 1,000 pieces of confusion sample set provided by the demand party are used to train the federated learning XGBoost model, and are saved. In the 25,000 pieces of B party database, 1,000 pieces of recommended samples with the highest similarity to the confusion sample set are calculated by using the cosine similarity, and it is verified that 66 of them are positive examples. After the 1,000 pieces of recommended samples are predicted by the trained XGBoost model, 167 pieces of predicted positive examples are obtained, of which 49 pieces are true positive examples, accounting for 74.2% of the 66 pieces of positive examples in the recommended samples and 29.3% of the predicted positive examples.

[0076] Comparative experiment:

[0077] Directly using 100 positive example data in the confusion sample set to calculate the similarity with 25000 data, using the same calculation method to select the 1000 samples with the highest similarity, of which 225 are real positive examples, accounting for 22.5% of the total selected samples.

[0078] The experimental results show that the privacy protection sample similarity calculation strategy proposed in the application can achieve the same accuracy as the calculation of plaintext data on the premise of protecting the data from being leaked.

[0079] It should be noted that the above specific embodiments are only the preferred embodiments of the present application and the technical principles applied. Those skilled in the art should understand that various modifications, equivalent replacements, changes, etc. can also be made to the present application. However, as long as these changes do not deviate from the spirit of the present application, they should be within the protection scope of the present application. In addition, some terms used in the specification and claims of the present application are not limited, but only for convenience of description.

Claims

1. A target sample recommendation method based on mutual data privacy protection, characterized by the following steps: include: S1, the data provider performs federated learning based on the training sample IDs provided by the demander, and obtains the XGBoost model encrypted by the homomorphic encryption algorithm as the federated learning model. S2, In the federated learning environment, the data provider calculates the similarity between each candidate sample in its local database and each training sample provided by the requester for federated learning, and sorts and filters the candidate samples according to the similarity from high to low to obtain M proposed recommendation samples. S3, the data provider uses the federated learning model trained in step S1 to classify and predict the M proposed recommendation samples locally, and recommends several of the proposed recommendation samples that are predicted to be positive as target samples to the demand provider. The training samples provided by the demand side for federated learning include data samples of the customer group in the target domain as positive examples and data samples of the customer group in the non-target domain as negative examples. The method for predicting target samples using the homomorphic encryption XGBoost model is as follows: Step 1: Initialize the predicted values ​​of all samples according to the loss function. The loss function is the cross-entropy loss for binary classification. The prediction probability of each sample being predicted as a positive example can be set to 0.

5. Based on this, the prediction of the samples is started from the first tree of the saved trained n trees. Step 2: Starting from the root node, divide the current tree into prediction samples for each node. Based on the division features and division point information of the tree nodes stored by the data provider, find the features and division points of the current tree node. Divide the samples in the current node into the left and right child nodes according to the features and division points. Then, go into the left and right child nodes in turn and further divide the samples in the left and right child nodes. Step 3: If you enter a leaf node of the current tree model, the client needs to find the prediction value corresponding to the current leaf node based on the prediction value information of the leaf node saved locally during training, and use the prediction value as the prediction value of the prediction sample in the leaf node on the current tree. Step 4: After all predicted samples on this tree have fallen into leaf nodes, the requester adds the predicted value of the sample on the current tree to the predicted value of the sample, and then performs the prediction for the next tree. When all tree predictions are completed, the predicted value of each sample is used as the predicted value of that sample under the current model.

2. The target sample recommendation method based on the protection of data privacy of both parties as described in claim 1, characterized in that, The homomorphic encryption algorithm mentioned in step S1 includes the Paillier homomorphic encryption algorithm.

3. The target sample recommendation method based on the protection of data privacy of both parties as described in claim 1, characterized in that, In step S2, cosine similarity is used to calculate the similarity between each candidate sample and each training sample.

4. The target sample recommendation method based on the protection of data privacy of both parties as described in claim 2, characterized in that, Step S1, the method for encrypting the XGBoost model using the Paillier homomorphic encryption algorithm, includes the following steps: S11, the demand side generates Paillier public and private keys and saves them locally. Before each tree is built, the demand side calculates the specific values ​​of the first and second derivatives of each sample based on the local sample label real value and the current sample prediction value, and encrypts them using the locally generated Paillier public key. S12: The requesting party sends the encrypted first and second derivatives of the sample to the data party. In the calculation of the splitting information of each tree node, the data party calculates the sum of the first and second derivative ciphertexts of the left and right child node samples generated after the splitting of each feature in the local area for each splittable point, and sends the summed ciphertext to the requesting party. S13: The requesting party decrypts the summation ciphertext using a locally stored private key to obtain the corresponding plaintext.

Citation Information

Patent Citations

  • Urban traffic travel data analysis method based on federated learning

    CN112163979A

  • Credit business recommendation method based on federal learning

    CN114782176A