Method, device and readable storage medium for building factor decomposition machine classification model

By adopting secret sharing and same -state encryption technology in the classification model of factor decomposition machines, only the non -zero part of the sparse data is calculated, and the problem of low computing efficiency of sparse matrix in federal learning has achieved higher calculation efficiency.

CN111985573BActive Publication Date: 2025-01-28WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010893160.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-28
Publication Date
2025-01-28
Estimated Expiration
2040-08-28

AI Technical Summary

Technical Problem

When training classification models based on federated learning, the computational efficiency of sparse matrices is low, resulting in high computational complexity and data transmission volume.

Method used

The factor decomposition machine classification model construction method is used. Through secret sharing and homomorphic encryption technology, only the non -zero parts of sparse data are calculated to reduce the calculation process of the zero part.

Benefits of technology

It reduced the calculation amount, calculation complexity and data transmission volume in the process of interchange, and improved the calculation efficiency of the classification model of factor decomposition machine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111985573B_ABST
    Figure CN111985573B_ABST
Patent Text Reader

Abstract

The present application discloses a factorization machine classification model construction method, device and readable storage medium, the factorization machine classification model construction method comprising: obtaining initialization model parameters and first sparse data corresponding to the classification model to be trained, and based on the initialization model parameters, performing secret sharing with a second device to obtain secret sharing initial model parameters for the second device to determine the second party secret sharing initial model parameters, performing federal interaction with the second device based on the first non-zero part in the first sparse data and the secret sharing initial model parameters, so as to combine the second non-zero part in the second sparse data obtained by the second device and the second party secret sharing initial model parameters, calculate the secret sharing classification model error, update the classification model to be trained based on the secret sharing classification model error, and obtain a vertical federated factorization machine classification model. The present application solves the technical problem of low computational efficiency when training classification models based on federated learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence in financial technology (Fintech), and in particular to a factor decomposition machine classification model construction method, device and readable storage medium. Background Art

[0002] With the continuous development of financial technology, especially Internet technology finance, more and more technologies (such as distributed, blockchain, artificial intelligence, etc.) are applied in the financial field, but the financial industry also puts forward higher requirements on technology, such as higher requirements on the distribution of corresponding to-do items in the financial industry.

[0003] With the continuous development of computer software and artificial intelligence, the application field of federated learning is becoming more and more extensive. At present, the training data for training classification models based on federated learning is usually dense matrix, and the dense matrix is ​​usually encrypted through homomorphic encryption during the training process to achieve the purpose of federated learning without leaking data privacy. However, when the training data is sparse matrix data, such as user portrait data, since the sparse matrix is ​​much larger than the dense matrix when storing the same information, the amount of calculation when training the classification model through federated learning based on homomorphic encryption is very large, and the calculation complexity is very high, which leads to extremely low calculation efficiency when training the classification model based on federated learning. Summary of the invention

[0004] The main purpose of this application is to provide a factor decomposition machine classification model construction method, device and readable storage medium, aiming to solve the technical problem of low computational efficiency when training classification models based on federated learning in the prior art.

[0005] To achieve the above-mentioned purpose, the present application provides a factor decomposition machine classification model construction method, which is applied to a factor decomposition machine classification model construction device, and the factor decomposition machine classification model construction method includes:

[0006] Obtaining a model parameter to be trained and first sparse data corresponding to the classification model to be trained, and performing secret sharing with a second device based on the model parameter to be trained to obtain a secret sharing initial model parameter;

[0007] Based on the first non-zero part in the first sparse data, the secret sharing initial model parameters and preset weight information, perform federation interaction with the second device to calculate the secret sharing classification model error;

[0008] Based on the secret sharing classification model error, the classification model to be trained is updated to obtain a vertical federated factorization machine classification model.

[0009] The present application also provides a click rate prediction method, which is applied to a click rate prediction device, and the click rate prediction method includes:

[0010] Acquire sparse data of the first-party user to be predicted, and perform secret sharing with the second device to obtain secret sharing model parameters;

[0011] Based on the first non-zero part of the sparse data of the first-party user to be predicted and the secret sharing model parameters, perform vertical federated prediction interaction with the second device to predict the click rate of the target user corresponding to the sparse data of the first-party user to be predicted, and obtain a first secret sharing click rate prediction result;

[0012] Based on the first secret shared click rate prediction result, aggregate interaction is performed with the second device to calculate a target click rate prediction result in conjunction with the second secret shared click rate prediction result determined by the second device.

[0013] The present application also provides a factor decomposition machine classification model construction device, the factor decomposition machine classification model construction device is a virtual device, and the factor decomposition machine classification model construction device is applied to a factor decomposition machine classification model construction device, and the factor decomposition machine classification model construction device includes:

[0014] A secret sharing module, used to obtain the model parameters to be trained and the first sparse data corresponding to the classification model to be trained, and based on the model parameters to be trained, perform secret sharing with the second device to obtain the secret sharing initial model parameters;

[0015] an error calculation module, configured to perform a federation interaction with the second device to calculate a secret sharing classification model error based on a first non-zero portion in the first sparse data, the secret sharing initial model parameters and preset weight information;

[0016] A generation module is used to update the classification model to be trained based on the secret sharing classification model error to obtain a vertical federated factorization machine classification model.

[0017] The present application also provides a click rate prediction device, which is a virtual device and is applied to a click rate prediction device. The click rate prediction device includes:

[0018] A secret sharing module, used to obtain sparse data of the first party user to be predicted, and to perform secret sharing with the second device to obtain secret sharing model parameters;

[0019] A prediction module, configured to perform a vertical federated prediction interaction with the second device based on the first non-zero part of the sparse data of the first-party user to be predicted and the secret sharing model parameters, so as to predict the click rate of the target user corresponding to the sparse data of the first-party user to be predicted, and obtain a first secret sharing click rate prediction result;

[0020] The aggregation module is used to perform aggregation interaction with the second device based on the first secret sharing click rate prediction result, so as to calculate the target click rate prediction result in combination with the second secret sharing click rate prediction result determined by the second device.

[0021] The present application also provides a factor decomposition machine classification model construction device, which is a physical device. The factor decomposition machine classification model construction device includes: a memory, a processor, and a program of the factor decomposition machine classification model construction method stored in the memory and executable on the processor. When the program of the factor decomposition machine classification model construction method is executed by the processor, the steps of the factor decomposition machine classification model construction method as described above can be implemented.

[0022] The present application also provides a click-through rate prediction device, which is a physical device. The click-through rate prediction device includes: a memory, a processor, and a program of the click-through rate prediction method stored in the memory and executable on the processor. When the program of the click-through rate prediction method is executed by the processor, the steps of the click-through rate prediction method as described above can be implemented.

[0023] The present application also provides a readable storage medium, on which is stored a program for implementing a factor decomposition machine classification model construction method. When the program for implementing a factor decomposition machine classification model construction method is executed by a processor, the steps of the factor decomposition machine classification model construction method as described above are implemented.

[0024] The present application also provides a readable storage medium, on which is stored a program for implementing a click-through rate prediction method. When the program of the click-through rate prediction method is executed by a processor, the steps of the click-through rate prediction method as described above are implemented.

[0025] The present application provides a factor decomposition machine classification model construction method, device and readable storage medium. Compared with the prior art that uses a homomorphic encryption-based method for federated learning, the present application performs secret sharing with a second device after obtaining the initialization model parameters and the first sparse data corresponding to the classification model to be trained, so that the first device obtains the secret shared initial model parameters, and the second device obtains the second party's secret shared initial model parameters, and then based on the first non-zero part of the first sparse data, the secret shared initial model parameters and preset weight information, performs federated interaction with the second device to calculate the secret shared classification model error, wherein, when performing the federated interaction, only the first device is used. The first non-zero part of the first sparse data and the second non-zero part of the second sparse data are used for calculation, thereby reducing the calculation process of the zero part in the first sparse data and the second sparse data, so that the calculation amount, calculation complexity and data transmission amount in the federated interaction process are greatly reduced, and then based on the secret sharing classification model error, the classification model to be trained is updated to obtain the vertical federated factor decomposition machine classification model, which overcomes the technical defect of low computational efficiency when constructing a factor decomposition machine classification model based on federated learning through homomorphic encryption method due to the large sparse matrix in the prior art, thereby improving the computational efficiency when constructing a factor decomposition machine classification model. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0027] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0028] Figure 1 This is a flow chart of the first embodiment of the factor decomposition machine classification model construction method of the present application;

[0029] Figure 2 This is a flow chart of the second embodiment of the factor decomposition machine classification model construction method of the present application;

[0030] Figure 3 This is a flow chart of the third embodiment of the click rate prediction method of the present application;

[0031] Figure 4 A schematic diagram of the device structure of the hardware operating environment involved in the factor decomposition machine classification model construction method of the embodiment of the present application;

[0032] Figure 5This is a schematic diagram of the device structure of the hardware operating environment involved in the click rate prediction method of the embodiment of the present application.

[0033] The purpose, features and advantages of this application will be further described in conjunction with the 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 application and are not used to limit the present application.

[0035] The present application embodiment provides a factor decomposition machine classification model construction method. In the first embodiment of the factor decomposition machine classification model construction method of the present application, refer to Figure 1 The factor decomposition machine classification model construction method is applied to a first device, and the factor decomposition machine classification model construction method includes:

[0036] Step S10, obtaining the model parameters to be trained and the first sparse data corresponding to the classification model to be trained, and based on the model parameters to be trained, performing secret sharing with the second device to obtain secret sharing initial model parameters;

[0037] In this embodiment, it should be noted that the first device and the second device are both participants in vertical federated learning. The first device has first sparse data with sample labels. The first sparse data can be represented by a first sparse matrix and sample labels. For example, assuming that the first sparse data is (X A , Y), X A is the first sparse matrix, Y is the sample label, and in addition, the second device has second sparse data without sample labels, and the second sparse data can be represented by a second sparse matrix. For example, assuming that the second sparse matrix is ​​X B .

[0038] Additionally, in this embodiment, the vertical federated factor decomposition machine classification model is a machine learning model constructed based on vertical federated learning, the model parameters of the vertical federated factor decomposition machine classification model are jointly held by the first device and the second device, the classification model to be trained is an initialized factor decomposition machine classification model, and the model parameters corresponding to the classification model to be trained can be represented by a matrix, wherein the model parameters of the classification model to be trained include the initialized model parameters belonging to the first device and the second-party initialized model parameters belonging to the second device, wherein the initialized model parameters include the first-party first-type model parameter vector, the first-party second-type model parameter matrix, and the first-party transposed matrix corresponding to the first-party second-type model parameter matrix, and the second-party initialized model parameters include the second-party first-type model parameter vector, the second-party second-type model parameter matrix, and the second-party transposed matrix corresponding to the second-party second-type model parameter matrix. For example, assuming that the first-party first-type model parameter vector is w A , the second party first type model parameter vector is w B , the first-party second-type model parameter matrix is ​​V A , the second-party second-type model parameter matrix is ​​V B , and the model parameters of the classification model to be trained are the first type model parameters w=[w A , w B ] and the second type model parameter V=[V A , V B ].

[0039] In addition, it should be noted that the process of secret sharing of data is a process of splitting the data into two sub-data, and the two sub-data are held by two parties of secret sharing respectively. For example, assuming that the two parties of secret sharing are A and B, then data X is secret shared, and A holds the first share of data X [[X]] A , B holds the second share of data X [[X]] B , and X=[[X]] A +[[X]] B .

[0040] In addition, it should be noted that the model expression of the factor decomposition machine classification model is as follows:

[0041]

[0042] z(x)=<w,x> +∑ i<j <V i , V j >x i x j

[0043] Wherein, f(x) is the factor decomposition machine classification model, x is the data matrix corresponding to the model input data, wherein the model input data includes the first sparse data (X A , Y) and the second sparse data X B , where Y is the sample label, X A With d A The first sparse matrix of feature dimensions, X B With d B The second sparse matrix of feature dimensions, the first type model parameter is w, where w is a d-dimensional vector, and the second type model parameter is V, where V is d*d x The matrix, and w=[w A , w B ], that is, w is the first-party first-type model parameter vector w A and the second-party first-type model parameter vector w B Composition, among which w A is d A dimensional vector, w B is d B dimensional vector, otherwise, V = [V A , V B ], where V is the first-party second-type model parameter matrix V A and the second party second type model parameter matrix V B Composition, among which, V A is d A *d X dimensional matrix, V B is d B *d X dimensional matrix,<w,x> is the inner product of w and x, V i is the column vector of the i-th column of V, V j is the column vector of the jth column of V, x i is the column vector of the i-th column of x, x j is the column vector of the j-th column of x.

[0044] Obtain the model parameters to be trained and the first sparse data corresponding to the classification model to be trained, and based on the model parameters to be trained, perform secret sharing with the second device to obtain the secret shared initial model parameters, specifically, initialize the factor decomposition machine classification model, obtain the classification model to be trained, and obtain the initialization model parameters corresponding to the classification model to be trained, wherein the second device obtains the second-party initialized model parameters, and splits the second-party initialized model parameters into a first share of the second-party initialized model parameters and a second share of the second-party initialized model parameters, and then obtains the first sparse data, and splits the initialized model parameters into a first share of the initialized model parameters and a second share of the initialized model parameters, wherein the first share of the initialized model parameters includes a first share of the first-party first-type model parameter vector, a first share of the first-party second-type model parameter matrix, and a first share of the first-party transposed matrix, and the second share of the initialized model parameters includes a second share of the first-party first-type model parameter vector The amount, the second share of the first-party second-type model parameter matrix and the second share of the first-party transposed matrix, and then sending the second share of the initialized model parameters to the second device, so that the second device uses the second share of the initialized model and the first share of the second-party initialized model as the second-party secret shared model parameters, and then receives the second share of the second-party initialized model parameters sent by the second device, and uses the first share of the initialized model parameters and the second share of the second-party initialized model parameters as the secret shared initial model parameters, wherein the first share of the second-party initialized model parameters includes the first share of the second-party first-type model parameter vector, the first share of the second-party second-type model parameter matrix and the first share of the second-party transposed matrix, and the second share of the second-party initialized model parameters includes the second share of the second-party first-type model parameter vector, the second share of the second-party second-type model parameter matrix and the second share of the second-party transposed matrix. For example, assuming that the initialized model parameters are G A , the second party initializes the model parameters G B , then after secret sharing, the first device has the first share of the initialization model [[G A ]] A and the second party initializes the model second share [[G B ]] A , the second device has the second share of the initialization model [[G A ]] B and the second party initializes the model first share [[G B ]] B , and G A =[[G A ]] A +[[G A ]] B , GB =[[G B ]] A +[[G B ]] B .

[0045] Step S20, based on the first non-zero part in the first sparse data, the secret sharing initial model parameters and preset weight information, perform federation interaction with the second device to calculate the secret sharing classification model error;

[0046] In this embodiment, it should be noted that the first non-zero part is the non-zero column vectors in the first sparse matrix, and the second device includes a second-party secret shared initial model parameter and a second sparse matrix, wherein the second sparse matrix includes a second non-zero part, wherein the second non-zero part is the non-zero column vectors in the second sparse matrix.

[0047] Based on the first non-zero part of the first sparse data, the secret sharing initial model parameters and the preset weight information, a federal interaction is performed with the second device to calculate the secret sharing classification model error. Specifically, based on the first non-zero part of the first sparse data and the secret sharing initial model parameters, a federal interaction is performed with the second device to jointly calculate each secret sharing error parameter item with the second non-zero part of the second sparse data and the second-party secret sharing initial model parameters determined by the second device, and then the secret sharing classification model error is calculated based on each secret sharing parameter item, the secret sharing sample label, the preset weight information and the preset secret sharing classification model error calculation formula, wherein the secret sharing sample label is obtained by secretly sharing the sample label with the second device, wherein the secret sharing sample label is the first share of the sample label, the second share of the sample label is the second-party secret sharing sample label, and is held by the second device, and the preset weight information is the calculation weight ratio of each secret sharing parameter item when calculating the secret sharing classification model error.

[0048] wherein the secret sharing initial model parameters include first-type sharing model parameters and second-type sharing model parameters, the second device includes second-party secret sharing initial model parameters and a second sparse matrix, wherein the second-party secret sharing initial model parameters include second-party first-type sharing model parameters and second-party second-type sharing model parameters,

[0049] The performing federated interaction with the second device to calculate the secret sharing classification model error based on the first non-zero part in the first sparse data, the secret sharing initial model parameters and the preset weight information includes:

[0050] Step S21: based on the first type of shared model parameters and the first non-zero part, perform federated interaction with the second device to combine the first type of shared model parameters of the second party and the second non-zero part of the second sparse matrix to calculate the first type of sparse matrix secure inner product;

[0051] In this embodiment, it should be noted that the first type of shared model parameters are first type model parameters of secret sharing held by the first device, wherein the first type of shared model parameters include a fifth shared parameter and a sixth shared parameter, wherein the fifth shared parameter is the first share of the first type model parameter vector of the first party, the sixth shared parameter is the second share of the first type model parameter vector of the second party, and the second party first type shared model parameters are first type model parameters of secret sharing held by the second device, wherein the second party first type shared parameters include a seventh shared parameter and an eighth shared parameter, wherein the seventh shared parameter is the second share of the first type model parameter vector of the first party, and the eighth shared parameter is the first share of the first type model parameter vector of the second party, and the first type sparse matrix secure inner product includes a third non-zero characteristic term cross inner product and The fourth non-zero characteristic item cross inner product, wherein the third non-zero characteristic item cross inner product is the cross characteristic item inner product of the first-party first type model parameter vector secretly shared in the first device and the first non-zero part, that is, the third non-zero characteristic item cross inner product is the cumulative value of the product of the first-party first type model parameter vector secretly shared in the first device and each column vector in the first non-zero part, wherein the third non-zero characteristic item cross inner product can be represented by a vector, the fourth non-zero characteristic item cross inner product is the cross characteristic item inner product of the second-party first type model parameter vector secretly shared in the first device and the second non-zero part, the fourth non-zero characteristic item cross inner product is the cumulative value of the product of the second-party first type model parameter vector secretly shared in the first device and each column vector in the second non-zero part, wherein the fourth non-zero characteristic item cross inner product can be represented by a vector.

[0052] Based on the first type of shared model parameters and the first non-zero part, a federated interaction is performed with the second device to combine the first type of shared model parameters of the second party and the second non-zero part of the second sparse matrix to calculate the secure inner product of the first type of sparse matrix. Specifically, the second device generates a third public key and a third private key corresponding to the third public key, and performs homomorphic encryption on the seventh shared parameter based on the third public key to obtain the encrypted seventh shared parameter, and sends the third public key and the encrypted seventh shared parameter to the first device, and then the first device receives the third public key and the encrypted seventh shared parameter, and then performs homomorphic encryption on the fifth shared parameter based on the third public key to obtain the encrypted fifth shared parameter. , and then calculate the sum of the encrypted fifth shared parameter and the encrypted seventh shared parameter to obtain the encrypted first-party first-type model parameter vector, and then calculate the product of the encrypted first-party first-type model parameter vector and each first non-zero column vector in the first non-zero part of the first sparse matrix to obtain the first vector product corresponding to each first non-zero column vector, wherein each row of the first sparse matrix corresponds to a sample dimension, and each column of the first sparse matrix corresponds to a feature dimension, and then accumulate the first vector products to obtain a third encrypted inner product, and then construct a third non-zero feature item cross inner product that is uniformly distributed and consistent with the feature dimension of the third encrypted inner product, and based on the third public key, the third non-zero feature item cross inner product is The cross inner product of the zero characteristic items is homomorphically encrypted to obtain the encrypted third non-zero characteristic item cross inner product, and then the difference between the third encrypted inner product and the encrypted third non-zero characteristic item cross inner product is calculated to obtain the encrypted second-party third non-zero characteristic item cross inner product, and the encrypted second-party third non-zero characteristic item cross inner product is sent to the second device, and then the second device decrypts the encrypted second-party third non-zero characteristic item cross inner product based on the third private key to obtain the second-party third non-zero characteristic item cross inner product, wherein the second-party third non-zero characteristic item cross inner product is the cross characteristic item inner product of the first-party first-type model parameter vector and the first non-zero part secretly shared in the second device, that is, the second-party third non-zero characteristic item cross inner product The inner product is the cumulative value of the product of the first-party first-type model parameter vector secretly shared in the second device and each column vector in the first non-zero part. Similarly, the first device generates a fourth public key and a fourth private key corresponding to the fourth public key, and based on the fourth public key, performs homomorphic encryption on the sixth shared parameter to obtain the encrypted sixth shared parameter, and then sends the fourth public key and the encrypted sixth shared parameter to the second device, and then the second device receives the fourth public key and the encrypted sixth shared parameter, and based on the fourth public key, performs homomorphic encryption on the eighth shared parameter to obtain the encrypted eighth shared parameter, and then calculates the encrypted sixth shared parameter and the encrypted eighth shared parameter to obtain the encrypted second-party first-type model parameter vector.Then calculate the product of the encrypted second-party first-type model parameter vector and each second non-zero column vector in the second non-zero part of the second sparse matrix to obtain the second vector product corresponding to each second non-zero column vector, wherein each row of the second sparse matrix corresponds to a sample dimension, and each column of the second sparse matrix corresponds to a feature dimension, and then accumulate each of the second vector products to obtain a fourth encrypted inner product, and then construct a second-party fourth non-zero feature item cross inner product consistent with the feature dimension of the fourth encrypted inner product, wherein the second-party fourth non-zero feature item cross inner product is the cross feature item inner product of the second-party first-type model parameter vector and the second non-zero part secretly shared in the second device, and the second-party fourth non-zero feature item cross inner product is the second-party first-type model parameter vector secretly shared in the second device. The accumulated value of the product of the model parameter vector and each column vector in the second non-zero part, and then based on the fourth public key, the second party's fourth non-zero feature item cross inner product is homomorphically encrypted to obtain the encrypted second party's fourth non-zero feature item cross inner product, and then the difference between the fourth encrypted inner product and the encrypted second party's fourth non-zero feature item cross inner product is calculated to obtain the encrypted fourth non-zero feature item cross inner product, and the encrypted fourth non-zero feature item cross inner product is sent to the first device, and then the first device receives the encrypted fourth non-zero feature item cross inner product, and decrypts the encrypted fourth non-zero feature item cross inner product to obtain the fourth non-zero feature item cross inner product, wherein the third non-zero feature item cross inner product and the fourth non-zero feature item cross inner product can be calculated at the same time or at different times. ,

[0053] Additionally, the expressions of the cross inner product of the third non-zero characteristic term and the cross inner product of the fourth non-zero characteristic term are as follows:

[0054]

[0055]

[0056] Wherein, Q1 is the cross inner product of the third non-zero characteristic term, Q2 is the cross inner product of the fourth non-zero characteristic term, and w A is the first-party first-type model parameter vector, is the first non-zero column vector, X A is the first sparse matrix, d A It means that the first sparse matrix has d A feature dimension, w B is the second-party first-type model parameter vector, is the second non-zero column vector, X B is the second sparse matrix, d B It means that the first sparse matrix has dB feature dimensions, [[]] A It indicates that the content in the brackets is secret shared data and belongs to the first device, and then the expression of the cross inner product of the third non-zero characteristic item of the second party and the cross inner product of the fourth non-zero characteristic item of the second party is as follows:

[0057]

[0058]

[0059] Wherein, Q3 is the cross inner product of the third non-zero characteristic term of the second party, Q4 is the cross inner product of the fourth non-zero characteristic term of the second party, [[]] B Indicates that the content in the brackets is secret shared data and belongs to the second device.

[0060] Additionally, the association relationship between the third non-zero feature item cross inner product and the second party third non-zero feature item cross inner product, and the association relationship between the fourth non-zero feature item cross inner product and the second party fourth non-zero feature item cross inner product are as follows:

[0061]

[0062]

[0063] Step S22: performing federated interaction with the second device based on the second type shared model parameters and the first non-zero part, so as to combine the second type shared model parameters of the second party and the second non-zero part to calculate the second type sparse matrix secure inner product;

[0064] In this embodiment, it should be noted that the second type of shared model parameters are second type model parameters of secret sharing held by the first device, wherein the second type of shared model parameters include first shared parameters and third shared parameters, wherein the first shared parameter is the second share of the second type model parameter matrix of the second party, the third shared parameter is the first share of the second type model parameter matrix of the first party, and the second type of shared model parameters of the second party are second type model parameters of secret sharing held by the second device, wherein the second type of shared parameters of the second party include second shared parameters and fourth shared parameters, wherein the second shared parameter is the first share of the second type model parameter matrix of the second party, the fourth shared parameter is the second share of the second type model parameter matrix of the first party, and the second type of sparse matrix The secure inner product includes a first non-zero feature item cross-inner product and a second non-zero feature item cross-inner product, wherein the first non-zero feature item cross-inner product is the cross-feature item inner product of the second-party second type model parameter matrix secretly shared in the first device and the second non-zero part, that is, the first non-zero feature item cross-inner product is the cumulative value of the product of each column vector in the second-party second type model parameter matrix secretly shared in the first device and each column vector in the second non-zero part, the second non-zero feature item cross-inner product is the cross-feature item inner product of the first-party second type model parameter matrix secretly shared in the first device and the first non-zero part, and the second non-zero feature item cross-inner product is the cumulative value of the product of each column vector in the first-party second type model parameter matrix secretly shared in the first device and each column vector in the first non-zero part.

[0065] Based on the second-type shared model parameters and the first non-zero part, a federal interaction is performed with the second device to jointly calculate the second-type sparse matrix security inner product with the second-party second-type shared model parameters and the second non-zero part. Specifically, based on the first shared parameter, a federal interaction is performed with the second device to jointly calculate the first non-zero feature item cross inner product with the second shared parameter and the second non-zero part, and the second device is assisted in calculating the second-party first non-zero feature item cross inner product corresponding to the first non-zero feature item cross inner product, wherein the second-party first non-zero feature item cross inner product is the cross feature item inner product of the second-party second type model parameter matrix secretly shared in the second device and the second non-zero part, that is, the second-party first non-zero feature item cross inner product is each of the second-party second type model parameter matrix secretly shared in the second device. The accumulated value of the product of the column vector and each column vector in the second non-zero part. Similarly, based on the third shared parameter and the first non-zero part, federal interaction is performed with the second device to jointly calculate the second non-zero feature item cross inner product with the fourth shared parameter, and assist the second device in calculating the second party second non-zero feature item cross inner product, wherein the second party second non-zero feature item cross inner product is the cross feature item inner product of the first party second type model parameter matrix secretly shared in the second device and the first non-zero part, and the second party second non-zero feature item cross inner product is the accumulated value of the product of each column vector in the first party second type model parameter matrix secretly shared in the second device and each column vector in the first non-zero part, wherein the first non-zero feature item cross inner product and the second non-zero feature item cross inner product can be selected to be calculated at the same time or at different times.

[0066] Additionally, the expressions of the cross inner product of the first non-zero feature term and the cross inner product of the second non-zero feature term are as follows:

[0067]

[0068]

[0069] Wherein, R1 is the cross inner product of the first non-zero characteristic term, R2 is the cross inner product of the second non-zero characteristic term, V A is the first-party second-type model parameter vector, is the first non-zero column vector, X A is the first sparse matrix, V B is the second-party second-type model parameter vector, is the second non-zero column vector, X B For the second sparse matrix, [[]] AIt indicates that the content in the brackets is secret shared data and belongs to the first device. Furthermore, the expressions of the cross inner product of the first non-zero characteristic item of the second party and the cross inner product of the second non-zero characteristic item of the second party are as follows:

[0070]

[0071]

[0072] Wherein, R3 is the cross inner product of the first non-zero characteristic term of the second party, R4 is the cross inner product of the second non-zero characteristic term of the second party, [[]] B Indicates that the content in the brackets is secret shared data and belongs to the second device.

[0073] Additionally, the association relationship between the first non-zero feature item cross inner product and the second side first non-zero feature item cross inner product, and the association relationship between the second non-zero feature item cross inner product and the second side second non-zero feature item cross inner product are as follows:

[0074]

[0075]

[0076] Step S23, based on the second type sharing model parameters, the first non-zero part and the preset secret sharing multiplication triplet, federal interaction is performed with the second device to combine the second party's second type sharing model parameters and the second non-zero part to calculate the secret sharing intermediate parameters.

[0077] In this embodiment, it should be noted that the preset secret sharing multiplication triplet is a secret sharing multiplication triplet held by the first device, and the second device holds a second party secret sharing multiplication triplet corresponding to the preset secret sharing multiplication triplet, wherein the sum of the preset secret sharing multiplication triplet and the second party secret sharing multiplication triplet is the multiplication triplet, wherein the multiplication triplet is an array of three parameters having a product relationship, for example, assuming that the multiplication triplet is (a, b, c), then it has a product relationship c=a*b.

[0078] In addition, it should be noted that the second-type sharing model parameters include the first sharing parameter, the first sharing transposition parameter corresponding to the first sharing parameter, the third sharing parameter and the second sharing transposition parameter corresponding to the third sharing parameter, wherein the first sharing transposition parameter is the second-party transposition matrix of the secret sharing held by the first device, the second sharing transposition parameter is the first-party transposition matrix of the secret sharing held by the first device, and the second-party second-type sharing model parameters include the second sharing parameter, the third sharing transposition parameter corresponding to the second sharing parameter, the fourth sharing parameter and the fourth sharing transposition parameter corresponding to the fourth sharing parameter, wherein the third sharing transposition parameter is the second-party transposition matrix of the secret sharing held by the second device, and the fourth sharing transposition parameter is the first-party transposition matrix of the secret sharing held by the second device.

[0079] In addition, it should be noted that the secret sharing intermediate parameters include the first party's first secret sharing intermediate parameters and the first party's second secret sharing intermediate parameters, wherein the first party's first secret sharing intermediate parameters are the first intermediate parameters of the secret sharing held by the first device, and the first party's second secret sharing intermediate parameters are the second intermediate parameters of the secret sharing held by the first device, wherein the first intermediate parameter is the cross inner product of the secret sharing non-zero characteristic items composed of the second party's second type model parameter matrix, the second party's transposed matrix, the second non-zero part in the second sparse matrix, and the non-zero part in the transposed matrix corresponding to the second sparse matrix, that is, each value in the first intermediate parameter is a column vector of the second party's second type model parameter matrix, the second party's transposed matrix The second intermediate parameter is the secret shared product of the column vector of the first party second type model parameter matrix, the column vector of the second non-zero part in the second sparse matrix and the column vector of the non-zero part in the transposed matrix corresponding to the second sparse matrix. Similarly, the second intermediate parameter is the cross inner product of the secret shared non-zero characteristic terms composed of the first party second type model parameter matrix, the first party transposed matrix, the first non-zero part in the first sparse matrix and the non-zero part in the transposed matrix corresponding to the first sparse matrix, that is, each numerical value in the second intermediate parameter is the secret shared product of the column vector of the first party second type model parameter matrix, the column vector of the first party transposed matrix, the column vector of the first non-zero part in the first sparse matrix and the column vector of the non-zero part in the transposed matrix corresponding to the first sparse matrix.

[0080] Based on the second type of shared model parameters, the first non-zero part and the preset secret shared multiplication triplet, a federal interaction is performed with the second device to jointly calculate the secret shared intermediate parameter by combining the second party's second type shared model parameters and the second non-zero part. Specifically, based on the preset secret shared multiplication triplet, the first shared parameter and the first shared transposed parameter, a federal interaction is performed with the second device to jointly calculate the first party's first transposed matrix inner product by combining the second party's secret shared multiplication triplet, the second shared parameter and the third shared transposed parameter, and the second device is assisted in calculating the second party's first transposed matrix inner product. Furthermore, based on the first party's first transposed matrix inner product, a federal interaction is performed with the second device to jointly calculate the first party's first secret shared intermediate parameter by combining the second party's first transposed matrix inner product and the second non-zero part. And assist the second device to calculate the second party's first secret sharing intermediate parameter. Similarly, based on the preset secret sharing multiplication triplet, the third sharing parameter and the second sharing transposed parameter, the second device is federated to interact with the second device to jointly calculate the first party's second transposed matrix inner product with the second party's secret sharing multiplication triplet, the fourth sharing parameter and the fourth sharing transposed parameter, and assist the second device to calculate the second party's second transposed matrix inner product. Then, based on the first party's second transposed matrix inner product and the first non-zero part, the second device is federated to interact with the second device to jointly calculate the first party's second secret sharing intermediate parameter with the second party's second transposed matrix inner product, and assist the second device to calculate the second party's second secret sharing intermediate parameter, wherein the expressions of the first party's first secret sharing intermediate parameter and the first party's second secret sharing intermediate parameter are as follows:

[0081]

[0082]

[0083] Wherein, T1 is the first party's first secret sharing intermediate parameter, T2 is the first party's second secret sharing intermediate parameter, V B is the second-party second-type model parameter matrix, is the column vector of the second-party second-type model parameter matrix, X B is the second sparse matrix, is the column vector of the second non-zero part in the second sparse matrix, V A is the first-party second-type model parameter matrix, is the column vector of the first-party second-type model parameter matrix, X A is the first sparse matrix, is the column vector of the first non-zero part in the first sparse matrix.

[0084] The second type sharing model parameters include a second type secret sharing parameter matrix and a secret sharing transposed parameter matrix corresponding to the second type secret sharing parameter matrix, and the second party second type sharing model parameters include a second party second type secret sharing parameter matrix and a second party secret sharing transposed parameter matrix corresponding to the second party second type sharing parameter matrix.

[0085] The step of performing federated interaction with the second device based on the second type sharing model parameter, the first non-zero part and the preset secret sharing multiplication triplet to combine the second type sharing model parameter of the second party and the second non-zero part to calculate the secret sharing intermediate parameter comprises:

[0086] Step A10: Based on the preset secret sharing multiplication triplet, by performing federated interaction with the second device, calculate the secret sharing product between the second type of secret sharing parameter matrix and the secret sharing transposed parameter matrix, and obtain the inner product of the secret sharing matrix, so that the second device can calculate the secret sharing product between the second party's second type of secret sharing parameter matrix and the second party's secret sharing transposed parameter matrix, and obtain the inner product of the second party's secret sharing matrix;

[0087] In this embodiment, it should be noted that the inner product of the secret sharing matrix includes the inner product of the first-party first transposed matrix and the inner product of the first-party second transposed matrix, the inner product of the second-party secret sharing matrix includes the inner product of the second-party first transposed matrix and the inner product of the second-party second transposed matrix, the second-type secret sharing parameter matrix includes a first sharing parameter matrix and a third sharing parameter matrix, wherein the first sharing parameter matrix is ​​a matrix representation of the first sharing parameter, the third sharing parameter matrix is ​​a matrix representation of the third sharing parameter, the secret sharing transposed parameter matrix includes a first sharing transposed parameter matrix and a second sharing transposed parameter matrix, wherein the first sharing transposed parameter matrix is ​​the first A matrix representation of shared transposed parameters, the second shared transposed parameter matrix is ​​the matrix representation of the second shared transposed parameters, the second party second type secret shared parameter matrix includes a second shared parameter matrix and a fourth shared parameter matrix, wherein the second shared parameter matrix is ​​the matrix representation of the second shared parameters, the fourth shared parameter matrix is ​​the matrix representation of the fourth shared parameters, the second party secret shared transposed parameter matrix includes a third shared transposed parameter matrix and a fourth shared transposed parameter matrix, wherein the third shared transposed parameter matrix is ​​the matrix representation of the third shared transposed parameters, and the fourth shared transposed parameter matrix is ​​the matrix representation of the fourth shared transposed parameters.

[0088] Based on the preset secret sharing multiplication triplet, the first device performs federal interaction with the second device to calculate the secret sharing product between the second type of secret sharing parameter matrix and the secret sharing transposed parameter matrix, and obtain the inner product of the secret sharing matrix, so that the second device can calculate the secret sharing product between the second party's second type of secret sharing parameter matrix and the second party's secret sharing transposed parameter matrix, and obtain the inner product of the second party's secret sharing matrix. Specifically, the first device blinds the first sharing parameter matrix and the first sharing transposed parameter matrix respectively based on the preset secret sharing multiplication triplet, and obtains the first party's first shared blinded parameter matrix and the first shared transposed parameter matrix corresponding to the first sharing parameter matrix. The second device blinds the second shared parameter matrix and the third shared transposed parameter matrix corresponding to the secret shared transposed parameter matrix. Similarly, the second device blinds the second shared parameter matrix and the third shared transposed parameter matrix based on the second party's secret shared multiplication triplet, obtains the second party's first shared blind parameter matrix corresponding to the second shared parameter matrix and the second party's second shared blind parameter matrix corresponding to the third shared transposed parameter matrix, and sends the second party's first shared blind parameter matrix and the second party's second shared blind parameter matrix to the first device, and then the first device calculates the sum of the first party's first shared blind parameter matrix and the second party's first shared blind parameter matrix to obtain the first blind parameter matrix, and calculates the first party The second blind parameter matrix is ​​obtained by calculating the sum of the second shared blind parameter matrix and the second shared blind parameter matrix of the second party, and the first blind parameter matrix of the first party is sent to the second device, and then the second device calculates the sum of the first shared blind parameter matrix of the first party and the first shared blind parameter matrix of the second party to obtain the first blind parameter matrix, calculates the sum of the first shared blind parameter matrix of the first party and the second shared blind parameter matrix of the second party to obtain the second blind parameter matrix, and further, the first device calculates the preset secret shared multiplication triplet, the first blind parameter matrix and the second blind parameter matrix based on the preset first-party transposed matrix inner product calculation formula. The first party first transposed matrix inner product corresponding to the first blinded parameter matrix is ​​calculated by the second device based on the preset second party transposed matrix inner product calculation formula. Further, the first device blinds the third shared parameter matrix and the second shared transposed parameter matrix respectively based on the preset secret shared multiplication triplet to obtain the first party third shared blinded parameter matrix corresponding to the third shared parameter matrix and the first party fourth shared blinded parameter matrix corresponding to the second shared transposed parameter matrix. Similarly, the second device is based on the second party secret shared multiplication triplet.The fourth shared parameter matrix and the fourth shared transposed parameter matrix are blinded respectively to obtain a second-party third shared blind parameter matrix corresponding to the fourth shared parameter matrix and a second-party fourth shared blind parameter matrix corresponding to the fourth shared transposed parameter matrix, and the second-party third shared blind parameter matrix and the second-party fourth shared blind parameter matrix are sent to the first device, and then the first device calculates the sum of the first-party third shared blind parameter matrix and the second-party third shared blind parameter matrix to obtain a third blind parameter matrix, calculates the sum of the first-party fourth shared blind parameter matrix and the second-party fourth shared blind parameter matrix to obtain a fourth blind parameter matrix, and sends the first-party third shared blind parameter matrix and the first-party fourth shared blind parameter matrix to the second device, and then the second device calculates the first-party third shared blind parameter matrix. The third blind parameter matrix is ​​obtained by calculating the sum of the shared blind parameter matrix of the first party and the third shared blind parameter matrix of the second party, and the fourth blind parameter matrix is ​​obtained by calculating the sum of the fourth shared blind parameter matrix of the first party and the fourth shared blind parameter matrix of the second party, and the fourth blind parameter matrix is ​​obtained. Further, the first device calculates the inner product of the first-party second transposed matrix corresponding to the preset secret shared multiplication triplet, the third blind parameter matrix and the fourth blind parameter matrix based on the preset first-party transposed matrix inner product calculation formula. Similarly, the second device calculates the inner product of the second-party second transposed matrix corresponding to the second-party secret shared multiplication triplet, the third blind parameter matrix and the fourth blind parameter matrix based on the preset second-party transposed matrix inner product calculation formula, wherein the preset first-party first transposed matrix inner product calculation formula and the preset second-party first transposed matrix inner product formula are as follows:,

[0089] [[x*y]] A =f*[[a]] A +e*[[b]] A +[[c]] A

[0090] [[x*y]] B =e*f+f*[[a]] B +e*[[b]] B +[[c]] B

[0091] Where [[x*y]] A is the inner product of the first square and the first transposed matrix, [[x*y]] B is the inner product of the first transposed matrix of the second party, e is the first blinding parameter matrix, f is the second blinding parameter matrix, the multiplication triple is (a, b, c), where c = a*b, and the preset secret sharing multiplication triple is ([[a]] A ,[[b]] A, [[c]] A ), the second party secret shared multiplication triple is ([[a]] B ,[[b]] B , [[c]] B ), for example, in an implementable solution, the inner product of the first-side first transposed matrix and the inner product of the second-side first transposed matrix are calculated as follows:

[0092] First, assume that the first device has the secret shared multiplication triple ([[a]] A ,[[b]] A , [[c]] A ), the second device possesses the second party secret shared multiplication triplet ([[a]] B ,[[b]] B , [[c]] B ), where [[a]] A +[[a]] B =a,[[b]] A +[[b]] B =b,[[c]] A +[[c]] B =c, c=a*b, and the first shared parameter matrix is ​​[[x]] A , the first shared transposed parameter matrix is ​​[[y]] A , the second shared parameter matrix in the second device is [[x]] B , the third shared transposed parameter matrix is ​​[[y]] B , where [[x]] A +[[x]] B =x,[[y]] A +[[y]] B =y, then the first shared blinding parameter matrix of the first party that the first device needs to calculate is [[x*y]] A , the second device calculates the first party's first shared blinding parameter matrix as [[x*y]] B , and must satisfy [[x*y]] A +[[x*y]] B =x*y, specifically, the calculation process is as follows:

[0093] First, the first device calculates [[e]] A =[[x]] A -[[a]] A and [[f]] A =[[y]] A -[[b]] A , the second device calculates [[e]] B =[[x]]B -[[a]] B and [[f]] B =[[y]] B -[[b]] B , and then the first device will [[e]] A and [[f]] A Send to the second device, the second device will [[e]] B and [[f]] B Send to the second device, so that the first device and the second device both obtain e=xa and f=yb, and then the first device calculates [[x*y]] A =f*[[a]] A +e*[[b]] A +[[c]] A , the second device calculates [[x*y]] B =e*f+f*[[a]] B +e*[[b]] B +[[c]] B , and then [[x*y]] A +[[x*y]] B =e*f+f*a+e*b+c, and then substitute e=xa and f=yb into the calculation expression to obtain [[x*y]] A +[[x*y]] B =x*y.

[0094] Step A20, based on the inner product of the secret sharing matrix and the first non-zero part, perform federal interaction with the second device to combine the inner product of the second party's secret sharing matrix and the second non-zero part to calculate the secret sharing intermediate parameter.

[0095] In this embodiment, it should be noted that the secret sharing intermediate parameters include a first-party first secret sharing intermediate parameter matrix and a first-party second secret sharing intermediate parameter matrix, wherein the first-party first secret sharing intermediate parameter matrix is ​​a matrix representation of the first-party first secret sharing intermediate parameters, and the first-party second secret sharing intermediate parameter matrix is ​​a matrix representation of the first-party second secret sharing intermediate parameters, and the second device obtains the second-party secret sharing intermediate parameters through federal interaction, wherein the second-party secret sharing intermediate parameters include a second-party first secret sharing intermediate parameter matrix and a second-party second secret sharing intermediate parameter matrix, wherein the second-party first secret sharing intermediate parameter matrix is ​​a matrix representation of the second-party first secret sharing intermediate parameters, and the second-party second secret sharing intermediate parameter matrix is ​​a matrix representation of the second-party second secret sharing intermediate parameters.

[0096] Based on the inner product of the secret sharing matrix and the first non-zero part, a federated interaction is performed with the second device to combine the inner product of the second party's secret sharing matrix and the second non-zero part to calculate the secret sharing intermediate parameter, specifically, a fifth public key and a fifth private key corresponding to the fifth public key are generated, and based on the fifth public key, the inner product of the first party's first transposed matrix is ​​homomorphically encrypted to obtain the inner product of the encrypted first party's first transposed matrix, and the fifth public key and the inner product of the encrypted first party's first transposed matrix are sent to the second device, and then the second device performs homomorphic encryption on the inner product of the second party's first transposed matrix based on the fifth public key to obtain the inner product of the encrypted second party's first transposed matrix, and calculates the encrypted first party's first transposed matrix The inner product of the encrypted second square first transposed matrix is ​​obtained by calculating the inner product of the encrypted first transposed matrix, wherein the inner product of the encrypted first transposed matrix is ​​a vector, and then the second device generates the transposed matrix corresponding to the second sparse matrix to obtain the second sparse transposed matrix, and then calculates the first intermediate parameter product between each numerical value in the inner product of the encrypted transposed matrix, each non-zero column vector of the second sparse matrix and each non-zero column vector of the second sparse transposed matrix to obtain the first encrypted intermediate parameter inner product, wherein the first intermediate parameter inner product is the cumulative value of each of the first intermediate parameter products, and each numerical value in the inner product of the encrypted transposed matrix, each non-zero column vector of the second sparse matrix and each non-zero column vector of the second sparse transposed matrix The three vectors correspond one to one, and then in the preset first vector space, a vector consistent with the characteristic dimension of the second sparse matrix is ​​constructed as the inner product of the second-party first transposed matrix, and based on the fifth public key, the inner product of the second-party first transposed matrix is ​​homomorphically encrypted to obtain the encrypted second-party first transposed matrix inner product, and then the difference between the first encrypted intermediate parameter inner product and the encrypted second-party second transposed matrix inner product is calculated to obtain the encrypted first-party first transposed matrix inner product, and the encrypted first-party first transposed matrix inner product is sent to the first device, and then the first device decrypts the encrypted first-party first transposed matrix inner product based on the fifth private key to obtain the first-party first transposed matrix inner product. In addition, the second device generates a sixth public key. The first device performs homomorphic encryption on the inner product of the second-party second transposed matrix based on the sixth private key to obtain the encrypted inner product of the second-party second transposed matrix, and sends the encrypted inner product of the second-party second transposed matrix and the sixth public key to the first device, and then the first device performs homomorphic encryption on the inner product of the first-party second transposed matrix based on the sixth public key to obtain the encrypted inner product of the first-party second transposed matrix, and then calculates the sum of the encrypted inner product of the second-party second transposed matrix and the encrypted inner product of the first-party second transposed matrix to obtain the encrypted inner product of the second transposed matrix, wherein the encrypted inner product of the second transposed matrix is ​​a vector, and then generates the transposed matrix corresponding to the first sparse matrix to obtain the first sparse transposed matrix,And calculate the second intermediate parameter product between each value in the inner product of the encrypted second transposed matrix, each non-zero column vector in the first sparse matrix and each non-zero column vector in the first sparse transposed matrix, and obtain the second encrypted intermediate parameter inner product, wherein the second encrypted intermediate parameter inner product is the cumulative value of each second intermediate parameter product, and each value in the inner product of the encrypted second transposed matrix, each non-zero column vector in the first sparse matrix and each non-zero column vector in the first sparse transposed matrix correspond one to one, and then in the preset second vector space, construct The vector with the same characteristic dimension of the matrix is ​​used as the inner product of the first-party second transposed matrix, and the inner product of the first-party second transposed matrix is ​​homomorphically encrypted based on the sixth public key to obtain the encrypted inner product of the first-party second transposed matrix, and then the difference between the inner product of the second encrypted intermediate parameter and the inner product of the encrypted first-party second transposed matrix is ​​calculated to obtain the encrypted inner product of the second-party second transposed matrix, and the encrypted inner product of the second-party second transposed matrix is ​​sent to the second device, and then the second device decrypts the encrypted inner product of the second-party second transposed matrix based on the sixth private key to obtain the inner product of the second-party second transposed matrix. ,

[0097] Step S24, based on the first type of sparse matrix secure inner product, the second sparse matrix secure inner product, the secret sharing intermediate parameter and the preset weight information, calculate the secret sharing classification model error through the preset secret sharing classification model error calculation formula.

[0098] In this embodiment, it should be noted that the secret sharing parameter items include the first-party first model output of secret sharing, the first-party second model output of secret sharing and the sample label of secret sharing, the first type of sparse matrix secure inner product includes the third non-zero feature item cross-inner product and the fourth non-zero feature item cross-inner product, the second type of sparse matrix secure inner product includes the first non-zero feature item cross-inner product and the second non-zero feature item cross-inner product, and the secret sharing intermediate parameters include the first-party first secret sharing intermediate parameters and the first-party second secret sharing intermediate parameters.

[0099] Based on the first type of sparse matrix security inner product, the second sparse matrix security inner product, the secret sharing intermediate parameter and the preset weight information, the secret sharing classification model error is calculated by using a preset secret sharing classification model error calculation formula. Specifically, based on the model output calculation formula, the first party first model output of the secret sharing corresponding to the fourth non-zero feature item cross inner product, the first non-zero feature item cross inner product and the first party first secret sharing intermediate parameter is calculated, and the first party second model output of the secret sharing corresponding to the third non-zero feature item cross inner product, the second non-zero feature item cross inner product and the first party second secret sharing intermediate parameter is calculated, and then the first party first model output based on the secret sharing, the first party second model output of the secret sharing and the sample label of the secret sharing held by the first device are substituted into the preset secret sharing classification model error calculation formula to calculate the secret sharing classification model error, wherein the calculation expression of the first party first model output of the secret sharing is as follows:

[0100]

[0101] Among them, [[f(X B )]] A The first model output for the first party of secret sharing, is the cross inner product of the fourth non-zero characteristic term, is the cross inner product of the first non-zero feature term, is the first party's first secret sharing intermediate parameter, and the calculation expression of the first party's second model output of the secret sharing is as follows:

[0102]

[0103] Among them, [[f(X A )]] A The output of the second model for the first party of secret sharing is, is the cross inner product of the third non-zero characteristic term, is the cross inner product of the second non-zero characteristic term, is the first party's second secret sharing intermediate parameter, and the calculation expression of the secret sharing classification model error is as follows:

[0104]

[0105] Where Y is the sample label, [[αf(X A , X B )-βY]] A is the secret sharing classification model error, wherein α and β are the calculation weight proportions in the preset weight information, preferably, α is 1 / 4, and β is 1 / 2.

[0106] Similarly, the second device calculates the second-party first model output of the secret sharing and the second-party second model output of the secret sharing, and substitutes the second-party first model output of the secret sharing, the second-party second model output of the secret sharing and the sample label of the secret sharing held by the self-party into the preset secret sharing classification model error calculation formula to calculate the second-party secret sharing classification model error, wherein the calculation expression of the second-party first model output of the secret sharing is as follows:

[0107]

[0108] Among them, [[f(X B )]] B The output of the first model for the second party of secret sharing, is the cross inner product of the fourth non-zero characteristic term of the second party, is the cross inner product of the first non-zero characteristic term of the second party, is the first secret shared intermediate parameter of the second party, and the calculation expression of the second model output of the second party is as follows:

[0109]

[0110] Among them, [[f(X A )]] B The second model output for the second party of secret sharing, is the cross inner product of the third non-zero characteristic term of the second party, is the cross inner product of the second non-zero characteristic term of the second party, is the second party second secret sharing intermediate parameter, and then the calculation expression of the second party secret sharing classification model error is as follows:

[0111]

[0112] Where Y is the sample label, [[α0f(X A , X B )-β0Y]] B is the second-party secret sharing classification model error, wherein α0 and β0 are the calculation weight ratios in the preset weight information of the second device, preferably, α0 takes a value of 1 / 4, and β0 takes a value of 1 / 2.

[0113] Step S30: Based on the secret sharing classification model error, the classification model to be trained is updated to obtain a vertical federated factorization machine classification model.

[0114] In this embodiment, it should be noted that the vertical federated factorization machine classification model includes a first target model parameter belonging to the first device and a second target model parameter belonging to the second device.

[0115] Based on the secret sharing classification model error, the classification model to be trained is updated to obtain a vertical federated factorization machine classification model. Specifically, based on the secret sharing classification model error, the secret sharing initial model parameters are updated to obtain secret sharing initial update parameters, and the second device updates the second party secret sharing initial model parameters based on the second party secret sharing classification model error to obtain the second party secret sharing initial update parameters, and determines whether the secret sharing initial update parameters meet the preset iterative update end conditions. If so, the first device uses the secret sharing initial update parameters as secret sharing update parameters, and the second device uses the second party secret sharing initial update parameters as second party secret sharing update parameters. Then, based on the secret sharing update parameters, the first device performs decryption interaction with the second device to jointly determine the first target model parameters with the second party secret sharing update parameters, and assist the second device in determining the second target model parameters, wherein the second device provides the second party secret sharing update parameters when performing decryption interaction, and the preset iterative update end conditions include loss function convergence and reaching a maximum iteration number threshold.

[0116] The step of updating the classification model to be trained based on the secret sharing classification model error to obtain the vertical federated factorization machine classification model includes:

[0117] Step S31, based on the secret sharing classification model error, updating the secret sharing initial model parameters to obtain secret sharing update parameters;

[0118] In this embodiment, it should be noted that, based on the secret sharing classification model error, the secret sharing initial model parameters are updated to obtain secret sharing update parameters. Specifically, the gradient information of the secret sharing classification model error with respect to the secret sharing initial model parameters is calculated respectively, and then based on the gradient information, the secret sharing initial model parameters are iteratively updated until the iteratively updated secret sharing initial model parameters reach a preset iterative update end condition, and the secret sharing update parameters are obtained, wherein, in a scheme of an illustrative embodiment, the gradient information includes a first type of gradient, a second type of gradient, a third type of gradient and a fourth type of gradient, wherein the calculation expression of the first type of gradient is as follows:

[0119]

[0120] Where D1 is the first type of gradient, θ is a hyperparameter whose size can be set by yourself and is used to control the value range of the gradient, and w A is the first-party first-type model parameter vector, [[w A ]] AThe first-party first-type model parameter vector held by the first device for secret sharing, in addition, the calculation expression of the second-type gradient is as follows:

[0121]

[0122] Where D2 is the second type of gradient, θ is a hyperparameter whose size can be set by yourself and is used to control the value range of the gradient, V A is the first-party second-type model parameter matrix, [[V A ]] A The first party second type model parameter matrix held by the first device for secret sharing, further, the calculation expression of the third type gradient is as follows:

[0123]

[0124] Where D3 is the third type of gradient, θ is a hyperparameter whose size can be set by yourself and is used to control the value range of the gradient, and w B is the second party first type model parameter vector, [[w B ]] A The first type model parameter vector of the second party held by the first device for secret sharing, in addition, the calculation expression of the fourth type gradient is as follows:

[0125]

[0126] Where D4 is the fourth type of gradient, θ is a hyperparameter whose size can be set by yourself and is used to control the value range of the gradient, V B is the second-party second-type model parameter matrix, [[V B ]] A A second party second type model parameter matrix held by the second device for secret sharing.

[0127] In addition, it should be noted that the second device can calculate the gradient information of the second-party secret sharing classification model error with respect to the second-party secret sharing initial model parameters, and based on the gradient information, iteratively update the second-party secret sharing initial model parameters until the preset iterative training end conditions are reached to obtain the second-party secret sharing update parameters.

[0128] Furthermore, based on the gradient information, the calculation expression for updating the parameters of the secret sharing initial model is as follows:

[0129]

[0130]

[0131]

[0132]

[0133] Among them, δ1, δ2, δ3 and δ4 are pre-set learning rates. an updated model parameter corresponding to the first-party first-type model parameter vector of the secret share held by the first device, an updated model parameter corresponding to the first party second type model parameter matrix of the secret share held by the first device, an updated model parameter corresponding to the second party first type model parameter vector of the secret share held by the first device, The updated model parameters correspond to the second-party second-type model parameter matrix of the secret share held by the first device.

[0134] Step S32: Based on the secret sharing update parameter, perform decryption interaction with the second device to obtain the first target model parameter, so that the second device can obtain the second target model parameter.

[0135] In this embodiment, based on the secret sharing update parameters, decryption interaction is performed with the second device to obtain the first target model parameters, so that the second device can obtain the second target model parameters. Specifically, based on the secret sharing update parameters, decryption interaction is performed with the second device to calculate the first target model parameters in conjunction with the second party secret sharing update parameters in the second device, wherein when performing the decryption interaction, the second device will calculate the second target model parameters based on the second party secret sharing update parameters in conjunction with the secret sharing update parameters in the first device.

[0136] The secret shared update parameters include a first shared first-party model update parameter and a first shared second-party model update parameter.

[0137] The step of performing decryption interaction with the second device based on the secret sharing update parameter to obtain the first target model parameter so that the second device can obtain the second target model parameter includes:

[0138] Step S321, sending the first shared second-party model update parameter to the second device, so that the second device calculates the second target model parameter based on the determined second shared second-party model update parameter and the first shared second-party model update parameter;

[0139] In this embodiment, it should be noted that the first shared first-party model update parameter is the first-party model update parameter held by the secret shared first device, the first shared second-party model update parameter is the second-party model update parameter held by the secret shared first device, and the second shared second-party model update parameter is the second-party model update parameter held by the secret shared second device.

[0140] The first shared second-party model update parameter is sent to the second device so that the second device calculates the second target model parameter based on the determined second shared second-party model update parameter and the first shared second-party model update parameter. Specifically, the first shared second-party model update parameter is sent to the second device so that the second device calculates the sum of the second shared second-party model update parameter and the first shared second-party model update parameter to obtain the second target model parameter.

[0141] Step S322: Receive second shared first-party model update parameters sent by the second device, and calculate the first target model parameters based on the second shared first-party model update parameters and the first shared first-party model update parameters.

[0142] In this embodiment, it should be noted that the second shared first-party model update parameter is a first-party model update parameter held by the secret-shared second device.

[0143] Receive the second shared first-party model update parameter sent by the second device, and calculate the first target model parameter based on the second shared first-party model update parameter and the first shared first-party model update parameter. Specifically, receive the second shared first-party model update parameter sent by the second device, and calculate the sum of the second shared first-party model update parameter and the first shared first-party model update parameter to obtain the first target model parameter.

[0144] The vertical federated factor decomposition machine classification model includes a recommendation model for personalized recommendation. Compared with the existing vertical federated learning method, the present application combines the secret sharing mechanism and the homomorphic encryption method when constructing the vertical federated factor decomposition machine classification model based on vertical federated learning to calculate the cross inner product of non-zero feature items, thereby reducing the calculation process of the zero part in the sparse matrix, reducing the computational complexity when constructing the factor decomposition machine classification model based on the sparse matrix, and thus improving the computational efficiency when constructing the factor decomposition machine classification model. Moreover, since the vertical federated factor decomposition machine classification model is constructed based on vertical federated learning modeling, the feature richness of the training samples when constructing the vertical federated factor decomposition machine classification model is higher, and thus the model performance of the vertical federated factor decomposition machine classification model will be better, and thus the personalized recommendation effect of the vertical federated factor decomposition machine classification model as a recommendation model will be better.

[0145] The embodiment of the present application provides a method for constructing a factor decomposition machine classification model. Compared with the technical means of using a homomorphic encryption-based method for federated learning in the prior art, the embodiment of the present application performs secret sharing with a second device after obtaining the initialization model parameters and the first sparse data corresponding to the classification model to be trained, so that the first device obtains the secret shared initial model parameters, and the second device obtains the second party's secret shared initial model parameters, and then based on the first non-zero part of the first sparse data, the secret shared initial model parameters and the preset weight information, performs a federated interaction with the second device to calculate the secret shared classification model error, wherein, when performing the federated interaction, only the secret shared initial model parameters are used. The first non-zero part of the first sparse data and the second non-zero part of the second sparse data are calculated, thereby reducing the calculation process of the zero part in the first sparse data and the second sparse data, so that the calculation amount, calculation complexity and data transmission volume in the federated interaction process are greatly reduced, and then based on the secret sharing classification model error, the classification model to be trained is updated to obtain the vertical federated factor decomposition machine classification model, which overcomes the technical defects of low computational efficiency in the prior art when constructing a factor decomposition machine classification model based on federated learning through homomorphic encryption due to the large sparse matrix, thereby improving the computational efficiency when constructing a factor decomposition machine classification model.

[0146] Further, refer to Figure 2 Based on the first embodiment of the present application, in another embodiment of the present application, the second type of sparse matrix safety inner product includes a first non-zero characteristic item cross inner product and a second non-zero characteristic item cross inner product,

[0147] The step of performing federated interaction with the second device based on the second type shared model parameter and the first non-zero part to combine the second type shared model parameter and the second non-zero part of the second party to calculate the second type sparse matrix secure inner product includes:

[0148] Step B10: performing federated interaction with the second device based on the second type shared model parameter to calculate a cross inner product between the second type shared model parameter and the second non-zero part to obtain a cross inner product of the first non-zero feature item;

[0149] In this embodiment, it should be noted that the second-type shared model parameter includes a first shared parameter, wherein the first shared parameter is a second-party second-type model parameter matrix held by a first device for secret sharing, that is, the first shared parameter is a second share of the second-party second-type model parameter matrix, and the second-party second-type shared model parameter includes a second shared parameter, wherein the second shared parameter is a second-party second-type model parameter matrix held by a second device for secret sharing, that is, the second shared parameter is a first share of the second-party second-type model parameter matrix. For example, assuming that the second-party second-type shared model parameter is V B , construct V B =[[V B ]] A +[[V B ]] B , then [[V B ]] A is the first shared parameter, [[V B ]] B is the second shared parameter.

[0150] Based on the second type of shared model parameters, a federal interaction is performed with the second device to calculate the cross inner product between the second type of shared model parameters and the second non-zero part, and obtain the cross inner product of the first non-zero characteristic item. Specifically, a homomorphically encrypted first public-private key pair is generated, wherein the first public-private key pair includes a first public key and a first private key, and then based on the first public key, the first shared parameter is homomorphically encrypted to obtain an encrypted first shared parameter, and then the encrypted first shared parameter and the first public key are sent to the second device, and then the second device can perform homomorphic encryption on the second shared parameter based on the first public key to obtain an encrypted second shared parameter, and then calculate the sum of the first encrypted shared parameter and the second encrypted shared parameter to obtain the encrypted second party second type model parameter matrix of this round of iteration, and then The encrypted second-party second-type model parameter matrix and the non-zero feature item cross inner product of the second non-zero part are obtained to obtain the second encrypted inner product, and then based on the first target feature dimension of the second-party second-type model parameter matrix, a uniformly distributed second-party first non-zero feature item cross inner product in the first target feature dimension is generated, and based on the first public key, the second-party first non-zero feature item cross inner product is homomorphically encrypted to obtain the encrypted second-party first non-zero feature item cross inner product, and based on the second encrypted inner product and the second-party first non-zero feature item cross inner product, the encrypted first non-zero feature item cross inner product is calculated, and the encrypted first non-zero feature item cross inner product is sent to the first device, and the first device can decrypt the encrypted first non-zero feature item cross inner product based on the first private key to obtain the first non-zero feature item cross inner product.

[0151] The second type of shared model parameters include first shared parameters, and the second party second type of shared model parameters include second shared parameters.

[0152] The step of performing federated interaction with the second device based on the second type shared model parameter to calculate the cross inner product between the second type shared model parameter and the second non-zero part to obtain the cross inner product of the first non-zero feature item includes:

[0153] Step B11, generating a first public key, and encrypting the first shared parameter based on the first public key to obtain an encrypted first shared parameter;

[0154] In this embodiment, it should be noted that the encryption method includes homomorphic encryption.

[0155] Step B12, sending the first public key and the encrypted first shared parameter to the second device, so that the second device can determine the cross inner product of the second party's first non-zero feature item and the cross inner product of the encrypted first non-zero feature item based on the first public key, the encrypted first shared parameter, the second shared parameter and the second non-zero part;

[0156] In this embodiment, the first public key and the encrypted first shared parameter are sent to the second device, so that the second device can determine the cross inner product of the second party's first non-zero characteristic item and the cross inner product of the encrypted first non-zero characteristic item based on the first public key, the encrypted first shared parameter, the second shared parameter and the second non-zero part. Specifically, the encrypted first shared parameter and the first public key are sent to the second device, and then the second device can perform homomorphic encryption on the second shared parameter based on the first public key to obtain the encrypted second shared parameter, and then calculate the sum of the first encrypted shared parameter and the second encrypted shared parameter to obtain the encrypted second party second type model parameter matrix of this iteration. Further, calculate The products of each column vector in the encrypted second-party second-type model parameter matrix and each column vector in the second non-zero part are obtained pairwise to obtain the products of each first vector, and then the products of each first vector are accumulated to obtain the second encrypted inner product, and then a vector that is consistent with the characteristic dimension of the second-party second-type model parameter matrix and uniformly distributed is generated as the cross inner product of the second-party first non-zero feature items, and based on the first public key, the cross inner product of the second-party first non-zero feature items is homomorphically encrypted to obtain the cross inner product of the encrypted second-party first non-zero feature items, and then the difference between the second encrypted inner product and the cross inner product of the encrypted second-party first non-zero feature items is calculated to obtain the encrypted first non-zero feature item cross inner product.

[0157] Step B13, receiving the encrypted first non-zero feature item cross inner product sent by the second device, and decrypting the encrypted first non-zero feature item cross inner product based on the first private key corresponding to the first public key to obtain the first non-zero feature item cross inner product.

[0158] Step B20: Based on the first non-zero part, perform a federated interaction with the second device to calculate the cross inner product between the first non-zero part and the second type shared model parameter of the second party to obtain the cross inner product of the second non-zero feature item.

[0159] In this embodiment, it should be noted that the third shared parameter is the first-party second-type model parameter matrix held by the first device of secret sharing, that is, the third shared parameter is the first share of the first-party second-type model parameter matrix, and the fourth shared parameter is the first-party second-type parameter matrix held by the second device of secret sharing, that is, the fourth shared parameter is the second share of secret sharing. For example, assuming that the first-party second-type shared model parameter is V A , construct V A =[[V A ]] A +[[V A ]] B , then [[V A ]] A is the third shared parameter, [[V A ]] B is the fourth shared parameter.

[0160] Based on the first non-zero part, a federal interaction is performed with the second device to calculate the cross inner product between the first non-zero part and the second-party second-type shared model parameter to obtain the second non-zero characteristic item cross inner product. Specifically, the second device generates a second public-private key pair, wherein the public-private key pair includes a second private key and a second public key, and then based on the second public key, the fourth shared parameter is encrypted to obtain an encrypted fourth shared parameter, and the second public key and the encrypted fourth shared parameter are sent to the first device, and then the first device encrypts the third shared parameter based on the second public key to obtain an encrypted third shared parameter, and then based on the encrypted third shared parameter and the encrypted fourth shared parameter, the encrypted first-party second-type model parameter matrix is ​​calculated, and then the encrypted first-party second-type model parameter matrix is ​​calculated. The first encrypted inner product is obtained by constructing a cross inner product of the non-zero characteristic items of the model parameter matrix and the first non-zero part. Furthermore, based on the second target characteristic dimension of the encrypted first-party second type model parameter matrix, a second non-zero characteristic item cross inner product that is uniformly distributed and is in the second target characteristic dimension is constructed, and based on the second public key, the second non-zero characteristic item cross inner product is encrypted to obtain an encrypted second non-zero characteristic item cross inner product, and then based on the first encrypted inner product and the encrypted second non-zero characteristic item cross inner product, an encrypted second party second non-zero characteristic item cross inner product is obtained, and the encrypted second party second non-zero characteristic item cross inner product is sent to the second device, and then the second device decrypts the encrypted second party second non-zero characteristic item cross inner product based on the second private key to obtain the second party second non-zero characteristic item cross inner product.

[0161] The second type of shared model parameters include a third shared parameter, and the second party second type of shared model parameters include a fourth shared parameter.

[0162] The step of performing federated interaction with the second device based on the first non-zero part to calculate the cross inner product between the first non-zero part and the second type shared model parameter of the second party to obtain the cross inner product of the second non-zero feature item includes:

[0163] Step B21, receiving the second public key and the encrypted fourth shared parameter sent by the second device, wherein the encrypted fourth shared parameter is the fourth shared parameter encrypted by the second device based on the second public key;

[0164] In this embodiment, the method by which the second device encrypts the fourth shared parameter includes homomorphic encryption.

[0165] Step B22, calculating the cross inner product of the second non-zero characteristic term and the cross inner product of the encrypted second party second non-zero characteristic term based on the second public key, the encrypted fourth shared parameter, the first non-zero part and the third shared parameter;

[0166] In this embodiment, based on the second public key, the encrypted fourth shared parameter, the first non-zero part and the third shared parameter, the second non-zero feature item cross inner product and the encrypted second party second non-zero feature item cross inner product are calculated. Specifically, based on the second public key, the third shared parameter is homomorphically encrypted to obtain the encrypted third shared parameter, and then based on the encrypted third shared parameter and the encrypted fourth shared parameter, the encrypted first party second type model parameter matrix is ​​calculated, and then the encrypted first party second type model parameter matrix and the non-zero feature item cross inner product of the first non-zero part are calculated to obtain the first encrypted inner product. Further, based on the second target feature dimension of the encrypted first party second type model parameter matrix, a uniformly distributed second non-zero feature item cross inner product in the second target feature dimension is constructed, and based on the second public key, the second non-zero feature item cross inner product is encrypted to obtain the encrypted second non-zero feature item cross inner product, and then based on the first encrypted inner product and the encrypted second non-zero feature item cross inner product, the encrypted second party second non-zero feature item cross inner product is obtained.

[0167] The step of calculating the cross inner product of the second non-zero feature item and the cross inner product of the encrypted second non-zero feature item of the second party based on the second public key, the encrypted fourth shared parameter, the first non-zero part and the third shared parameter comprises:

[0168] Step B221: encrypt the third shared parameter based on the second public key to obtain the encrypted third shared parameter, and calculate the encryption model parameter corresponding to the encrypted third shared parameter and the encrypted fourth shared parameter;

[0169] In this embodiment, it should be noted that the encrypted model parameter is the sum of the encrypted third shared parameter and the encrypted fourth shared parameter, and the encrypted model parameter is the encrypted first-party second-type model parameter matrix.

[0170] Step B222, calculating the cross inner products between each column vector in the encrypted model parameter and each column vector in the first non-zero part, to obtain the first encrypted inner product;

[0171] In this embodiment, the cross inner products between each column vector in the encrypted model parameter and each column vector in the first non-zero part are calculated to obtain the first encrypted inner product. Specifically, the products between each column vector in the encrypted model parameter and each column vector in the first non-zero part are calculated to obtain each second vector product, and then the second vector products are accumulated to obtain the first encrypted inner product. In another feasible scheme, the second vector products can be aggregated into a vector to obtain the first encrypted inner product.

[0172] Step B223, constructing the second non-zero feature item cross inner product based on the feature dimension of the encryption model parameter, and calculating the encrypted second non-zero feature item cross inner product corresponding to the second non-zero feature item cross inner product and the first encrypted inner product;

[0173] In this embodiment, based on the characteristic dimension of the encryption model parameters, the second non-zero feature item cross inner product is constructed, and the encrypted second party second non-zero feature item cross inner product corresponding to the second non-zero feature item cross inner product and the first encrypted inner product is calculated. Specifically, a uniformly distributed vector consistent with the characteristic dimension of the encryption model parameters is constructed as the second non-zero feature item cross inner product, and then based on the second public key, the second non-zero feature item cross inner product is homomorphically encrypted to obtain the encrypted second non-zero feature item cross inner product, and based on the difference between the first encrypted inner product and the encrypted second non-zero feature item cross inner product, the encrypted second party second non-zero feature item cross inner product is obtained.

[0174] Step B23, sending the encrypted second-party second non-zero characteristic item cross inner product to the second device, so that the second device decrypts the encrypted second-party second non-zero characteristic item cross inner product based on the second private key corresponding to the second public key to obtain the second-party second non-zero characteristic item cross inner product.

[0175] In this embodiment, it should be noted that the second public key and the second private key are a homomorphically encrypted public-private key pair.

[0176] This embodiment provides a method for calculating the secure inner product of a second type of sparse matrix of secret sharing based on a method combining secret sharing and homomorphic encryption, that is, based on the second type of shared model parameters, a federal interaction is performed with the second device to calculate the cross inner product between the second type of shared model parameters and the second non-zero part, and the first non-zero feature item cross inner product is obtained, and based on the first non-zero part, a federal interaction is performed with the second device to calculate the cross inner product between the first non-zero part and the second type of shared model parameters of the second party, and the second non-zero feature item cross inner product is obtained, wherein only the first sparse data is used in the whole process The first non-zero part and the second non-zero part of the second sparse data are calculated, thereby reducing the calculation process of the zero part in the first sparse data and the second sparse data. The proportion of zero parts in sparse data is usually much larger than the non-zero part, thereby greatly reducing the amount of calculation, calculation complexity and data transmission volume in the federated interaction process. Compared with the prior art that uses a technical means based on homomorphic encryption for federated learning, it overcomes the technical defect of low computational efficiency in the prior art when constructing a factor decomposition machine classification model based on federated learning through a homomorphic encryption method due to the large sparse matrix, thereby improving the computational efficiency when constructing a factor decomposition machine classification model.

[0177] Further, refer to Figure 3 Based on the first and second embodiments of the present application, in another embodiment of the present application, the click rate prediction method is applied to a first device, and the click rate prediction method includes:

[0178] Step C10, obtaining sparse data of the user to be predicted from the first party, and performing secret sharing with the second device to obtain secret sharing model parameters;

[0179] In this embodiment, it should be noted that the second device includes second-party user sparse data to be predicted, the second-party user sparse data to be predicted is a second sparse matrix corresponding to multiple user data, and the first-party user sparse data to be predicted is a first sparse matrix corresponding to multiple user data, wherein each vector of the first sparse matrix and each vector in the second sparse matrix are encoding vectors of user data to be predicted for one user, and the encoding values ​​in the first sparse matrix and the encoding values ​​in the first sparse matrix are mostly 0. For example, the first sparse matrix represents the click results of different users on different items, and the encoding value 1 represents In the example, the first device and the second device are both participants in vertical federated learning, and before secret sharing, the first device and the second device have trained a preset click-through rate prediction model based on secret sharing and vertical federated learning, wherein the preset click-through rate prediction model is a trained factor decomposition machine classification model, which is used to predict the click probability of the user's corresponding item or predict whether the user will click on the item, and the model expression of the preset click-through rate prediction model is as follows:

[0180]

[0181]

[0182] Among them, x is the model input data, w and V are model parameters, and f(x) is the model output, which is the predicted click-through rate or a vector composed of multiple predicted click-through rates.

[0183] Acquire the sparse data of the first-party user to be predicted, and share it secretly with the second device to obtain the secret sharing model parameters. Specifically, acquire the first-party click rate model parameters of the preset click rate prediction model and the first-party user to be predicted sparse data, and at the same time, the second device acquires the second-party click rate model parameters of the preset click rate prediction model and the second-party user to be predicted sparse data, wherein, since the preset click rate model is constructed based on vertical federated learning, part of the model parameters of the preset click rate prediction model held by the first device are first-party click rate model parameters, and part of the model parameters of the preset click rate prediction model held by the second device are second-party click rate model parameters, the first-party user to be predicted sparse data is the data of the user's click results on the item collected by the first device, and the second-party user to be predicted sparse data is the data of the user's click results on the item collected by the second device, and in the vertical federation scenario, the first-party user to be predicted sparse data and the second-party user to be predicted sparse data correspond to the same user group to be predicted, and the first-party user to be predicted sparse data and the second-party user to be predicted sparse data can both be represented by vectors or matrices. For example, assuming that the first-party user to be predicted The measured user sparse data is a vector (1, 0, 1, 0), wherein the code 1 indicates that the user clicked the corresponding item, and the code 0 indicates that the user did not click the corresponding item, then the vector (1, 0, 1, 0) indicates that the user clicked on item A and item C, but did not click on item B and item D. Further, based on the first-party click-through rate model parameter, secret sharing is performed with the second device, wherein the second device provides the second-party click-through rate model parameter in the secret sharing, and then the first device obtains the secret sharing model parameter, and the second device obtains the second-party secret sharing model parameter, wherein the secret sharing model parameter includes a first shared first-party model parameter and a first shared second-party model parameter, and the second-party secret sharing model parameter includes a second shared first-party model parameter and a second shared second-party model parameter, wherein the first shared first-party model parameter is a first share of the first-party click-through rate model parameter, the second shared first-party model parameter is a second share of the first-party click-through rate model parameter, the first shared second-party model parameter is a first share of the second click-through rate model parameter, and the second shared second-party model parameter is a second share of the second click-through rate model parameter.

[0184] Step C20, based on the first non-zero part of the sparse data of the first-party user to be predicted and the secret sharing model parameters, performing a vertical federated prediction interaction with the second device to predict the click rate of the target user corresponding to the sparse data of the first-party user to be predicted, and obtaining a first secret sharing click rate prediction result;

[0185] In this embodiment, it should be noted that the first non-zero part is the remaining part of the first sparse matrix excluding the zero vector.

[0186] Based on the first non-zero part of the sparse data of the first-party user to be predicted and the secret sharing model parameters, a vertical federal prediction interaction is performed with the second device to predict the click rate of the target user corresponding to the sparse data of the first-party user to be predicted, and a first secret sharing click rate prediction result is obtained. Specifically, based on the first non-zero part of the sparse data of the first-party user to be predicted and the secret sharing model parameters, a vertical federal prediction interaction is performed with the second device to combine the second non-zero part of the sparse data of the second-party user to be predicted and the second-party secret sharing model parameters, and calculate the first secret sharing click rate prediction result through a preset secret sharing multiplication and a preset homomorphic encryption algorithm.

[0187] The secret sharing model parameters include the first party first sharing type model parameters and the first party second type sharing model parameters, the second device includes the second party to-be-predicted user sparse data and the second party secret sharing model parameters, wherein the second party secret sharing model parameters include the second party first sharing type model parameters and the second party second sharing type model parameters, the first secret sharing click-through rate prediction result includes the first type sharing prediction result and the second type sharing prediction result,

[0188] The step of performing vertical federated prediction interaction with the second device based on the first non-zero part of the sparse data of the first-party user to be predicted and the secret sharing model parameters to perform click-through rate prediction on the target user corresponding to the sparse data of the first-party user to be predicted, and obtaining the first secret sharing click-through rate prediction result includes:

[0189] Step C21, based on the first non-zero part and the first sharing type model parameter of the first party, performing vertical federated prediction interaction with the second device to combine the first sharing type model parameter of the second party to calculate the first type sharing prediction result;

[0190] In this embodiment, it should be noted that the first-party first sharing type model parameter is a first-party click rate model parameter of secret sharing held by the first device, the second-party first sharing type model parameter is a first-party click rate model parameter of secret sharing held by the second device, and the first type sharing prediction result includes at least a first shared first-party predicted click rate, and the first shared first-party predicted click rate corresponds to a user, wherein the first secret shared click rate calculation formula corresponding to the first shared first-party predicted click rate is as follows:

[0191]

[0192] Among them, [[z(X A )]] A The first shared first-party click-through rate, X A is the sparse data of the first party user to be predicted, w A and V A are the first-party click rate model parameters. is the first safe inner product calculated in the same manner as the cross inner product of the third non-zero feature term in the model training process, is the second safe inner product calculated in the same way as the cross inner product of the second non-zero feature term in the model training process, is the third secure inner product calculated in the same way as the intermediate parameter of the second secret sharing of the first party during the model training process, [[]] is a symbol representing secret sharing, [[]] A A secret sharing symbol indicating that the secret shared data belongs to the first device.

[0193] Based on the first non-zero part and the first sharing type model parameters of the first party, a vertical federated prediction interaction is performed with the second device to combine the first sharing type model parameters of the second party and calculate the first type of sharing prediction result. Specifically, based on the first non-zero part and the first sharing type model parameters of the first party, a vertical federated prediction interaction is performed with the second device to combine the first sharing type model parameters of the second party to respectively calculate the first security inner product, the second security inner product and the third security inner product, and substitute the first security inner product, the second security inner product and the third security inner product into the first secret sharing click-through rate calculation formula to obtain the first type of sharing prediction result.

[0194] Additionally, it should be noted that the second device may calculate the second party first type shared prediction result based on the second party first secret shared click rate calculation formula, and the second party first type shared prediction result includes at least a second shared first party predicted click rate, and a second shared first party predicted click rate corresponds to a user, wherein the second party first secret shared click rate calculation formula is as follows:

[0195]

[0196] Among them, [[z(X A )]] B The first party predicts click rate for the second shared A is the sparse data of the first party user to be predicted, w A and V A are the first-party click rate model parameters. is the second-party first safety inner product calculated in the same manner as the cross inner product of the second-party third non-zero feature item in the model training process, is the second-party second safety inner product calculated in the same manner as the cross inner product of the second-party second non-zero feature item in the model training process, is the second party third secure inner product calculated in the same manner as the second party second secret sharing intermediate parameter in the model training process, [[]] is a symbol representing secret sharing, [[]] B A secret sharing symbol indicating that the secret shared data belongs to the first device.

[0197] Step C22, based on the second sharing type model parameters of the first party, perform vertical federal prediction interaction with the second device to combine the second sharing type model parameters of the second party and the second non-zero part of the second party's user sparse data to be predicted, and calculate the second type sharing prediction result.

[0198] In this embodiment, it should be noted that the first-party second sharing type model parameter is a second-party click rate model parameter of the secret sharing held by the first device, the second-party second sharing type model parameter is a second-party click rate model parameter of the secret sharing held by the second device, and the second-type sharing prediction result includes at least a first-shared second-party predicted click rate, and a first-shared second-party predicted click rate corresponds to a user, wherein the second secret sharing click rate calculation formula corresponding to the first-shared second-party predicted click rate is as follows:

[0199]

[0200] Among them, [[z(X B )]] A Predict click rate for the first shared second party, X B is the sparse data of the second party user to be predicted, w B and V B are the click rate model parameters of the second party. is a fourth safe inner product calculated in the same manner as the cross inner product of the fourth non-zero characteristic term, is a fifth safe inner product calculated in the same manner as the cross inner product of the first non-zero characteristic term, is the sixth secure inner product calculated in the same manner as the first party's first secret sharing intermediate parameter, [[]] is a symbol representing secret sharing, [[]] A A secret sharing symbol indicating that the secret shared data belongs to the first device.

[0201] Based on the second sharing type model parameters of the first party, a vertical federated prediction interaction is performed with the second device to combine the second sharing type model parameters of the second party and the second non-zero part of the second party's user sparse data to be predicted, and calculate the second type of shared prediction result. Specifically, based on the second sharing type model parameters of the first party, a vertical federated prediction interaction is performed with the second device to combine the second sharing type model parameters of the second party and the second non-zero part of the second party's user sparse data to be predicted, and respectively calculate the fourth security inner product, the fifth security inner product and the sixth security inner product, and substitute the fourth security inner product, the fifth security inner product and the sixth security inner product into the second secret sharing click-through rate calculation formula to obtain the second type of shared prediction result.

[0202] Additionally, it should be noted that the second device may calculate the second party second type shared prediction result based on the second party second secret sharing click rate calculation formula, and the second party second type shared prediction result includes at least a second shared second party predicted click rate, and a second shared second party predicted click rate corresponds to a user, wherein the second party second secret sharing click rate calculation formula is as follows:

[0203]

[0204] Among them, [[z(X B )]] B Predict click rate for the second shared second party, X B is the sparse data of the second party user to be predicted, w B and V B are the click rate model parameters of the second party. is the second-party fourth safety inner product calculated in the same manner as the cross inner product of the second-party fourth non-zero feature item in the model training process, is the second-party fifth safe inner product calculated in the same manner as the cross inner product of the second-party first non-zero feature item in the model training process, is the second party sixth secure inner product calculated in the same manner as the second party first secret sharing intermediate parameter in the model training process, [[]] is a symbol representing secret sharing, [[]] B A secret sharing symbol indicating that the secret shared data belongs to the second device.

[0205] Step C30: Based on the first secret shared click rate prediction result, aggregate interaction is performed with the second device to calculate a target click rate prediction result in combination with the second secret shared click rate prediction result determined by the second device.

[0206] In this embodiment, based on the first secret shared click-through rate prediction result, an aggregate interaction is performed with the second device to calculate a target click-through rate prediction result in combination with the second secret shared click-through rate prediction result determined by the second device. Specifically, based on the first secret shared click-through rate prediction result, an aggregate interaction is performed with the second device to aggregate the first secret shared click-through rate prediction result and the second secret shared click-through rate prediction result to obtain the target click-through rate prediction result.

[0207] The first secret shared click rate prediction result includes at least a first shared first-party predicted click rate and a first shared second-party predicted click rate, the second secret shared click rate prediction result includes at least a second shared first-party predicted click rate and a second shared second-party predicted click rate, and the target click rate prediction result includes at least a target predicted click rate.

[0208] The step of performing a federated prediction interaction with the second device based on the first secret shared click rate prediction result to calculate a target predicted click rate in conjunction with the second secret shared click rate prediction result determined by the second device comprises:

[0209] Step C31, receiving the second shared first-party predicted click rate and the second shared second-party predicted click rate sent by the second device;

[0210] Step C32, calculating the first-party predicted click rate based on the first shared first-party predicted click rate and the second shared first-party predicted click rate;

[0211] In this embodiment, the first-party predicted click-rate is calculated based on the first shared first-party predicted click-rate and the second shared first-party predicted click-rate. Specifically, the sum of the first shared first-party predicted click-rate and the second shared first-party predicted click-rate is calculated to obtain the first-party predicted click-rate.

[0212] Step C33, calculating the second-party predicted click rate based on the first shared second-party predicted click rate and the second shared second-party predicted click rate;

[0213] In this embodiment, the second party predicted click rate is calculated based on the first shared second-party predicted click rate and the second shared second-party predicted click rate. Specifically, the sum of the first shared second-party predicted click rate and the second shared second-party predicted click rate is calculated to obtain the second party predicted click rate.

[0214] Step C34, aggregating the first-party predicted click-through rate and the second-party predicted click-through rate to obtain the target predicted click-through rate.

[0215] In this embodiment, the first-party predicted click-through rate and the second-party predicted click-through rate are aggregated to obtain the target predicted click-through rate. Specifically, based on a preset aggregation rule, the first-party predicted click-through rate and the second-party predicted click-through rate are aggregated to obtain the aggregated predicted click-through rate, wherein the preset aggregation rule includes summation and weighted averaging, etc., and the aggregate point predicted click-through rate is used as a frequency representation value of the predicted user clicking on the item, which is used to represent the frequency of the user clicking on the item, and then the aggregated predicted click-through rate is substituted into the model expression of the preset click-through rate prediction model to obtain the target predicted click-through rate, wherein the target predicted click-through rate is the predicted probability of the user clicking on the item, and the model expression is as follows:

[0216]

[0217] Wherein, f(x) is the target predicted click rate, and z(x) is the aggregated predicted click rate.

[0218] In addition, it should be noted that the target predicted click-through rate is the probability of a user clicking on an item predicted based on a preset click-through rate prediction model, and then the target predicted click-through rate is compared with a preset click-through rate threshold. If the target predicted click-through rate is greater than or equal to the preset click-through rate threshold, it is determined that the user will click on the item. If the target predicted click-through rate is less than the preset click-through rate threshold, it is determined that the user will not click on the item. That is, the click prediction results of the user corresponding to the item are divided into two prediction results: click and no click.

[0219] The present embodiment provides a method for predicting click-through rate based on secret sharing and vertical federated learning, by obtaining sparse data of a first-party user to be predicted and performing secret sharing with a second device to obtain secret sharing model parameters, and then performing vertical federated prediction interaction with the second device based on a first non-zero part of the sparse data of the first-party user to be predicted and the secret sharing model parameters, so as to predict the click-through rate of a target user corresponding to the sparse data of the first-party user to be predicted, and obtain a first secret sharing click-through rate prediction result, and then, based on the first secret sharing click-through rate prediction result, performing aggregate interaction with the second device to jointly calculate a target click-through rate prediction result with a second secret sharing click-through rate prediction result determined by the second device, wherein the first device and the second When devices interact, the data sent or received are all secret shared data. There is no need for public-private keys generated by a third party to encrypt the data. All data transmission processes are carried out between the two parties participating in vertical federated learning, which protects the privacy of the data while reducing the complex encryption and decryption calculation processes of the data. Moreover, since only simple mathematical operations are required for secret sharing and the corresponding decryption of secret sharing, the calculation complexity is reduced. When the user data is sparse data, the application can complete the click-through rate prediction based only on the non-zero part of the user data, thereby reducing the amount of calculation on the zero part of the user data, thereby further reducing the calculation complexity, thereby improving the calculation efficiency of the factor decomposition machine classification model when predicting the click-through rate.

[0220] Reference Figure 4 , Figure 4 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.

[0221] like Figure 4 As shown, the factor decomposition machine classification model building device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0222] Optionally, the factor decomposition machine classification model building device may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0223] Those skilled in the art will understand that Figure 4 The factor decomposition machine classification model building device structure shown in does not constitute a limitation of the factor decomposition machine classification model building device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0224] like Figure 4 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, and a factor decomposition machine classification model construction program. The operating system is a program that manages and controls the hardware and software resources of the factor decomposition machine classification model construction device, and supports the operation of the factor decomposition machine classification model construction program and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the factor decomposition machine classification model construction system.

[0225] exist Figure 4 In the factor decomposition machine classification model building device shown, the processor 1001 is used to execute the factor decomposition machine classification model building program stored in the memory 1005 to implement the steps of any of the above-mentioned factor decomposition machine classification model building methods.

[0226] The specific implementation of the factor decomposition machine classification model construction device of the present application is basically the same as the various embodiments of the factor decomposition machine classification model construction method mentioned above, and will not be repeated here.

[0227] Reference Figure 5 , Figure 5 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.

[0228] like Figure 5As shown, the click rate prediction device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0229] Optionally, the click rate prediction device may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0230] Those skilled in the art will understand that Figure 5 The structure of the click rate prediction device shown in the figure does not constitute a limitation on the click rate prediction device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0231] like Figure 5 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module and a click rate prediction program. The operating system is a program that manages and controls the hardware and software resources of the click rate prediction device, and supports the operation of the click rate prediction program and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the click rate prediction system.

[0232] exist Figure 5 In the click rate prediction device shown, the processor 1001 is used to execute the click rate prediction program stored in the memory 1005 to implement the steps of any of the above-mentioned click rate prediction methods.

[0233] The specific implementation of the click rate prediction device of the present application is basically the same as the above-mentioned embodiments of the click rate prediction method, and will not be repeated here.

[0234] The present application also provides a factor decomposition machine classification model construction device, which is applied to a factor decomposition machine classification model construction device, and the factor decomposition machine classification model construction device includes:

[0235] A secret sharing module, used to obtain the model parameters to be trained and the first sparse data corresponding to the classification model to be trained, and based on the model parameters to be trained, perform secret sharing with the second device to obtain the secret sharing initial model parameters;

[0236] an error calculation module, configured to perform a federation interaction with the second device to calculate a secret sharing classification model error based on a first non-zero portion in the first sparse data, the secret sharing initial model parameters and preset weight information;

[0237] A generation module is used to update the classification model to be trained based on the secret sharing classification model error to obtain a vertical federated factorization machine classification model.

[0238] Optionally, the error calculation module includes:

[0239] A first computing unit, configured to perform a federated interaction with the second device based on the first type of shared model parameters and the first non-zero part, so as to combine the second party's first type of shared model parameters and the second non-zero part of the second sparse matrix to calculate the first type of sparse matrix secure inner product;

[0240] A second computing unit, configured to perform a federated interaction with the second device based on the second-type shared model parameters and the first non-zero part, so as to jointly calculate the second-type sparse matrix secure inner product with the second-type shared model parameters of the second party and the second non-zero part;

[0241] A third calculation unit, configured to perform a federated interaction with the second device based on the second type sharing model parameter, the first non-zero part and the preset secret sharing multiplication triplet, so as to calculate the secret sharing intermediate parameter by combining the second type sharing model parameter of the second party and the second non-zero part;

[0242] The fourth calculation unit is used to calculate the secret sharing classification model error based on the first type of sparse matrix secure inner product, the second sparse matrix secure inner product, the secret sharing intermediate parameter and the preset weight information through a preset secret sharing classification model error calculation formula.

[0243] Optionally, the second computing unit includes:

[0244] a first interactive calculation subunit, configured to perform a federated interaction with the second device based on the second type shared model parameter, so as to calculate a cross inner product between the second type shared model parameter and the second non-zero part, and obtain a cross inner product of the first non-zero feature item;

[0245] The second interactive calculation subunit is used to perform federal interaction with the second device based on the first non-zero part to calculate the cross inner product between the first non-zero part and the second type shared model parameter of the second party to obtain the cross inner product of the second non-zero feature item.

[0246] Optionally, the first interactive computing subunit is further used for the following steps:

[0247] Generate a first public key, and encrypt the first shared parameter based on the first public key to obtain an encrypted first shared parameter;

[0248] Sending the first public key and the encrypted first shared parameter to a second device, so that the second device determines the cross inner product of the second party's first non-zero feature term and the cross inner product of the encrypted first non-zero feature term based on the first public key, the encrypted first shared parameter, the second shared parameter and the second non-zero part;

[0249] Receive the encrypted first non-zero feature item cross inner product sent by the second device, and decrypt the encrypted first non-zero feature item cross inner product based on the first private key corresponding to the first public key to obtain the first non-zero feature item cross inner product.

[0250] Optionally, the second interactive calculation subunit is further used for the following steps:

[0251] receiving a second public key and an encrypted fourth shared parameter sent by the second device, wherein the encrypted fourth shared parameter is the fourth shared parameter encrypted by the second device based on the second public key;

[0252] Calculate a second non-zero feature item cross inner product and an encrypted second party second non-zero feature item cross inner product based on the second public key, the encrypted fourth shared parameter, the first non-zero part and the third shared parameter;

[0253] The encrypted second-party second non-zero characteristic item cross inner product is sent to the second device, so that the second device decrypts the encrypted second-party second non-zero characteristic item cross inner product based on the second private key corresponding to the second public key to obtain the second-party second non-zero characteristic item cross inner product.

[0254] Optionally, the second interactive calculation subunit is further used for the following steps:

[0255] Based on the second public key, encrypt the third shared parameter to obtain the encrypted third shared parameter, and calculate the encryption model parameter corresponding to the encrypted third shared parameter and the encrypted fourth shared parameter;

[0256] Calculate the cross inner product between each column vector in the encrypted model parameter and each column vector in the first non-zero part to obtain the first encrypted inner product;

[0257] Based on the characteristic dimension of the encryption model parameter, the second non-zero characteristic item cross inner product is constructed, and the encrypted second party second non-zero characteristic item cross inner product corresponding to the second non-zero characteristic item cross inner product and the first encrypted inner product is calculated.

[0258] Optionally, the third calculation unit further includes:

[0259] a third interactive calculation subunit, configured to calculate, based on the preset secret sharing multiplication triplet, a secret sharing product between the second type secret sharing parameter matrix and the secret sharing transposed parameter matrix by performing federated interaction with the second device, and obtain an inner product of the secret sharing matrix, so that the second device can calculate the secret sharing product between the second type secret sharing parameter matrix of the second party and the secret sharing transposed parameter matrix of the second party, and obtain the inner product of the second party secret sharing matrix;

[0260] The fourth interactive calculation subunit is used to perform federal interaction with the second device based on the inner product of the secret sharing matrix and the first non-zero part, so as to jointly calculate the secret sharing intermediate parameter with the inner product of the second party's secret sharing matrix and the second non-zero part.

[0261] Optionally, the generating module includes:

[0262] An updating unit, configured to update the secret sharing initial model parameters based on the secret sharing classification model error to obtain secret sharing update parameters;

[0263] A decryption unit is used to perform decryption interaction with the second device based on the secret sharing update parameter to obtain the first target model parameter so that the second device can obtain the second target model parameter.

[0264] Optionally, the decryption unit includes:

[0265] a fifth interactive calculation subunit, configured to send the first shared second-party model update parameter to the second device, so that the second device calculates the second target model parameter based on the determined second shared second-party model update parameter and the first shared second-party model update parameter;

[0266] The sixth interactive calculation subunit is used to receive the second shared first-party model update parameter sent by the second device, and calculate the first target model parameter based on the second shared first-party model update parameter and the first shared first-party model update parameter.

[0267] The specific implementation of the factor decomposition machine classification model construction device of the present application is basically the same as the various embodiments of the factor decomposition machine classification model construction method mentioned above, and will not be repeated here.

[0268] The embodiment of the present application further provides a click rate prediction device, which is applied to a click rate prediction device, and the click rate prediction device includes:

[0269] A secret sharing module, used to obtain sparse data of the first party user to be predicted, and to perform secret sharing with the second device to obtain secret sharing model parameters;

[0270] A prediction module, configured to perform a vertical federated prediction interaction with the second device based on the first non-zero part of the sparse data of the first-party user to be predicted and the secret sharing model parameters, so as to predict the click rate of the target user corresponding to the sparse data of the first-party user to be predicted, and obtain a first secret sharing click rate prediction result;

[0271] The aggregation module is used to perform aggregation interaction with the second device based on the first secret sharing click rate prediction result, so as to calculate the target click rate prediction result in combination with the second secret sharing click rate prediction result determined by the second device.

[0272] Optionally, the aggregation module includes:

[0273] a receiving unit, configured to receive the second shared first-party predicted click rate and the second shared second-party predicted click rate sent by the second device;

[0274] A first calculation unit, configured to calculate a first-party predicted click rate based on the first shared first-party predicted click rate and the second shared first-party predicted click rate;

[0275] a second calculation unit, configured to calculate a second-party predicted click rate based on the first shared second-party predicted click rate and the second shared second-party predicted click rate;

[0276] An aggregation unit is used to aggregate the first-party predicted click-through rate and the second-party predicted click-through rate to obtain the target predicted click-through rate.

[0277] Optionally, the prediction module includes:

[0278] A first joint calculation unit, configured to perform a vertical federated prediction interaction with the second device based on the first non-zero portion and the first sharing type model parameter of the first party, so as to calculate the first type sharing prediction result by combining the first sharing type model parameter of the second party;

[0279] A second joint calculation unit is used to perform vertical federated prediction interaction with the second device based on the second sharing type model parameters of the first party, so as to combine the second sharing type model parameters of the second party and the second non-zero part of the second party's user sparse data to be predicted to calculate the second type sharing prediction result.

[0280] The specific implementation of the click rate prediction device of the present application is basically the same as the above-mentioned embodiments of the click rate prediction method, and will not be repeated here.

[0281] An embodiment of the present application provides a readable storage medium, and the readable storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of the factor decomposition machine classification model construction method described in any one of the above items.

[0282] The specific implementation of the readable storage medium of the present application is basically the same as the various embodiments of the above-mentioned factor decomposition machine classification model construction method, and will not be repeated here.

[0283] An embodiment of the present application provides a readable storage medium, and the readable storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the above-mentioned click-through rate prediction methods.

[0284] The specific implementation of the readable storage medium of the present application is basically the same as the above-mentioned embodiments of the click rate prediction method, and will not be repeated here.

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

Claims

1. A method for constructing a factor decomposition machine classification model, characterized in that: The factor decomposition machine classification model construction method is applied to the field of financial technology artificial intelligence and the first device, and the factor decomposition machine classification model construction method includes: Obtaining the model parameters to be trained and the first sparse data corresponding to the classification model to be trained, and based on the model parameters to be trained, performing secret sharing with the second device to obtain secret sharing initial model parameters, wherein the secret sharing initial model parameters include first-type shared model parameters and second-type shared model parameters, and the second device includes the second-party secret sharing initial model parameters and a second sparse matrix, wherein the second-party secret sharing initial model parameters include the second-party first-type shared model parameters and the second-party second-type shared model parameters; The model expression of the factor decomposition machine classification model is as follows: Where f(x) is the factorization machine classification model, is a data matrix corresponding to the model input data, wherein the model input data includes the first sparse data (X A , Y) and the second sparse data X B , where Y is the sample label, X A With d A The first sparse matrix of feature dimensions, X B With d B The second sparse matrix of feature dimensions, the first type model parameter is w, where w is a d-dimensional vector, and the second type model parameter is V, where V is d*d x The matrix of , where w is the first-party first-type model parameter vector w A and the second-party first-type model parameter vector w B Composition, among which w A is d A dimensional vector, w B is d B dimensional vector, or , where V is the first-party second-type model parameter matrix V A and the second party second type model parameter matrix V B Composition, among which, V A is d A *d X dimensional matrix, V B is d B *d X dimensional matrix, is the inner product of w and x, is the column vector of the i-th column of V, is the column vector of the j-th column of V, for The column vector of the i-th column of for The column vector of the j-th column of ; Based on the first non-zero part in the first sparse data, the secret sharing initial model parameters and preset weight information, perform federation interaction with the second device to calculate the secret sharing classification model error; The step of performing federated interaction with the second device to calculate the secret sharing classification model error based on the first non-zero part in the first sparse data, the secret sharing initial model parameters and preset weight information includes: Based on the first type of shared model parameters and the first non-zero part, perform federated interaction with the second device to combine the second party's first type of shared model parameters and the second non-zero part of the second sparse matrix to calculate the first type of sparse matrix secure inner product; Based on the secret sharing classification model error, the classification model to be trained is updated to obtain a vertical federated factorization machine classification model.

2. The method for constructing a factorization machine classification model according to claim 1, characterized in that: After the step of performing federated interaction with the second device based on the first type shared model parameter and the first non-zero part to combine the second party's first type shared model parameter and the second non-zero part of the second sparse matrix to calculate the first type sparse matrix secure inner product, the step further includes: Based on the first type of shared model parameters and the first non-zero part, perform federated interaction with the second device to combine the second party's first type of shared model parameters and the second non-zero part of the second sparse matrix to calculate the first type of sparse matrix secure inner product; Based on the second-type shared model parameters and the first non-zero part, perform federated interaction with the second device to combine the second-type shared model parameters and the second non-zero part of the second party to calculate the second-type sparse matrix secure inner product; Based on the second type of sharing model parameters, the first non-zero part and a preset secret sharing multiplication triplet, perform a federated interaction with the second device to combine the second type of sharing model parameters and the second non-zero part of the second party to calculate the secret sharing intermediate parameter; Based on the secure inner product of the first type of sparse matrix, the secure inner product of the second sparse matrix, the secret sharing intermediate parameter and the preset weight information, the secret sharing classification model error is calculated using a preset secret sharing classification model error calculation formula.

3. The method for constructing a factorization machine classification model according to claim 2, characterized in that: The second type of sparse matrix safe inner product includes a first non-zero characteristic item cross inner product and a second non-zero characteristic item cross inner product. The step of performing federated interaction with the second device based on the second type shared model parameter and the first non-zero part to combine the second type shared model parameter and the second non-zero part of the second party to calculate the second type sparse matrix secure inner product includes: Based on the second type shared model parameter, perform federated interaction with the second device to calculate a cross inner product between the second type shared model parameter and the second non-zero part to obtain a cross inner product of the first non-zero feature item; Based on the first non-zero part, a federated interaction is performed with the second device to calculate a cross inner product between the first non-zero part and the second-party second-type shared model parameter to obtain a cross inner product of the second non-zero feature item.

4. The method for constructing a factorization machine classification model as claimed in claim 3, characterized in that: The second type of shared model parameters include first shared parameters, and the second type of shared model parameters include second shared parameters. The step of performing federated interaction with the second device based on the second type shared model parameter to calculate the cross inner product between the second type shared model parameter and the second non-zero part to obtain the cross inner product of the first non-zero feature item includes: Generate a first public key, and encrypt the first shared parameter based on the first public key to obtain an encrypted first shared parameter; Sending the first public key and the encrypted first shared parameter to a second device, so that the second device determines the cross inner product of the second party's first non-zero feature term and the cross inner product of the encrypted first non-zero feature term based on the first public key, the encrypted first shared parameter, the second shared parameter and the second non-zero part; Receive the encrypted first non-zero feature item cross inner product sent by the second device, and decrypt the encrypted first non-zero feature item cross inner product based on the first private key corresponding to the first public key to obtain the first non-zero feature item cross inner product.

5. The method for constructing a factorization machine classification model as claimed in claim 3, characterized in that: The second type of shared model parameters include a third shared parameter, and the second party second type of shared model parameters include a fourth shared parameter. The step of performing federated interaction with the second device based on the first non-zero part to calculate the cross inner product between the first non-zero part and the second type shared model parameter of the second party to obtain the cross inner product of the second non-zero feature item includes: receiving a second public key and an encrypted fourth shared parameter sent by the second device, wherein the encrypted fourth shared parameter is the fourth shared parameter encrypted by the second device based on the second public key; Calculate a second non-zero feature item cross inner product and an encrypted second party second non-zero feature item cross inner product based on the second public key, the encrypted fourth shared parameter, the first non-zero part and the third shared parameter; The encrypted second-party second non-zero characteristic item cross inner product is sent to the second device, so that the second device decrypts the encrypted second-party second non-zero characteristic item cross inner product based on the second private key corresponding to the second public key to obtain the second-party second non-zero characteristic item cross inner product.

6. The method for constructing a factorization machine classification model according to claim 5, characterized in that: The step of calculating the cross inner product of the second non-zero feature item and the cross inner product of the encrypted second non-zero feature item of the second party based on the second public key, the encrypted fourth shared parameter, the first non-zero part and the third shared parameter comprises: Based on the second public key, encrypt the third shared parameter to obtain the encrypted third shared parameter, and calculate the encryption model parameter corresponding to the encrypted third shared parameter and the encrypted fourth shared parameter; Calculate the cross inner product between each column vector in the encrypted model parameter and each column vector in the first non-zero part to obtain a first encrypted inner product; Based on the characteristic dimension of the encryption model parameter, the second non-zero characteristic item cross inner product is constructed, and the encrypted second party second non-zero characteristic item cross inner product corresponding to the second non-zero characteristic item cross inner product and the first encrypted inner product is calculated.

7. The method for constructing a factorization machine classification model according to claim 2, characterized in that: The second-type sharing model parameters include a second-type secret sharing parameter matrix and a secret sharing transposed parameter matrix corresponding to the second-type secret sharing parameter matrix, and the second-party second-type sharing model parameters include a second-party second-type secret sharing parameter matrix and a second-party secret sharing transposed parameter matrix corresponding to the second-party second-type sharing parameter matrix. The step of performing federated interaction with the second device based on the second type sharing model parameter, the first non-zero part and the preset secret sharing multiplication triplet to combine the second type sharing model parameter of the second party and the second non-zero part to calculate the secret sharing intermediate parameter comprises: Based on the preset secret sharing multiplication triplet, by performing federated interaction with the second device, a secret sharing product between the second type of secret sharing parameter matrix and the secret sharing transposed parameter matrix is ​​calculated to obtain an inner product of the secret sharing matrix, so that the second device can calculate the secret sharing product between the second type of secret sharing parameter matrix of the second party and the secret sharing transposed parameter matrix of the second party to obtain the inner product of the second party secret sharing matrix; Based on the inner product of the secret sharing matrix and the first non-zero part, a federated interaction is performed with the second device to combine the inner product of the second party secret sharing matrix and the second non-zero part to calculate the secret sharing intermediate parameter.

8. The method for constructing a factorization machine classification model according to claim 1, wherein: The vertical federated factorization machine classification model includes a first target model parameter belonging to the first device and a second target model parameter belonging to the second device, The step of updating the classification model to be trained based on the secret sharing classification model error to obtain the vertical federated factorization machine classification model comprises: Based on the secret sharing classification model error, updating the secret sharing initial model parameters to obtain secret sharing update parameters; Based on the secret sharing update parameter, a decryption interaction is performed with the second device to obtain the first target model parameter, so that the second device can obtain the second target model parameter.

9. The method for constructing a factorization machine classification model according to claim 8, characterized in that: The secret shared update parameters include a first shared first party model update parameter and a first shared second party model update parameter, The step of performing decryption interaction with the second device based on the secret sharing update parameter to obtain the first target model parameter so that the second device can obtain the second target model parameter includes: sending the first shared second-party model update parameter to the second device, so that the second device calculates the second target model parameter based on the determined second shared second-party model update parameter and the first shared second-party model update parameter; A second shared first-party model update parameter sent by the second device is received, and the first target model parameter is calculated based on the second shared first-party model update parameter and the first shared first-party model update parameter.

10. A click rate prediction method, characterized in that: The click rate prediction method is applied to the first device described in any one of claims 1 to 9, and the click rate prediction method: Acquire sparse data of the first-party user to be predicted, and perform secret sharing with the second device to obtain secret sharing model parameters; Based on the first non-zero part of the sparse data of the first-party user to be predicted and the secret sharing model parameters, perform vertical federated prediction interaction with the second device to predict the click rate of the target user corresponding to the sparse data of the first-party user to be predicted, and obtain a first secret sharing click rate prediction result; Based on the first secret shared click rate prediction result, aggregate interaction is performed with the second device to calculate a target click rate prediction result in conjunction with the second secret shared click rate prediction result determined by the second device.

11. The click rate prediction method according to claim 10, characterized in that: The first secret shared click rate prediction result includes at least a first shared first-party predicted click rate and a first shared second-party predicted click rate, the second secret shared click rate prediction result includes at least a second shared first-party predicted click rate and a second shared second-party predicted click rate, the target click rate prediction result includes at least a target predicted click rate, The step of performing a federated prediction interaction with the second device based on the first secret shared click rate prediction result to calculate a target predicted click rate in conjunction with the second secret shared click rate prediction result determined by the second device comprises: Receiving the second shared first-party predicted click rate and the second shared second-party predicted click rate sent by the second device; Calculating a first-party predicted click rate based on the first shared first-party predicted click rate and the second shared first-party predicted click rate; Calculating a second-party predicted click rate based on the first shared second-party predicted click rate and the second shared second-party predicted click rate; The first-party predicted click-through rate and the second-party predicted click-through rate are aggregated to obtain the target predicted click-through rate.

12. The click rate prediction method according to claim 10, characterized in that: The secret sharing model parameters include first-party first sharing type model parameters and first-party second-type sharing model parameters, the second device includes second-party to-be-predicted user sparse data and second-party secret sharing model parameters, wherein the second-party secret sharing model parameters include second-party first sharing type model parameters and second-party second sharing type model parameters, the first secret sharing click-through rate prediction result includes first-type sharing prediction results and second-type sharing prediction results, The step of performing vertical federated prediction interaction with the second device based on the first non-zero part of the sparse data of the first-party user to be predicted and the secret sharing model parameters to perform click-through rate prediction on the target user corresponding to the sparse data of the first-party user to be predicted, and obtaining the first secret sharing click-through rate prediction result includes: Based on the first non-zero portion and the first sharing type model parameter of the first party, perform a vertical federated prediction interaction with the second device to combine the first sharing type model parameter of the second party to calculate the first type sharing prediction result; Based on the second sharing type model parameters of the first party, a vertical federated prediction interaction is performed with the second device to combine the second sharing type model parameters of the second party and the second non-zero part of the second party's user sparse data to be predicted to calculate the second type sharing prediction result.

13. A factor decomposition machine classification model building device, characterized in that: The factor decomposition machine classification model construction device includes: a memory, a processor, and a program stored in the memory for implementing the factor decomposition machine classification model construction method. The memory is used to store a program for implementing a factorization machine classification model construction method; The processor is used to execute a program for implementing the factor decomposition machine classification model construction method to implement the steps of the factor decomposition machine classification model construction method as described in any one of claims 1 to 9.

14. A readable storage medium, characterized in that: The readable storage medium stores a program for implementing a factor decomposition machine classification model construction method, and the program for implementing a factor decomposition machine classification model construction method is executed by a processor to implement the steps of the factor decomposition machine classification model construction method as described in any one of claims 1 to 9.

15. A click rate prediction device, characterized in that: The click rate prediction device comprises: a memory, a processor, and a program stored in the memory for implementing the click rate prediction method. The memory is used to store a program for implementing a click rate prediction method; The processor is used to execute a program for implementing the click rate prediction method to implement the steps of the click rate prediction method as described in any one of claims 10 to 12.

16. A readable storage medium, characterized in that: The readable storage medium stores a program for implementing the click rate prediction method, and the program for implementing the click rate prediction method is executed by a processor to implement the steps of the click rate prediction method as described in any one of claims 10 to 12.

Citation Information

Patent Citations

  • Privacy-preserving machine learning

    CN110537191A

  • Graph neural network model training method, device and system

    CN110929870A