Feature correlation calculation method, device and computer readable storage medium

By encrypting feature data and adding random number processing in vertical federated learning, the data theft risk in feature correlation calculation is solved, and higher security and privacy protection is achieved, ensuring the security of the federated learning model.

CN110807528BActive Publication Date: 2024-11-05WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911046722.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-30
Publication Date
2024-11-05
Estimated Expiration
2039-10-30

AI Technical Summary

Technical Problem

There is a security risk in feature correlation calculations in vertical federated learning, and participants may steal the other party's data by forging data or multiple modeling. The existing encryption and random number schemes are flawed.

Method used

The encryption algorithm is used to encrypt the feature data, and the normalized feature data is added with random numbers. Both parties take encryption and random numbers respectively to calculate and decrypt the relevant values ​​to ensure data security.

Benefits of technology

Enhanced security of vertical federated learning modeling, prevent data theft, improve data protection measures, and ensure the privacy of data between both parties.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110807528B_ABST
    Figure CN110807528B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and computer-readable storage medium for calculating feature correlation, the method comprising: receiving encrypted feature data sent by a first device, the first device normalizing the first feature data, and encrypting the processing result to obtain encrypted feature data; normalizing the second feature data, and adding a random number to the processing result to obtain random number feature data; calculating an encrypted correlation value based on the encrypted feature data and the random number feature data, and sending the encrypted correlation value to the first device, so that the first device can decrypt the encrypted correlation value to obtain the correlation value of the first feature data and the second feature data. The present invention adopts encryption measures on data by one party, and random number measures on data by the other party, and both parties adopt certain encryption protection measures, so that neither party can steal the other party's data, thereby enhancing the security of vertical federated learning modeling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a feature correlation calculation method, device and computer-readable storage medium. Background Art

[0002] With the rapid development and widespread application of machine learning, the role of feature engineering in machine learning is becoming increasingly important. Feature engineering refers to the process of converting raw data into training data for models. Its purpose is to obtain better training data features to improve the performance of the model. Feature engineering generally includes three parts: feature construction, feature extraction, and feature selection. Feature correlation calculation is an important method in the feature selection part. By calculating the correlation between features, some redundant features can be excluded, and features that have a great effect on model training can be retained. For example, to examine which features have an impact on the sales of ice cream, the correlation between temperature, season, whether it is hot, whether it is summer, etc. is very high. If correlation calculation and feature selection are not performed, using all these features as training data for the model will add noise to the model.

[0003] At present, in the application scenario of vertical federated learning, each participant in federated learning has different data features, and needs to jointly calculate the correlation of these features, and then select features based on the correlation. In order to ensure the data privacy of all parties involved in the data, the participants generally cannot directly transmit the original data. There are currently two main solutions for jointly calculating the correlation of features:

[0004] 1. Party A encrypts the data and sends it to Party B. Party B directly calculates the correlation based on the sent data and returns it. This solution has poor response capabilities to situations where Party A maliciously obtains Party B's data, that is, Party A may obtain Party B's data through forged data.

[0005] 2. Party A adds random numbers to the data and sends it to Party B for calculation. This solution effectively eliminates the risk of Party A stealing Party B's data in method 1. However, this solution also has security flaws, that is, Party B may find out the distribution of the random numbers added by Party A through multiple modeling, thereby eliminating the random numbers to a certain extent and obtaining an approximate value of Party A's original data.

[0006] Therefore, the current solutions for all participants in vertical federated learning to jointly calculate feature correlations have certain security risks. Summary of the invention

[0007] The main purpose of the present invention is to provide a feature correlation calculation method, device and computer-readable storage medium, aiming to propose a feature correlation calculation scheme in vertical federated learning, so as to avoid the situation where one party of the federation steals the data of another party and enhance the security of federated learning modeling.

[0008] To achieve the above object, the present invention provides a feature correlation calculation method, which is applied to a second device participating in vertical federated learning, the second device is communicatively connected to a first device participating in vertical federated learning, and the feature correlation calculation method includes:

[0009] Receiving the encrypted feature data sent by the first device, wherein the first device performs normalization processing on the first feature data for which correlation is to be calculated, and encrypts the processing result according to an encryption algorithm to obtain the encrypted feature data;

[0010] Performing the normalization process on the second feature data for which the correlation is to be calculated, and performing a random number addition operation on the processing result to obtain random number added feature data;

[0011] An encryption correlation value is calculated based on the encrypted feature data and the random number added feature data, and the encryption correlation value is sent to the first device so that the first device decrypts the encryption correlation value to obtain a correlation value between the first feature data and the second feature data.

[0012] Optionally, after the step of calculating an encryption-related value according to the encryption feature data and the random number-added feature data, and sending the encryption-related value to the first device, the step further includes:

[0013] receiving the correlation value sent by the first device;

[0014] Feature selection is performed on the first feature data and the second feature data according to the correlation value.

[0015] Optionally, the step of performing the normalization process on the second feature data for which correlation is to be calculated includes:

[0016] Calculate the mean and standard deviation of each data in the second feature data for which correlation is to be calculated;

[0017] The mean is subtracted from each data in the second characteristic data and the result is divided by the standard deviation.

[0018] Optionally, the step of performing a random number addition operation on the processing result to obtain random number added feature data includes:

[0019] Different preset random numbers are added to each data in the second characteristic data after normalization to obtain random number added characteristic data.

[0020] Optionally, the encryption algorithm is a preset homomorphic encryption algorithm.

[0021] Optionally, when the second feature data is stored in different execution machines of a distributed cluster, the step of performing the normalization process on the second feature data for which correlation is to be calculated includes:

[0022] The normalization process is performed on the second characteristic data for which correlation is to be calculated in a distributed computing manner.

[0023] To achieve the above object, the present invention further provides a feature correlation calculation method, which is applied to a first device participating in vertical federated learning, and the second device is communicatively connected to a second device participating in vertical federated learning, and the feature correlation calculation method includes:

[0024] Normalizing the first feature data for which correlation is to be calculated, and encrypting the processing result according to the encryption algorithm to obtain encrypted feature data;

[0025] Sending the encrypted feature data to the second device, so that the second device can calculate the encryption correlation value according to the encrypted feature data and the random number added feature data, wherein the second device performs the normalization processing on the second feature data for which the correlation is to be calculated, and adds a random number to the processing result to obtain the random number added feature data;

[0026] The encrypted correlation value returned by the second device is received and decrypted to obtain the correlation value of the first feature data and the second feature data.

[0027] In addition, to achieve the above-mentioned purpose, the present invention also provides a feature correlation calculation device, which includes a memory, a processor, and a feature correlation calculation program stored in the memory and executable on the processor, and the feature correlation calculation program, when executed by the processor, implements the steps of the feature correlation calculation method described above.

[0028] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a feature correlation calculation program is stored, and when the feature correlation calculation program is executed by a processor, the steps of the feature correlation calculation method described above are implemented.

[0029] In the present invention, by receiving the encrypted feature data sent by the first device, the first device normalizes the first feature data for which correlation is to be calculated, and encrypts the processing result according to the encryption algorithm to obtain the encrypted feature data; normalizes the second feature data for which correlation is to be calculated, and performs random number addition operation on the processing result to obtain random number added feature data; an encrypted correlation value is calculated based on the encrypted feature data and the random number added feature data, and the encrypted correlation value is sent to the first device, so that the first device can decrypt the encrypted correlation value to obtain the correlation value of the first feature data and the second feature data. Compared with the traditional solution in which only one side of the two parties adds encryption or random number addition mechanism, so that the other party has the ability to steal the other party's data by multiple modeling or constructing special data, the present invention uses the first device to encrypt the data, and the second device to add random number measures to the data. Both parties take certain encryption protection measures, so that neither party can steal the other party's data, thereby enhancing the security of vertical federated learning modeling. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention;

[0031] Figure 2 It is a flowchart of the first embodiment of the feature correlation calculation method of the present invention;

[0032] Figure 3 A schematic diagram of jointly calculating feature correlation values ​​for party A and party B involved in an embodiment of the present invention.

[0033] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0034] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0035] The present invention provides a feature correlation calculation device, referring to Figure 1 , Figure 1 It is a structural diagram of the hardware operating environment involved in the embodiment of the present invention.

[0036] It should be noted that Figure 1 The feature correlation calculation device of the embodiment of the present invention may be a PC, or a terminal device with a display function such as a smart phone, a smart TV, a tablet computer, or a portable computer.

[0037] like Figure 1As shown, the feature correlation calculation device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0038] Optionally, the feature correlation calculation device may also include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. Those skilled in the art will appreciate that Figure 1 The feature correlation calculation device structure shown in the figure does not constitute a limitation on the feature correlation calculation device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0039] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a feature correlation calculation program.

[0040] exist Figure 1 In the feature correlation calculation device shown, the network interface 1004 is mainly used to connect other participating devices participating in the vertical federated learning and communicate data with other participating devices; the user interface 1003 is mainly used to connect the client (user end) and communicate data with the client; and the processor 1001 can be used to call the feature correlation calculation program stored in the memory 1005 and perform the following operations:

[0041] Receiving the encrypted feature data sent by the first device, wherein the first device performs normalization processing on the first feature data for which correlation is to be calculated, and encrypts the processing result according to an encryption algorithm to obtain the encrypted feature data;

[0042] Performing the normalization process on the second feature data for which the correlation is to be calculated, and performing a random number addition operation on the processing result to obtain random number added feature data;

[0043] An encryption correlation value is calculated based on the encrypted feature data and the random number added feature data, and the encryption correlation value is sent to the first device so that the first device decrypts the encryption correlation value to obtain a correlation value between the first feature data and the second feature data.

[0044] Further, after the step of calculating an encryption correlation value according to the encrypted feature data and the random number added feature data, and sending the encryption correlation value to the first device, the processor 1001 may be used to call a feature correlation calculation program stored in the memory 1005, and further perform the following operations:

[0045] receiving the correlation value sent by the first device;

[0046] Feature selection is performed on the first feature data and the second feature data according to the correlation value.

[0047] Furthermore, the step of performing the normalization process on the second feature data for which the correlation is to be calculated includes:

[0048] Calculate the mean and standard deviation of each data in the second feature data for which correlation is to be calculated;

[0049] The mean is subtracted from each data in the second characteristic data and the result is divided by the standard deviation.

[0050] Furthermore, the step of performing a random number addition operation on the processing result to obtain random number added feature data includes:

[0051] Different preset random numbers are added to each data in the second characteristic data after normalization to obtain random number added characteristic data.

[0052] Furthermore, the encryption algorithm is a preset homomorphic encryption algorithm.

[0053] Furthermore, when the second feature data is stored in different execution machines of a distributed cluster, the step of performing the normalization process on the second feature data for which correlation is to be calculated includes:

[0054] The normalization process is performed on the second characteristic data for which correlation is to be calculated in a distributed computing manner.

[0055] The present invention also provides a feature correlation calculation device, the feature correlation calculation device comprising a memory, a processor, and a feature correlation calculation program stored in the memory and executable on the processor, wherein the feature correlation calculation program implements the following operations when executed by the processor:

[0056] Normalizing the first feature data for which correlation is to be calculated, and encrypting the processing result according to the encryption algorithm to obtain encrypted feature data;

[0057] Sending the encrypted feature data to the second device, so that the second device can calculate the encryption correlation value according to the encrypted feature data and the random number added feature data, wherein the second device performs the normalization processing on the second feature data for which the correlation is to be calculated, and adds a random number to the processing result to obtain the random number added feature data;

[0058] The encrypted correlation value returned by the second device is received and decrypted to obtain the correlation value of the first feature data and the second feature data.

[0059] Based on the above hardware structure, various embodiments of the feature correlation calculation method of the present invention are proposed.

[0060] Reference Figure 2 , the first embodiment of the feature correlation calculation method of the present invention provides a feature correlation calculation method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in a different order than here. Applied to a second device participating in vertical federated learning, the second device is communicatively connected with a first device participating in vertical federated learning, the first device and the second device can be a server, or a terminal device such as a PC, a smart phone, a smart TV, a tablet computer, a portable computer, etc., the feature correlation calculation method includes:

[0061] Step S10, receiving the encrypted feature data sent by the first device, wherein the first device normalizes the first feature data for which correlation is to be calculated, and encrypts the processing result according to an encryption algorithm to obtain the encrypted feature data;

[0062] In this embodiment, each participant in vertical federated learning owns a portion of data locally, and the data of each party overlaps less in the feature dimension and more in the user dimension; each party can use sample alignment to determine the users that all parties have in common, and then use the sample aligned data to determine the correlation between different features of each party, so as to perform feature selection based on the correlation between the features.

[0063] The following specifically describes this embodiment using a first device and a second device participating in vertical federated learning. It should be understood that the feature correlation calculation method described in this embodiment can be extended to multiple participating devices participating in vertical federated learning.

[0064] Specifically, the first device and the second device establish a communication connection. The first device and the second device can perform sample alignment to determine the users shared by both parties. For example, the user dimension in the first device is {U1, U2, U3, U4}, and the feature dimension is {X4, X5}; the user dimension in the second device is {U1, U2, U3, U4, U5}, and the feature dimension is {X1, X2, X3}; the second device also includes a data label Y; the first device and the second device determine that the shared user is {U1, U2, U3} after sample alignment. The first device and the second device can jointly calculate the correlation between different features of both parties. For example, the correlation between features X4 and X5 and features X1, X2, X3, and Y can be calculated respectively. The following is a specific explanation of the two features whose correlation is to be calculated, namely the first feature in the first device and the second feature in the second device.

[0065] It is necessary to calculate the correlation between features through feature data. For example, to calculate the correlation between X1 and X5, the feature data of users U1, U2 and U3 in the second device under feature X5 and the feature data of users U1, U2 and U3 in the second device under feature X6 are required. The feature data can be taken as a vector, and the elements in the vector are the data of each user under the feature. The dimension of the vector is the number of users shared by the first device and the second device. For example, if the feature whose correlation is to be calculated is age, the feature data is the age value of user U1, the age value of user U2 and the age value of user U3.

[0066] Since the data of the first device and the second device are private, the data of the first device cannot be directly sent to the second device, nor can the data of the second device be directly sent to the first device. In this embodiment, the first device normalizes the first feature data corresponding to the first feature for the first feature whose correlation is to be calculated, and encrypts the result of the normalization processing according to the encryption algorithm to obtain encrypted feature data, and sends the encrypted feature data to the second device. Among them, the normalization processing can be to first calculate the average value and standard deviation of each data in the first feature data, and then subtract the average value from each data and divide it by the standard deviation. The encryption algorithm used by the first device can be a preset homomorphic encryption algorithm, such as the Paillier algorithm. The effect of the homomorphic encryption algorithm is to process the homomorphically encrypted data to obtain an output, and decrypt this output. The result is the same as the output result obtained by processing the unencrypted original data in the same way.

[0067] The second device receives the encrypted characteristic data sent by the first device.

[0068] Step S20, performing the normalization process on the second feature data for which correlation is to be calculated, and performing a random number addition operation on the processing result to obtain random number added feature data;

[0069] The second device normalizes the second feature data corresponding to the second feature for which the correlation is to be calculated, and performs a random number addition operation on the result of the normalization process to obtain feature data with random numbers added. The second device may add the same random number to each data in the second feature data after normalization, and the random number may be generated by the second device using a preset random number generation algorithm. For example, for the second feature data {x1, x2, x3} after normalization, a random number r is added to each data to obtain feature data with random numbers added {x1+r, x2+r, x3+r}.

[0070] Furthermore, the step of performing the normalization process on the second feature data for which the correlation is to be calculated in step S20 includes:

[0071] Step S201, calculating the mean and standard deviation of each data in the second characteristic data whose correlation is to be calculated;

[0072] Step S202: subtract the mean from each data in the second characteristic data and divide the result by the standard deviation.

[0073] The second device may perform normalization processing on the second feature data by calculating the mean and standard deviation of each data in the second feature data. For example, if the second feature data is {x1, x2, x3}, the calculated mean is μ x =(x1+x2+x3) / 3, the standard deviation is:

[0074]

[0075] Subtract the mean from each data in the second feature data and divide by the standard deviation, such as calculating (x1-μ x ) / σ x 、(x2-μ x ) / σ x and (x3-μ x ) / σ x , that is, the result after each data is normalized.

[0076] Further, in order to enhance the security of data in the second device, the step of adding a random number to the processing result in step S20 to obtain random number added feature data includes:

[0077] Step S203, adding different preset random numbers to each data in the second feature data after normalization processing to obtain random number added feature data.

[0078] The second device adds different preset random numbers to each data in the second characteristic data after normalization processing to obtain random number-added characteristic data, wherein the preset random number can be different random numbers generated by the second device using a preset random number generation algorithm, and the number of random numbers is the same as the number of data in the second characteristic data. If the preset random numbers are r1, r2, and r3, for the second characteristic data {x1, x2, x3} after normalization processing, different random numbers are added to each data to obtain random number-added characteristic data {x1+r1, x2+r2, x3+r3}. Since the second device adds different random numbers to each data in the second characteristic data, the second characteristic data is more securely protected, and the security of the data in the second device is further enhanced.

[0079] Step S30, calculating an encryption correlation value based on the encrypted feature data and the random number added feature data, and sending the encryption correlation value to the first device so that the first device decrypts the encryption correlation value to obtain a correlation value between the first feature data and the second feature data.

[0080] After calculating and obtaining the random number feature data, the second device uses the random number feature data and the encrypted feature data to calculate and obtain the encrypted correlation value. Specifically, the second device can calculate the inner product of the random number feature data and the encrypted feature data. The result of the calculation is the encrypted correlation value, that is, the encrypted correlation value. The second device sends the encrypted correlation value to the first device. The first device decrypts the encrypted correlation value. The decryption operation corresponds to the encryption operation of the first device encrypting the normalized processing result of the first feature data. That is, the first device uses the encryption key to encrypt the normalized processing result of the first feature data, and then uses the decryption key corresponding to the encryption key to decrypt the encrypted correlation value. The final result is the correlation value of the first feature data and the second feature data, that is, the correlation value of the first feature and the second feature.

[0081] The mathematical principle of jointly calculating the feature correlation between the first device and the second device in this embodiment is derived as follows:

[0082] The correlation coefficient is used to measure the degree of linear correlation between two variables. The most commonly used one is the Pearson coefficient. The formula of the Pearson coefficient is:

[0083]

[0084] In formula (1), x and y are two variables, cov(x,y) represents the covariance of the two variables, σ x and σ y Represents the standard deviation of two variables. X and Y are two vectors corresponding to the values ​​of x and y, respectively. x and μy are the average values ​​of the elements in the two vectors, and E represents the expectation.

[0085] From formula (1), we can know that the correlation between two columns of data can be obtained by dividing their covariance by the product of their standard deviations. By transformation, we can get the Pearson correlation as the result of taking the inner product of the two eigenvectors minus their mean divided by the standard deviation. Subtracting the mean divided by the standard deviation is a normalization operation, so the Pearson correlation can be regarded as the result of taking the inner product of the two eigenvectors after normalization.

[0086] Assume that the X vector belongs to party A (the first device) and the Y vector belongs to party B (the second device). Party A normalizes the X vector and performs homomorphic encryption before sending it to party B. Party B normalizes the Y vector and adds an arbitrary random number R to calculate the correlation value. The above formula can be transformed into:

[0087]

[0088] Among them, [[]] represents homomorphic encryption. Since R is a random number added by Party B, it is obviously independent of the normalization of the X vector, so the expectation of the product of the two is equal to the product of the two expectations. At the same time, the expectation of X after normalization is also 0, so the product of the latter two terms is zero. Therefore, the final result is the encrypted result of the Pearson correlation value of the X vector and the Y vector [[P]].

[0089] like Figure 3 As shown, it is a schematic diagram of party A and party B jointly calculating the correlation value between party A's feature X and party B's feature Y.

[0090] In this embodiment, by receiving the encrypted feature data sent by the first device, the first device normalizes the first feature data for which the correlation is to be calculated, and encrypts the processing result according to the encryption algorithm to obtain the encrypted feature data; normalizes the second feature data for which the correlation is to be calculated, and performs a random number operation on the processing result to obtain the random number feature data; an encrypted correlation value is calculated based on the encrypted feature data and the random number feature data, and the encrypted correlation value is sent to the first device, so that the first device can decrypt the encrypted correlation value to obtain the correlation value of the first feature data and the second feature data. Compared with the traditional solution in which only one party adds encryption or random number mechanism, so that the other party has the ability to steal the other party's data by multiple modeling or constructing special data, in this embodiment, the first device takes encryption measures on the data, and the second device takes random number measures on the data. Both parties take certain encryption protection measures, so that neither party can steal the other party's data, thereby enhancing the security of vertical federated learning modeling.

[0091] Further, based on the above first embodiment, the second embodiment of the feature correlation calculation method of the present invention provides a feature correlation calculation method. In this embodiment, after the step S30, it also includes:

[0092] Step S40, receiving the correlation value sent by the first device;

[0093] Step S50: performing feature selection on the first feature data and the second feature data according to the correlation value.

[0094] In this embodiment, after decrypting and obtaining the correlation value of the first characteristic data and the second characteristic data, the first device may send the correlation value to the second device. The second device receives the correlation value sent by the first device.

[0095] The second device performs feature selection on the first feature data and the second feature data according to the correlation value. Specifically, a correlation threshold can be set in the second device. If the correlation value is greater than the correlation threshold, it means that the correlation between the first feature data and the second feature data is high, and the second device can choose to remove one of the first feature data or the second feature data. For example, if the first feature is the season and the second feature is the temperature, and the calculated correlation value is greater than the correlation threshold, the second device can remove one of the season or the temperature, that is, the data under this feature will not be used in the subsequent training process of the federated learning model. If the correlation value is not greater than the correlation threshold, the first feature data and the second feature data can be retained.

[0096] It should be noted that the first device may also perform feature selection directly according to the correlation value after decrypting to obtain the correlation value.

[0097] In this embodiment, the first device sends the decrypted correlation value to the second device, and the second device performs feature selection based on the correlation value, so that subsequent modeling and model training of the federated learning model can obtain a higher quality model.

[0098] Furthermore, when the second feature data is stored in different execution machines of a distributed cluster, the step of performing the normalization process on the second feature data for which correlation is to be calculated in step S20 includes:

[0099] Step S204: performing the normalization process on the second feature data for which correlation is to be calculated by using a distributed computing method.

[0100] In this embodiment, the second characteristic data of the second device may be stored in different execution machines of the distributed cluster. For example, if different execution machines store data of different users, the second device may use a distributed computing method to normalize the second characteristic data when normalizing the second characteristic data. Specifically, different execution machines normalize their respective local parts of the second characteristic data, and then send the normalization results to the second device, which aggregates the results of each execution machine and performs a random number addition operation.

[0101] Similarly, when the first device performs normalization processing on the first data features, it may also use a distributed computing method to perform normalization processing.

[0102] In this embodiment, the first device and the second device can use distributed computing to perform normalization processing, which reduces the computing resource consumption of the first device and the second device, improves the speed of normalization processing, and thus improves the efficiency of the entire vertical federated learning modeling process.

[0103] Further, based on the above-mentioned first and second embodiments, the third embodiment of the feature correlation calculation method of the present invention provides a feature correlation calculation method, which is applied to a first device participating in vertical federated learning, and the second device is communicatively connected with a second device participating in vertical federated learning. The first device and the second device can be servers, or terminal devices such as PCs, smart phones, smart TVs, tablet computers, and portable computers. The feature correlation calculation method includes:

[0104] Step A10, normalizing the first feature data for which correlation is to be calculated, and encrypting the processing result according to an encryption algorithm to obtain encrypted feature data;

[0105] In this embodiment, the first device normalizes the first feature data corresponding to the first feature for which correlation is to be calculated, and encrypts the result of the normalization process according to the encryption algorithm to obtain encrypted feature data. The normalization process may be to first calculate the average value and standard deviation of each data in the first feature data, and then subtract the average value from each data and divide it by the standard deviation. The encryption algorithm adopted by the first device may be a preset homomorphic encryption algorithm, such as the Paillier algorithm. The effect of the homomorphic encryption algorithm is to process the homomorphically encrypted data to obtain an output, and to decrypt the output. The result is the same as the output result obtained by processing the unencrypted original data in the same way.

[0106] Step A20, sending the encrypted feature data to the second device, so that the second device can calculate the encryption correlation value according to the encrypted feature data and the random number added feature data, wherein the second device performs the normalization processing on the second feature data for which the correlation is to be calculated, and adds a random number to the processing result to obtain the random number added feature data;

[0107] The first device sends the encrypted feature data to the second device. The second device receives the encrypted feature data sent by the first device. The second device normalizes the second feature data corresponding to the second feature for which correlation is to be calculated, and adds a random number to the result of the normalization process to obtain feature data with random numbers added. The second device may add the same random number to each data in the normalized second feature data, and the random number may be generated by the second device using a preset random number generation algorithm. For example, for the normalized second feature data {x1, x2, x3}, a random number r is added to each data to obtain feature data with random numbers added {x1+r, x2+r, x3+r}.

[0108] After calculating and obtaining the random number feature data, the second device uses the random number feature data and the encrypted feature data to calculate and obtain the encrypted correlation value. Specifically, the second device can calculate the inner product of the random number feature data and the encrypted feature data, and the result of the calculation is the encrypted correlation value, that is, the encrypted correlation value. The second device sends the encrypted correlation value to the first device.

[0109] Step A30: Receive the encrypted correlation value returned by the second device and decrypt it to obtain the correlation value of the first feature data and the second feature data.

[0110] The first device receives the encrypted correlation value returned by the second device, and decrypts the encrypted correlation value. The decryption operation corresponds to the encryption operation of the first device to encrypt the normalized processing result of the first feature data, that is, the first device uses the encryption key to encrypt the normalized processing result of the first feature data, and then uses the decryption key corresponding to the encryption key to decrypt the encrypted correlation value. The final result is the correlation value of the first feature data and the second feature data, that is, the correlation value of the first feature and the second feature.

[0111] In this embodiment, the first feature data to be calculated for correlation is normalized by the first device, and the processing result is encrypted according to the encryption algorithm to obtain encrypted feature data; the encrypted feature data is sent to the second device, so that the second device can calculate the encrypted correlation value according to the encrypted feature data and the random number feature data, wherein the second device normalizes the second feature data to be calculated for correlation, and adds a random number to the processing result to obtain the random number feature data; the encrypted correlation value returned by the second device is received and decrypted to obtain the correlation value of the first feature data and the second feature data. Compared with the traditional solution in which only one party adds encryption or random number mechanism, so that the other party has the ability to steal the other party's data by multiple modeling or constructing special data, in this embodiment, the first device takes encryption measures on the data, and the second device takes random number measures on the data, and both parties take certain encryption protection measures, so that neither party can steal the other party's data, thereby enhancing the security of vertical federated learning modeling.

[0112] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a feature correlation calculation program is stored. When the feature correlation calculation program is executed by a processor, the steps of the feature correlation calculation method described above are implemented.

[0113] The extended contents of the specific implementation modes of the feature correlation calculation device and the computer-readable storage medium of the present invention are basically the same as the above-mentioned embodiments of the feature correlation calculation method, and will not be elaborated here.

[0114] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system 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 system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0115] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0116] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0117] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A feature correlation calculation method, characterized in that: The feature correlation calculation method is applied to a second device participating in vertical federated learning, the second device is communicatively connected to a first device participating in vertical federated learning, and the feature correlation calculation method includes: Receiving the encrypted feature data sent by the first device, wherein the first device performs normalization processing on the first feature data for which correlation is to be calculated, and encrypts the processing result according to an encryption algorithm to obtain the encrypted feature data; Performing the normalization process on the second feature data for which the correlation is to be calculated, and performing a random number addition operation on the processing result to obtain random number added feature data; An encryption correlation value is calculated based on the encrypted feature data and the random number added feature data, and the encryption correlation value is sent to the first device so that the first device decrypts the encryption correlation value to obtain a correlation value between the first feature data and the second feature data.

2. The feature correlation calculation method according to claim 1, characterized in that: After the step of calculating the encryption-related value according to the encryption feature data and the random number-added feature data, and sending the encryption-related value to the first device, the method further includes: receiving the correlation value sent by the first device; Feature selection is performed on the first feature data and the second feature data according to the correlation value.

3. The feature correlation calculation method according to claim 1, characterized in that: The step of performing the normalization process on the second feature data for which the correlation is to be calculated comprises: Calculate the mean and standard deviation of each data in the second feature data for which correlation is to be calculated; The mean is subtracted from each data in the second characteristic data and the result is divided by the standard deviation.

4. The feature correlation calculation method according to claim 1, characterized in that: The step of performing a random number addition operation on the processing result to obtain random number added feature data comprises: Different preset random numbers are added to each data in the second characteristic data after normalization to obtain random number added characteristic data.

5. The feature correlation calculation method according to claim 1, characterized in that: The encryption algorithm is a preset homomorphic encryption algorithm.

6. The feature correlation calculation method according to any one of claims 1 to 5, characterized in that: When the second feature data is stored in different execution machines of a distributed cluster, the step of performing the normalization process on the second feature data to be correlated includes: The normalization process is performed on the second characteristic data for which correlation is to be calculated in a distributed computing manner.

7. A feature correlation calculation method, characterized in that: The feature correlation calculation method is applied to a first device participating in vertical federated learning, the first device is communicatively connected with a second device participating in vertical federated learning, and the feature correlation calculation method includes: Normalizing the first feature data for which correlation is to be calculated, and encrypting the processing result according to the encryption algorithm to obtain encrypted feature data; Sending the encrypted feature data to the second device, so that the second device can calculate the encryption correlation value according to the encrypted feature data and the random number added feature data, wherein the second device performs the normalization processing on the second feature data for which the correlation is to be calculated, and adds a random number to the processing result to obtain the random number added feature data; The encrypted correlation value returned by the second device is received and decrypted to obtain the correlation value of the first feature data and the second feature data.

8. A feature correlation calculation device, characterized in that: The feature correlation calculation device includes a memory, a processor, and a feature correlation calculation program stored in the memory and executable on the processor. When the feature correlation calculation program is executed by the processor, the steps of the feature correlation calculation method according to any one of claims 1 to 6 are implemented.

9. A feature correlation calculation device, characterized in that: The feature correlation calculation device includes a memory, a processor, and a feature correlation calculation program stored in the memory and executable on the processor. When the feature correlation calculation program is executed by the processor, the steps of the feature correlation calculation method according to claim 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a feature correlation calculation program, and when the feature correlation calculation program is executed by a processor, the steps of the feature correlation calculation method according to any one of claims 1 to 7 are implemented.