A privacy computing method, device, equipment and storage medium

By directly performing privacy computing federated learning feature engineering Pearson correlation coefficient matrix process between two data nodes, using homomorphic encryption algorithm and ciphertext matrix multiplication library, the problem of data leakage and security in privacy computing is solved and efficiency is improved. and security.

CN118278035BActive Publication Date: 2024-10-08CETC CYBERSPACE SECURITY TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410713174.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-10-08
Estimated Expiration
2044-06-04

AI Technical Summary

Technical Problem

Existing private computing federated learning has privacy and security risks of data leakage in feature engineering, and commonly used encryption methods cannot guarantee data security for result inversion.

Method used

The privacy computing federated learning feature engineering Pearson correlation coefficient matrix process is directly completed between the two data nodes. The homomorphic encryption algorithm is used to generate the public key and private key, perform matrix multiplication, and use the homomorphism of the ciphertext matrix and the plaintext matrix. The encryption library performs intermediate operations to avoid third-party intermediate node assistance, reduce communication overhead, and improve computing efficiency.

Benefits of technology

It solves the problem of privacy data leakage, improves security and efficiency, avoids the risk of privacy leakage due to reverse inference of results, and ensures data security in privacy computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118278035B_ABST
    Figure CN118278035B_ABST
Patent Text Reader

Abstract

The present application discloses a privacy computing method, device, equipment and storage medium, which relates to the field of privacy computing technology and is applied to a first data node, where both the first and second data nodes are nodes under a privacy intersection service, including: obtaining the second spatial information sent by the second node, and determining the minimum spatial information based on its own first spatial information; if the first spatial information is the minimum, generating a first private key and a first public key, using the first public key to homomorphically encrypt the first feature attribute matrix, and sending the obtained first ciphertext matrix and the first public key to the second node, so as to operate the Pearson coefficient matrix and the first ciphertext matrix of the second feature attribute matrix based on the first public key, and returning the operation result and the second coefficient matrix; using the first private key to decrypt the operation result, and splicing the decrypted matrix, the first coefficient matrix and the second coefficient matrix to obtain a global Pearson correlation coefficient matrix. In this way, the two nodes complete the privacy computing and improve the security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of privacy computing technology, and in particular to a privacy computing method, device, equipment and storage medium. Background Art

[0002] Privacy computing is a technology and system for joint computing by two or more parties. The parties collaborate to conduct joint machine learning and joint analysis without exposing the original data. The currently commonly used privacy computing federated learning uses the feature data of two parties to calculate the Pearson correlation coefficient in plain text in feature engineering, which may cause the exposure of text content and sensitive data, and there are security risks of privacy leakage. Security and compliance cannot be guaranteed; and the commonly used method also uses secret sharing + OT (Oblivious Transfer) encryption to perform joint feature engineering Pearson correlation coefficient. Although the security of the calculation process of the Pearson correlation coefficient is guaranteed by the mpc (Secure Multi-party Computation) security protocol algorithm of secret sharing + OT to ensure data security, it cannot guarantee the data security and privacy leakage problem of the reverse result.

[0003] It can be seen that how to improve the data security and efficiency of the privacy computing process is a problem to be solved in this field. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a privacy computing method, device, equipment and storage medium, which can directly complete the privacy computing federated learning feature engineering Pearson correlation coefficient matrix process in two data nodes without involving the assistance of a third-party intermediate node, solve the problem of privacy data leakage, and improve security and efficiency. The specific scheme is as follows:

[0005] In a first aspect, the present application provides a privacy computing method, which is applied to a first data node, where the first data node and the second data node are both data nodes under a privacy intersection service, including:

[0006] Acquire second spatial information representing the spatial size of a second characteristic attribute matrix of the second data node's own data set sent by the second data node, and determine the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of the first characteristic attribute matrix of the first data node's own data set;

[0007] If the target spatial information is the first spatial information, a corresponding first private key and a first public key are generated based on a homomorphic encryption algorithm, and the first feature attribute matrix is ​​homomorphically encrypted using the first public key to obtain a first ciphertext matrix;

[0008] Sending the first ciphertext matrix and the first public key to the second data node, so that the second data node performs a matrix multiplication operation on the second feature attribute matrix and the first ciphertext matrix based on the first public key, and sending the corresponding operation results and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node;

[0009] The calculation result is decrypted using the first private key, and the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix, and the Pearson correlation coefficient matrix of the second feature attribute matrix are concatenated to obtain a global Pearson correlation coefficient matrix to complete this privacy calculation process.

[0010] Optionally, the method further includes:

[0011] The first spatial information is sent to the second data node, so that the second data node determines the minimum target spatial information from the second spatial information and the first spatial information.

[0012] Optionally, sending the first spatial information to the second data node includes:

[0013] Standardize the data in its own data set based on the preset data standardization processing rules, and normalize the obtained data to generate a first feature attribute matrix;

[0014] The spatial size of the first feature attribute matrix is ​​calculated to obtain first spatial information, and the first spatial information is sent to the second data node.

[0015] Optionally, after determining the minimum target spatial information from the second spatial information and the first spatial information, the method further includes:

[0016] If the target spatial information is the second spatial information, the second ciphertext matrix and the corresponding second public key sent by the second data node are obtained, so as to perform matrix multiplication operations on the Pearson correlation coefficient matrix corresponding to the first feature attribute matrix and the second ciphertext matrix based on the second public key; wherein the second data node generates the corresponding second private key and the second public key based on the homomorphic encryption algorithm, and uses the second public key to homomorphically encrypt the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain the second ciphertext matrix.

[0017] Optionally, the generating a corresponding first private key and a first public key based on a homomorphic encryption algorithm, and using the first public key to homomorphically encrypt the first feature attribute matrix to obtain a first ciphertext matrix includes:

[0018] Initialize the homomorphic encryption library object to generate the corresponding first private key and first public key;

[0019] The first feature attribute matrix is ​​transposed, and the transposed matrix is ​​homomorphically encrypted using the first public key to obtain a first ciphertext matrix.

[0020] In a second aspect, the present application provides a privacy computing method, which is applied to a second data node, where the second data node and the first data node are both data nodes under a privacy intersection service, including:

[0021] Sending second spatial information representing the spatial size of a second characteristic attribute matrix of its own data set to the first data node, so that the first data node acquires the second spatial information and determines the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of the first characteristic attribute matrix of the first data node's own data set;

[0022] If the target spatial information is the first spatial information, obtaining a first ciphertext matrix and a first public key sent by the first data node; wherein the first data node generates a corresponding first private key and the first public key based on a homomorphic encryption algorithm, and uses the first public key to homomorphically encrypt the first feature attribute matrix to obtain a first ciphertext matrix;

[0023] Based on the first public key, matrix multiplication operation is performed on the second feature attribute matrix and the first ciphertext matrix, and the corresponding operation result and the Pearson correlation coefficient matrix of the second feature attribute matrix are sent to the first data node, so that the first data node uses the first private key to decrypt the operation result, and concatenates the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix, and the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix to complete this privacy calculation process.

[0024] In a third aspect, the present application provides a privacy computing device, applied to a first data node, where the first data node and the second data node are both data nodes under a privacy intersection service, including:

[0025] A first spatial information determination module is used to obtain second spatial information of the spatial size of a second characteristic attribute matrix of the second data node, which is sent by the second data node, and determine the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of the first characteristic attribute matrix of the first data node's own data set;

[0026] a homomorphic encryption module, configured to generate a corresponding first private key and a first public key based on a homomorphic encryption algorithm when the target spatial information is the first spatial information, and to perform homomorphic encryption on the first feature attribute matrix using the first public key to obtain a first ciphertext matrix;

[0027] a ciphertext sending module, configured to send the first ciphertext matrix and the first public key to the second data node, so that the second data node performs a matrix multiplication operation on the second feature attribute matrix and the first ciphertext matrix based on the first public key, and sends the corresponding operation results and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node;

[0028] A decryption module is used to decrypt the operation result using the first private key, and to concatenate the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix, and the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix to complete this privacy calculation process.

[0029] In a fourth aspect, the present application provides a privacy computing device, applied to a second data node, where the second data node and the first data node are both data nodes under a privacy intersection service, including:

[0030] A second spatial information determination module is used to send second spatial information representing the spatial size of a second characteristic attribute matrix of its own data set to a first data node, so that the first data node obtains the second spatial information and determines the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of a first characteristic attribute matrix of the first data node's own data set;

[0031] A first ciphertext acquisition module, configured to acquire a first ciphertext matrix and a first public key sent by the first data node when the target spatial information is the first spatial information; wherein the first data node generates a corresponding first private key and the first public key based on a homomorphic encryption algorithm, and uses the first public key to homomorphically encrypt the first feature attribute matrix to obtain a first ciphertext matrix;

[0032] A matrix sending module is used to perform matrix multiplication on the second feature attribute matrix and the first ciphertext matrix based on the first public key, and send the corresponding operation results and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node, so that the first data node uses the first private key to decrypt the operation results, and concatenate the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix, and the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix to complete this privacy calculation process.

[0033] In a fifth aspect, the present application provides an electronic device, including:

[0034] Memory, used to store computer programs;

[0035] A processor is used to execute the computer program to implement the privacy computing method as described above.

[0036] In a sixth aspect, the present application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the privacy computing method as described above.

[0037] It can be seen that the first data node and the second data node in the present application are both data nodes under the privacy intersection service, wherein the first data node can obtain the second spatial information of the spatial size of the second characteristic attribute matrix of its own data set sent by the second data node, and determine the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of the first characteristic attribute matrix of the first data node's own data set; if the target spatial information is the first spatial information, a corresponding first private key and a first public key are generated based on the homomorphic encryption algorithm, and the first characteristic attribute matrix is ​​homomorphically encrypted using the first public key to obtain a first ciphertext matrix; then the first ciphertext matrix and the first public key are sent to the second data node, so that the second data node performs matrix multiplication on the second characteristic attribute matrix and the first ciphertext matrix based on the first public key, and sends the corresponding operation results and the Pearson correlation coefficient matrix of the second characteristic attribute matrix to the first data node; then the operation results are decrypted using the first private key, and the decrypted matrix, the Pearson correlation coefficient matrix of the first characteristic attribute matrix and the Pearson correlation coefficient matrix of the second characteristic attribute matrix are concatenated to obtain a global Pearson correlation coefficient matrix to complete this privacy calculation process. In this way, the present application can directly complete the privacy computing federated learning feature engineering Pearson correlation coefficient matrix process in two data nodes without involving the assistance of a third-party intermediate node, thereby solving the problem of privacy data leakage and improving security and efficiency; and in the present application, the party with a smaller data space generates a public key and a private key, and sends the relevant data to the other party, which can minimize communication overhead and improve communication efficiency; further, the present application uses a homomorphic encryption library that can support matrix multiplication of ciphertext matrices and plaintext matrices to perform intermediate matrix operations, thereby improving computational efficiency, and being unable to infer from the results, thereby avoiding the risk of privacy leakage due to inference of the results and ensuring data security in privacy computing. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 A flow chart of a privacy computing method disclosed in this application;

[0040] Figure 2 A flowchart of a specific privacy computing method disclosed in this application;

[0041] Figure 3 A flowchart of another specific privacy computing method disclosed in this application;

[0042] Figure 4 A flowchart of another specific privacy computing method disclosed in this application;

[0043] Figure 5 This is a schematic diagram of the structure of a privacy computing device disclosed in this application;

[0044] Figure 6 This is a schematic diagram of the structure of another privacy computing device disclosed in this application;

[0045] Figure 7 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] See also Figure 1 As shown, an embodiment of the present invention discloses a privacy computing method, which is applied to a first data node, where the first data node and the second data node are both data nodes under a privacy intersection service, including:

[0048] Step S11, obtaining the second spatial information of the spatial size of the second characteristic attribute matrix of the second data node, which represents its own data set, and determining the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of the first characteristic attribute matrix of the first data node's own data set.

[0049] In this embodiment, the first data node and the second data node first perform privacy intersection, and both data nodes process their own data sets to obtain spatial information of the corresponding feature attribute matrix space size that characterizes their own data sets. Among them, the first data node can obtain the second spatial information sent by the second data node, and then determine the smallest target spatial information from its own first spatial information and the acquired second spatial information. In another specific embodiment, it can also include: sending the first spatial information to the second data node so that the second data node determines the smallest target spatial information from the second spatial information and the first spatial information. Specifically, the first data node and the second data node can both send their own spatial information to each other, that is, the first data node can send its own first spatial information to the second data node; in this way, the second data node determines the smallest target spatial information from its own second spatial information and the first spatial information.

[0050] In a specific embodiment, sending the first spatial information to the second data node may include: standardizing the data in its own data set based on preset data standardization processing rules, and normalizing the obtained data to generate a first feature attribute matrix; calculating the spatial size of the first feature attribute matrix to obtain the first spatial information, and sending the first spatial information to the second data node. Specifically, under the privacy intersection service, the first data node can standardize and normalize the data in its own data set to obtain the corresponding first feature attribute matrix. Then, the spatial size of the first feature attribute matrix can be calculated to obtain the first spatial information; accordingly, the first spatial information can be sent to the second data node. In a specific embodiment, the first feature attribute matrix is ​​obtained as follows:

[0051]

[0052] in, The superscript m represents that the data set in the data node has m feature attributes, and the subscript n represents that each feature attribute value of the data set has n. At the same time, the mean , standard deviation .

[0053] Correspondingly, the other data node standardizes and normalizes the data Y after its local sample alignment to generate the matrix of Y:

[0054]

[0055] in, The superscript k represents that the data set of the current data node has k characteristic attributes, and the subscript n represents that each characteristic attribute value of the data set has n. At the same time, the mean , standard deviation .

[0056] Step S12: If the target spatial information is the first spatial information, a corresponding first private key and a first public key are generated based on a homomorphic encryption algorithm, and the first feature attribute matrix is ​​homomorphically encrypted using the first public key to obtain a first ciphertext matrix.

[0057] In this embodiment, if the minimum spatial information is determined to be the first spatial information of the first data node, the first data node can initialize the homomorphic encryption algorithm to obtain the corresponding first private key and first public key; then, the first data node can use the first public key to homomorphically encrypt the Pearson correlation coefficient matrix corresponding to the first feature attribute matrix to obtain the corresponding first ciphertext matrix.

[0058] It should be noted that, in a specific embodiment, after determining the minimum target spatial information from the second spatial information and the first spatial information, it may also include: if the target spatial information is the second spatial information, obtaining the second ciphertext matrix and the corresponding second public key sent by the second data node, so as to perform matrix multiplication operation on the Pearson correlation coefficient matrix corresponding to the first feature attribute matrix and the second ciphertext matrix based on the second public key; wherein the second data node generates the corresponding second private key and the second public key based on the homomorphic encryption algorithm, and uses the second public key to homomorphically encrypt the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain the second ciphertext matrix. Specifically, when the first spatial information of the first data node is greater than the second spatial information of the second data node, the second data node generates the second private key and the second public key, and then sends the second ciphertext matrix obtained by homomorphically encrypting the Pearson correlation coefficient matrix of the second feature attribute matrix based on the second public key to the first data node. Correspondingly, the first data node can perform matrix multiplication operation on the Pearson correlation coefficient matrix corresponding to its first feature attribute matrix and the second ciphertext matrix obtained from the second data node based on the second public key.

[0059] It can be understood that the data nodes of both parties calculate the spatial size of the feature attribute matrix after standardizing and normalizing their own data sets, and compare the data spatial size. Both parties can send or receive spatial information and compare the size; finally, the party with the smaller data space initializes the homomorphic encryption library that supports encrypted matrix operations, such as the ckks (an approximate computing homomorphic encryption algorithm) library.

[0060] In a specific embodiment, the generation of the corresponding first private key and the first public key based on the homomorphic encryption algorithm, and the use of the first public key to homomorphically encrypt the first characteristic attribute matrix to obtain the first ciphertext matrix may include: initializing the homomorphic encryption library object to generate the corresponding first private key and the first public key; transposing the first characteristic attribute matrix to homomorphically encrypt the transposed matrix using the first public key to obtain the first ciphertext matrix. Specifically, the first data node with a smaller data space can initialize the ckks homomorphic encryption library object to generate a public key and a private key; then transpose the first characteristic attribute matrix (interchange rows and columns), and then use ckks to encrypt the transposed matrix data, and send the encrypted first ciphertext matrix to the second data node with a larger data space to ensure minimum communication overhead. In a specific embodiment, the transposed matrix can be as follows:

[0061]

[0062] The transposed matrix is ​​then homomorphically encrypted to obtain the encrypted first ciphertext matrix.

[0063] Step S13: Send the first ciphertext matrix and the first public key to the second data node, so that the second data node performs matrix multiplication on the second feature attribute matrix and the first ciphertext matrix based on the first public key, and sends the corresponding operation results and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node.

[0064] Furthermore, the first data node can send the encrypted first ciphertext matrix and the corresponding first public key to the second data node; thereafter, the second data node can initialize a private key-free homomorphic encryption object based on the first public key to perform matrix multiplication on the first ciphertext matrix and the second feature attribute matrix to obtain the corresponding operation result; the second data node then sends the operation result and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node.

[0065] In a specific embodiment, a data node with a large data space receives a public key and uses the received public key to initialize a ckks homomorphic encryption object without a private key, which is only used for encryption matrix operations and cannot decrypt the encryption matrix of the ciphertext; after the data node with a large data space obtains the corresponding ciphertext matrix, it uses the characteristic attribute matrix of the plaintext of the local data set to perform matrix multiplication with the obtained ciphertext matrix to obtain the operation result, and sends the operation result to the data node with a small data space. In a specific embodiment, the node with a large data space obtains the ciphertext matrix sent by the other data node. And the corresponding public key, and based on the public key, the local feature attribute matrix Y and Do matrix multiplication, that is , @ represents matrix multiplication, that is Find the dot product of each row of and each column of Y, that is , and finally the matrix multiplication result is an n*n size matrix of the ciphertext, that is The matrix is:

[0066]

[0067] in, Where r represents the Pearson correlation coefficient of the two feature attributes, and the subscript xnyn represents the nth feature of the x data and the nth feature of the y data. After that, the current data node can And the Pearson correlation coefficient matrix of its own feature attribute matrix is ​​sent to another data node.

[0068] Step S14: Use the first private key to decrypt the calculation result, and concatenate the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix, and the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix to complete this privacy calculation process.

[0069] In this embodiment, the first data node can receive the operation result sent by the second data node, and the operation result is obtained by the second data node multiplying its own second feature attribute matrix and the first ciphertext matrix; the first data node can use the local private key to decrypt the operation result to obtain the decrypted matrix. Furthermore, the first data node can concatenate the Pearson correlation coefficient matrix of the decrypted matrix, the first feature attribute matrix, and the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix; that is, the operation process of the Pearson correlation coefficient of the privacy computing federated learning feature engineering is completed. In a specific embodiment, one data node obtains the ciphertext sent by the other party. And plain text , then decrypt using the ckks object After decryption , after decryption using , Plain text and plain text Generate a global Pearson correlation coefficient matrix r; wherein the global Pearson correlation coefficient matrix r can be shown as follows:

[0070]

[0071] It can be seen that the present application can directly complete the privacy computing federated learning feature engineering Pearson correlation coefficient matrix process in two data nodes without involving the assistance of a third-party intermediate node, thereby solving the problem of privacy data leakage and improving security and efficiency; and in the present application, the party with a smaller data space generates a public key and a private key, and sends the relevant data to the other party, which can minimize communication overhead and improve communication efficiency; further, the present application uses a homomorphic encryption library that can support matrix multiplication of ciphertext matrices and plaintext matrices to perform intermediate matrix operations, thereby improving computational efficiency, and being unable to infer from the results, thereby avoiding the risk of privacy leakage due to inference of the results and ensuring data security in privacy computing.

[0072] like Figure 2 As shown, the embodiment of the present application discloses a privacy computing method, which is applied to a second data node, where the second data node and the first data node are both data nodes under a privacy intersection service, including:

[0073] Step S21, sending second spatial information representing the spatial size of the second characteristic attribute matrix of its own data set to the first data node, so that the first data node obtains the second spatial information and determines the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of the first characteristic attribute matrix of the first data node's own data set.

[0074] In this embodiment, the second data node and the first data node can both send their own spatial information to the corresponding node and determine the target spatial information with the smallest representation space. In a specific embodiment, the data owner privacy computing node guest and the data owner privacy computing node host, both parties through the following Figure 3 The privacy calculation process shown includes six core processes: Private Set Intersection (PSI, a prerequisite for federated learning), data normalization, calculation of data size, initialization of the homomorphic encryption library ckks, Pearson correlation coefficient calculation, and generation of the Pearson correlation coefficient matrix. It can complete the Pearson correlation coefficient calculation for safe, compliant, and efficient federated learning feature engineering. Through the calculation of the Pearson correlation coefficient of federated learning feature engineering, important and excellent features can be efficiently and stably screened out to support machine learning algorithms such as logistic regression, xgboost (eXtreme Gradient Boosting), and neural networks in federated learning. It should be pointed out that the Pearson correlation coefficient can be used to explore the strength of the linear correlation between two variables X and Y. The Pearson correlation coefficient between two variables is defined as the covariance of the two variables divided by the product of their standard deviations:

[0075] ;

[0076] in, , It represents the standard deviation. The standard deviation of sample features in a data set is usually represented by the Greek symbol express:

[0077] , ;

[0078] The Pearson correlation coefficient of samples (features) in a data set is usually represented by the lowercase letter r:

[0079] ;

[0080] In the above formula: X i , Y i is a single element of the x and y feature attribute columns; , is the mathematical mean of the feature attribute columns x and y; n is the number of elements in the feature attribute column; the numerator corresponds to the covariance; the denominator corresponds to the individual standard deviations of x and y. And, the coefficient is between -1 and 1. r>0 corresponds to a positive correlation between the two, and vice versa, a negative correlation; the larger |r| is, the greater the degree of correlation is.

[0081] ;

[0082] Standardize the data set so that the mean of all features is 0 and the variance is 1, and the calculation can be simplified to:

[0083] ;

[0084] Step S22: If the target spatial information is the first spatial information, obtain the first ciphertext matrix and the first public key sent by the first data node; wherein the first data node generates a corresponding first private key and the first public key based on a homomorphic encryption algorithm, and uses the first public key to homomorphically encrypt the first feature attribute matrix to obtain a first ciphertext matrix.

[0085] In this embodiment, if the first data node generates a first private key and a first public key, and uses the public key to homomorphically encrypt the first feature attribute matrix to obtain a first ciphertext matrix; then the second data node can wait to receive the first ciphertext matrix and the corresponding first public key sent by the first data node.

[0086] Step S23: perform matrix multiplication on the second feature attribute matrix and the first ciphertext matrix based on the first public key, and send the corresponding operation results and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node, so that the first data node decrypts the operation results using the first private key, and concatenates the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix, and the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix to complete this privacy calculation process.

[0087] Furthermore, the second data node can use the received first public key to perform matrix multiplication on the local plaintext second characteristic attribute matrix and the received first ciphertext matrix, and send the obtained operation result and the Pearson correlation coefficient matrix of the second characteristic attribute matrix to the first data node. In this way, the first data node can use the local first private key to decrypt the operation result, and use the decrypted matrix, the first characteristic attribute matrix, and the Pearson correlation coefficient matrix corresponding to the second characteristic attribute matrix to obtain the global Pearson correlation coefficient matrix.

[0088] In a specific embodiment, Figure 4 As shown, the two nodes perform privacy intersection, and each standardizes and normalizes the local data set, and calculates the spatial size of the processed feature attribute matrix to compare the data space size; further, the node with a smaller data space can initialize the homomorphic encryption ckks library that supports encryption matrix operations, and homomorphically encrypt the local feature attribute matrix, and send the encrypted ciphertext matrix to another node, so that the other node can use its own feature attribute matrix and the ciphertext matrix to perform encryption matrix operations; thereafter, the node with a smaller data space can receive the encrypted matrix operation results sent by the other node, and decrypt them to combine the Pearson correlation coefficient matrices corresponding to the feature attribute matrices of both nodes to generate a global Pearson correlation coefficient matrix. It should be pointed out that the Pearson correlation coefficient matrix of the first feature attribute matrix calculated by the first data node locally can be , the matrix can be shown as follows:

[0089]

[0090] Correspondingly, the Pearson correlation coefficient matrix of the second feature attribute matrix calculated by the second data node locally can be ; The matrix can be shown as follows:

[0091]

[0092] In this way, a single data node can send the calculation result and the Pearson correlation coefficient matrix corresponding to its own feature attribute matrix to another corresponding data node to generate a global Pearson correlation coefficient matrix.

[0093] It can be seen that this application calculates the Pearson correlation coefficient of the federated learning feature engineering through two parties, and uses a homomorphic encryption library that can support matrix multiplication of ciphertext matrices and plaintext matrices to perform intermediate matrix operations, which improves the operation efficiency and cannot be reversed from the results, avoiding the risk of privacy leakage from the reverse result, and ensuring data security in privacy computing. The data security of the reverse result can be guaranteed, taking into account the security, compliance, and efficiency of the entire process of the federated learning feature engineering Pearson correlation coefficient calculation and the results.

[0094] like Figure 5 As shown, the embodiment of the present application discloses a privacy computing device, which is applied to a first data node, where the first data node and the second data node are both data nodes under a privacy intersection service, including:

[0095] The first spatial information determination module 11 is used to obtain the second spatial information of the spatial size of the second characteristic attribute matrix of the second data node, which is sent by the second data node, and determine the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of the first characteristic attribute matrix of the first data node's own data set;

[0096] A homomorphic encryption module 12, configured to generate a corresponding first private key and a first public key based on a homomorphic encryption algorithm when the target spatial information is the first spatial information, and perform homomorphic encryption on the first feature attribute matrix using the first public key to obtain a first ciphertext matrix;

[0097] The ciphertext sending module 13 is used to send the first ciphertext matrix and the first public key to the second data node, so that the second data node performs a matrix multiplication operation on the second feature attribute matrix and the first ciphertext matrix based on the first public key, and sends the corresponding operation results and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node;

[0098] The decryption module 14 is used to decrypt the operation result using the first private key, and concatenate the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix, and the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix to complete this privacy calculation process.

[0099] It can be seen that the present application can directly complete the privacy computing federated learning feature engineering Pearson correlation coefficient matrix process in two data nodes without involving the assistance of a third-party intermediate node, thereby solving the problem of privacy data leakage and improving security and efficiency; and in the present application, the party with a smaller data space generates a public key and a private key, and sends the relevant data to the other party, which can minimize communication overhead and improve communication efficiency; further, the present application uses a homomorphic encryption library that can support matrix multiplication of ciphertext matrices and plaintext matrices to perform intermediate matrix operations, thereby improving computational efficiency, and being unable to infer from the results, thereby avoiding the risk of privacy leakage due to inference of the results and ensuring data security in privacy computing.

[0100] In a specific embodiment, the device may further include:

[0101] The spatial information sending module is used to send the first spatial information to the second data node, so that the second data node determines the minimum target spatial information from the second spatial information and the first spatial information.

[0102] In another specific embodiment, the spatial information sending module may include:

[0103] A data processing unit, used to perform standardization processing on the data in its own data set based on a preset data standardization processing rule, and perform normalization processing on the obtained data to generate a first feature attribute matrix;

[0104] The spatial information sending unit is used to calculate the spatial size of the first feature attribute matrix, obtain first spatial information, and send the first spatial information to the second data node.

[0105] In a specific embodiment, the device may further include:

[0106] A second ciphertext acquisition module is used to obtain a second ciphertext matrix and a corresponding second public key sent by a second data node when the target spatial information is the second spatial information, so as to perform matrix multiplication operations on the Pearson correlation coefficient matrix corresponding to the first feature attribute matrix and the second ciphertext matrix based on the second public key; wherein the second data node generates a corresponding second private key and the second public key based on a homomorphic encryption algorithm, and uses the second public key to homomorphically encrypt the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a second ciphertext matrix.

[0107] In a specific embodiment, the homomorphic encryption module 12 may include:

[0108] A key generation unit, used to initialize a homomorphic encryption library object to generate a corresponding first private key and a first public key;

[0109] The homomorphic encryption unit is used to transpose the first feature attribute matrix so as to homomorphically encrypt the transposed matrix using the first public key to obtain a first ciphertext matrix.

[0110] like Figure 6 As shown, the embodiment of the present application discloses a privacy computing device, which is applied to a second data node, where the second data node and the first data node are both data nodes under a privacy intersection service, including:

[0111] The second spatial information determination module 21 is used to send the second spatial information representing the spatial size of the second characteristic attribute matrix of its own data set to the first data node, so that the first data node obtains the second spatial information and determines the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of the first characteristic attribute matrix of the first data node's own data set;

[0112] A first ciphertext acquisition module 22 is used to acquire a first ciphertext matrix and a first public key sent by the first data node when the target spatial information is the first spatial information; wherein the first data node generates a corresponding first private key and the first public key based on a homomorphic encryption algorithm, and uses the first public key to homomorphically encrypt the first feature attribute matrix to obtain a first ciphertext matrix;

[0113] The matrix sending module 23 is used to perform matrix multiplication on the second feature attribute matrix and the first ciphertext matrix based on the first public key, and send the corresponding operation results and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node, so that the first data node uses the first private key to decrypt the operation results, and concatenate the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix and the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix to complete this privacy calculation process.

[0114] It can be seen that in this application, the party with a smaller data space generates the public key and the private key, and sends the relevant data to the other party, which can minimize the communication overhead and improve the communication efficiency; further, in this application, a homomorphic encryption library that can support matrix multiplication of ciphertext matrices and plaintext matrices is used to perform intermediate matrix operations, which improves the calculation efficiency, and it is impossible to reverse the result, avoiding the risk of privacy leakage due to reverse result, and ensuring data security in privacy computing.

[0115] Furthermore, the present application also discloses an electronic device. Figure 7This is a structural diagram of an electronic device 30 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0116] Figure 7 A schematic diagram of the structure of an electronic device 30 provided in an embodiment of the present application. The electronic device 30 may specifically include: at least one processor 31, at least one memory 32, a power supply 33, a communication interface 34, an input / output interface 35, and a communication bus 36. The memory 32 is used to store a computer program, which is loaded and executed by the processor 31 to implement the relevant steps in the privacy computing method disclosed in any of the aforementioned embodiments. In addition, the electronic device 30 in this embodiment may specifically be an electronic computer.

[0117] In this embodiment, the power supply 33 is used to provide working voltage for each hardware device on the electronic device 30; the communication interface 34 can create a data transmission channel between the electronic device 30 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 35 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0118] In addition, the memory 32, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 321, a computer program 322, etc., and the storage method can be temporary storage or permanent storage.

[0119] The operating system 321 is used to manage and control the hardware devices and computer programs 322 on the electronic device 30, which can be Windows Server, Netware, Unix, Linux, etc. In addition to computer programs that can be used to complete the privacy computing method performed by the electronic device 30 disclosed in any of the aforementioned embodiments, the computer program 322 can further include computer programs that can be used to complete other specific tasks.

[0120] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned privacy computing method is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.

[0121] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0122] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0123] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0124] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0125] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A privacy computing method, characterized in that: Applied to a first data node, the first data node and the second data node are both data nodes under a privacy intersection service, including: Acquire second spatial information representing the spatial size of a second characteristic attribute matrix of the second data node's own data set sent by the second data node, and determine the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of the first characteristic attribute matrix of the first data node's own data set; If the target spatial information is the first spatial information, a corresponding first private key and a first public key are generated based on a homomorphic encryption algorithm, and the first feature attribute matrix is ​​homomorphically encrypted using the first public key to obtain a first ciphertext matrix; Sending the first ciphertext matrix and the first public key to the second data node, so that the second data node performs a matrix multiplication operation on the second feature attribute matrix and the first ciphertext matrix based on the first public key, and sending the corresponding operation results and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node; Decrypt the operation result using the first private key, and concatenate the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix, and the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix, so as to complete this privacy calculation process; Wherein, the method further comprises: sending the first spatial information to the second data node so that the second data node determines minimum target spatial information from the second spatial information and the first spatial information; After determining the minimum target spatial information from the second spatial information and the first spatial information, the method further includes: If the target spatial information is the second spatial information, the second ciphertext matrix and the corresponding second public key sent by the second data node are obtained, so as to perform matrix multiplication operations on the Pearson correlation coefficient matrix corresponding to the first feature attribute matrix and the second ciphertext matrix based on the second public key; wherein the second data node generates the corresponding second private key and the second public key based on the homomorphic encryption algorithm, and uses the second public key to homomorphically encrypt the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain the second ciphertext matrix.

2. The privacy computing method according to claim 1, characterized in that: The sending the first spatial information to the second data node includes: Standardize the data in its own data set based on the preset data standardization processing rules, and normalize the obtained data to generate a first feature attribute matrix; The spatial size of the first feature attribute matrix is ​​calculated to obtain first spatial information, and the first spatial information is sent to the second data node.

3. The privacy computing method according to claim 1, characterized in that: The method of generating a corresponding first private key and a first public key based on a homomorphic encryption algorithm, and using the first public key to homomorphically encrypt the first feature attribute matrix to obtain a first ciphertext matrix includes: Initialize the homomorphic encryption library object to generate the corresponding first private key and first public key; The first feature attribute matrix is ​​transposed, and the transposed matrix is ​​homomorphically encrypted using the first public key to obtain a first ciphertext matrix.

4. A privacy computing method, characterized in that: Applied to a second data node, where the second data node and the first data node are both data nodes under a privacy-enforcing service, including: Sending second spatial information representing the spatial size of a second characteristic attribute matrix of its own data set to the first data node, so that the first data node acquires the second spatial information and determines the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of the first characteristic attribute matrix of the first data node's own data set; If the target spatial information is the first spatial information, obtaining a first ciphertext matrix and a first public key sent by the first data node; wherein the first data node generates a corresponding first private key and the first public key based on a homomorphic encryption algorithm, and uses the first public key to homomorphically encrypt the first feature attribute matrix to obtain a first ciphertext matrix; Performing a matrix multiplication operation on the second feature attribute matrix and the first ciphertext matrix based on the first public key, and sending the corresponding operation result and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node, so that the first data node decrypts the operation result using the first private key, and concatenates the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix, and the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix, so as to complete this privacy calculation process; The first data node is further used to send the first spatial information to the second data node, so that the second data node determines the minimum target spatial information from the second spatial information and the first spatial information; And when the target spatial information is the second spatial information, the first data node is also used to obtain the second ciphertext matrix and the corresponding second public key sent by the second data node, so that the first data node performs matrix multiplication operations on the Pearson correlation coefficient matrix corresponding to the first feature attribute matrix and the second ciphertext matrix based on the second public key; wherein the second data node generates the corresponding second private key and the second public key based on the homomorphic encryption algorithm, and uses the second public key to homomorphically encrypt the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain the second ciphertext matrix.

5. A privacy computing device, characterized in that: Applied to a first data node, the first data node and the second data node are both data nodes under a privacy intersection service, including: A first spatial information determination module is used to obtain second spatial information of the spatial size of a second characteristic attribute matrix of the second data node, which is sent by the second data node, and determine the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of the first characteristic attribute matrix of the first data node's own data set; a homomorphic encryption module, configured to generate a corresponding first private key and a first public key based on a homomorphic encryption algorithm when the target spatial information is the first spatial information, and to perform homomorphic encryption on the first feature attribute matrix using the first public key to obtain a first ciphertext matrix; a ciphertext sending module, configured to send the first ciphertext matrix and the first public key to the second data node, so that the second data node performs a matrix multiplication operation on the second feature attribute matrix and the first ciphertext matrix based on the first public key, and sends the corresponding operation results and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node; A decryption module, used to decrypt the operation result using the first private key, and concatenate the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix, and the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix, so as to complete this privacy calculation process; Wherein, the device further comprises: a spatial information sending module, configured to send the first spatial information to the second data node, so that the second data node determines the minimum target spatial information from the second spatial information and the first spatial information; Wherein, the device further comprises: A second ciphertext acquisition module is used to obtain a second ciphertext matrix and a corresponding second public key sent by a second data node when the target spatial information is the second spatial information, so as to perform matrix multiplication operations on the Pearson correlation coefficient matrix corresponding to the first feature attribute matrix and the second ciphertext matrix based on the second public key; wherein the second data node generates a corresponding second private key and the second public key based on a homomorphic encryption algorithm, and uses the second public key to homomorphically encrypt the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a second ciphertext matrix.

6. A privacy computing device, characterized in that: Applied to a second data node, where the second data node and the first data node are both data nodes under a privacy-enforcing service, including: A second spatial information determination module is used to send second spatial information representing the spatial size of a second characteristic attribute matrix of its own data set to a first data node, so that the first data node obtains the second spatial information and determines the minimum target spatial information from the second spatial information and the first spatial information; the first spatial information represents the spatial size of a first characteristic attribute matrix of the first data node's own data set; A first ciphertext acquisition module, configured to acquire a first ciphertext matrix and a first public key sent by the first data node when the target spatial information is the first spatial information; wherein the first data node generates a corresponding first private key and the first public key based on a homomorphic encryption algorithm, and uses the first public key to homomorphically encrypt the first feature attribute matrix to obtain a first ciphertext matrix; A matrix sending module, used to perform matrix multiplication operation on the second feature attribute matrix and the first ciphertext matrix based on the first public key, and send the corresponding operation result and the Pearson correlation coefficient matrix of the second feature attribute matrix to the first data node, so that the first data node decrypts the operation result using the first private key, and concatenates the decrypted matrix, the Pearson correlation coefficient matrix of the first feature attribute matrix, and the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain a global Pearson correlation coefficient matrix, so as to complete this privacy calculation process; The first data node is further used to send the first spatial information to the second data node, so that the second data node determines the minimum target spatial information from the second spatial information and the first spatial information; And when the target spatial information is the second spatial information, the first data node is also used to obtain the second ciphertext matrix and the corresponding second public key sent by the second data node, so that the first data node performs matrix multiplication operations on the Pearson correlation coefficient matrix corresponding to the first feature attribute matrix and the second ciphertext matrix based on the second public key; wherein the second data node generates the corresponding second private key and the second public key based on the homomorphic encryption algorithm, and uses the second public key to homomorphically encrypt the Pearson correlation coefficient matrix of the second feature attribute matrix to obtain the second ciphertext matrix.

7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the privacy computing method as described in any one of claims 1 to 4.

8. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the privacy computing method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Federal extreme value determination method and device based on privacy set intersection, and medium

    CN116738468A

  • Plaintext and ciphertext matrix multiplication calculation method based on homomorphic encryption

    CN117200972A

  • Method and system for feature vector based remote biometric verification using homomorphic encryption

    KR101755995B1

  • Auditable secure reverse engineering proof machine learning pipeline and methods

    US20210342490A1