Model prediction method, device, equipment and medium combining multiple feature data
By a coordinator obtaining and processing feature data from demanders and data providers in a vertical federated learning scenario, the problem that the existing technology cannot predict model without leaking feature information is solved, and effective linear regression model prediction is achieved and model parameters updated.
Patent Information
- Application Number
- CN201911050891.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2039-10-31
AI Technical Summary
In the tripartite vertical federated learning scenario, existing linear regression models cannot work with the demander and multiple data providers to effectively predict the model without leaking feature information.
The coordinator obtains the model prediction task initiated by the demand side, determines the multi-party feature data required for processing the task, and cooperates with the demand side and the data provider to perform linear regression calculations without leaking the feature data to each other. Specific steps include obtaining model prediction tasks, determining the required feature data, performing linear regression calculations, optimizing and processing local calculation results and feeding them back to the demander and data provider.
It realizes that without leaking feature information, and jointly establishing linear regression models with demanders and multiple data providers to conduct effective model prediction, promoting the development of machine learning models for multiple scenarios in the industry.
Smart Images

Figure CN110751294B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Fintech (financial technology), and in particular to a model prediction method, device, terminal equipment and computer-readable storage medium combining multi-party feature data. Background Art
[0002] As a basic model, the linear regression model has been widely used in various scenarios. In the scenario of vertical federated learning among three parties (coordinator, demander and data provider), the demander and data provider need to perform modeling and model prediction without leaking their respective label information and feature information.
[0003] However, when there is one demander and multiple data providers, the existing linear regression model does not allow the demander and multiple data providers to transmit feature information to each other during the training and prediction process in order to ensure that the feature information is not leaked between the demander and the data providers. As a result, it is impossible to jointly establish a linear regression model with the demander and the data providers for effective model prediction. Summary of the invention
[0004] The main purpose of the present invention is to provide a model prediction method, device, terminal device and computer-readable storage medium that combine feature data from multiple parties, aiming to solve the technical problem of how to establish a linear regression model for effective model prediction by combining demanders and data providers without leaking feature data to each other.
[0005] To achieve the above-mentioned object, the present invention provides a model prediction method for combining feature data of multiple parties, wherein the model prediction method for combining feature data of multiple parties is applied to a coordinator, wherein the coordinator is in communication connection with a demander and each data provider, and the demander is in communication connection with each data provider, and the model prediction method for combining feature data of multiple parties comprises:
[0006] Acquire the model prediction task initiated by the demander, and determine the multi-party feature data required to process the model prediction task;
[0007] Performing linear regression calculation in conjunction with the demander and the data providers corresponding to the characteristic data of the multiple parties to obtain local calculation results of the demander and the data providers respectively;
[0008] Calculating the sum of the norms of the local calculation results, and when it is detected that the sum of the norms is less than the norm threshold, optimizing the local calculation results;
[0009] The optimized local calculation results are fed back to the demand side and each of the data providers, so that the demand side and each of the data providers can update the local model parameters.
[0010] Furthermore, the step of determining the multi-party feature data required for processing the model prediction task includes:
[0011] The coordinator extracts the data label carried by the model prediction task;
[0012] Parse and identify label information of the data label, and determine the multi-party feature data required for processing the model prediction task based on the label information.
[0013] Further, after the step of determining the multi-party feature data required for processing the model prediction task, the method further includes:
[0014] The coordinator sends a public key to the demander and each of the data providers, so that the demander and each of the data providers can perform encrypted data exchange when performing linear regression calculations.
[0015] Furthermore, the step of combining the characteristic data of multiple parties to perform calculations to obtain local calculation results includes:
[0016] The coordinator, together with the demander and each of the data providers, initializes a local model and calculates respective local intermediate prediction values, wherein the local model at least includes a linear regression model;
[0017] Coordinate the demander and each of the data providers to perform encrypted interaction on their respective local intermediate prediction values based on the public key, so as to calculate the local calculation results of their respective linear regression models.
[0018] Furthermore, before the step of the coordinator jointly with the demander and each of the data providers initializing a local model and calculating respective local intermediate prediction values, the method further includes:
[0019] In each round of training calculation of the linear regression model, the coordinator coordinates the demander to distribute a preset amount of data to each of the data providers, so that each of the data providers can provide their own feature data according to the preset amount of data.
[0020] Furthermore, the step of calculating the sum of the norms of the local calculation results includes:
[0021] The coordinator extracts local calculation results of the demander and each of the data providers;
[0022] The preset private key is read to decrypt each of the local calculation results, and the sum of the norms of the decrypted local calculation results is superimposed and calculated.
[0023] Furthermore, the step of feeding back the optimized local calculation results to the demand side and each of the data providers so that the demand side and each of the data providers can update the local model parameters includes:
[0024] The coordinator encapsulates the optimized local calculation results into a notification message used to notify the demand party and each data provider of model convergence, so that the demand party and each data provider can extract the optimized local calculation results and update the local model parameters based on the notification message.
[0025] In addition, to achieve the above-mentioned purpose, the present invention further provides a model prediction device for combining feature data of multiple parties, the model prediction device for combining feature data of multiple parties is applied to a coordinator, the coordinator is connected in communication with a demander and each data provider, the demander is connected in communication with each data provider, and the model prediction device for combining feature data of multiple parties comprises:
[0026] An acquisition module, used to acquire the model prediction task initiated by the demander, and determine the multi-party feature data required to process the model prediction task;
[0027] A uniting module, used to unite the demander and the data providers corresponding to the characteristic data to perform linear regression calculation, and obtain local calculation results of the demander and the data providers respectively;
[0028] an optimization module, configured to calculate the sum of the norms of the local calculation results, and when it is detected that the sum of the norms is less than the norm threshold, optimize the local calculation results;
[0029] The updating module is used to feed back the optimized local calculation results to the demander and each of the data providers, so that the demander and each of the data providers can update the local model parameters.
[0030] The present invention also provides a terminal device, comprising: a memory, a processor, and a model prediction program for joint multi-party feature data stored in the memory and executable on the processor, wherein the model prediction program for joint multi-party feature data implements the steps of the model prediction method for joint multi-party feature data as described above when executed by the processor.
[0031] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the model prediction method combining multi-party feature data as described above are implemented.
[0032] The model prediction method, device, terminal device and computer-readable storage medium for combining multi-party feature data proposed in the present invention are applied to a coordinator, which is in communication with a demander and each data provider, and the demander is in communication with each data provider. The coordinator obtains a model prediction task initiated by the demander and determines the multi-party feature data required for processing the model prediction task; linear regression calculation is performed on the demander and each data provider corresponding to the multi-party feature data to obtain local calculation results of the demander and each data provider; the sum of the norms of each local calculation result is calculated, and when it is detected that the sum of the norms is less than the norm threshold, each local calculation result is optimized; and the optimized local calculation results are fed back to the demander and each data provider so that the demander and each data provider can update local model parameters. The present invention is a coordination party that jointly establishes a linear regression model with a demand party and multiple data providers and performs model prediction. The coordination party obtains the model prediction task issued by the demand party, determines that each data provider provides multiple feature data, and jointly performs model training calculations on their respective local models with the demand party and each data provider based on the multiple feature data, thereby obtaining their respective local calculation results. Based on the superposition calculation of the sum of the norms of each local calculation result, and when it is detected that the sum of the norms is less than a preset norm threshold and the model convergence is judged, the coordination party performs final optimization processing on each local calculation result, and feeds back the optimized local calculation results to the demand party and each data provider, so that the demand party and each data provider can update the local model parameters based on the optimized local calculation results, thereby completing the current model prediction task. The present invention establishes a model through a coordinator who unites the demander and the data providers based on the gradient norm, without the need for the demander and the data providers to transmit data to each other. This achieves the goal of completing the model prediction task while ensuring that the label provider and the data providers do not leak their respective feature information to each other, and promotes the development of effective machine learning models in the industry for many application scenarios with one demander and multiple data providers. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a schematic diagram of the structure of the hardware operation involved in the embodiment of the present invention;
[0034] Figure 2 It is a flow chart of a first embodiment of a model prediction method combining multiple feature data of the present invention;
[0035] Figure 3 This is a schematic diagram of an application scenario of an embodiment of a model prediction method combining multiple feature data of the present invention;
[0036] Figure 4It is a structural schematic diagram of a model prediction device combining multi-party feature data according to the present invention.
[0037] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0038] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0039] like Figure 1 As shown, Figure 1 It is a structural diagram of the hardware operating environment involved in the embodiment of the present invention.
[0040] It should be noted that Figure 1 That is, it is a schematic diagram of the structure of the hardware operating environment of the terminal device. The terminal device in the embodiment of the present invention can be a PC, a portable computer and other terminal devices.
[0041] like Figure 1 As shown, the terminal device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or 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.
[0042] Those skilled in the art will understand that Figure 1 The terminal device structure shown in the figure does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0043] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a distributed task processing program. The operating system is a program that manages and controls the hardware and software resources of the sample terminal device, and supports the operation of the distributed task processing program and other software or programs.
[0044] exist Figure 1In the terminal device shown, the user interface 1003 is mainly used to communicate data with each terminal; the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; and the processor 1001 can be used to call the model prediction program of the joint multi-party feature data stored in the memory 1005, and perform the following operations:
[0045] Acquire the model prediction task initiated by the demander, and determine the multi-party feature data required to process the model prediction task;
[0046] Performing linear regression calculation in conjunction with the demander and the data providers corresponding to the characteristic data of the multiple parties to obtain local calculation results of the demander and the data providers respectively;
[0047] Calculating the sum of the norms of the local calculation results, and when it is detected that the sum of the norms is less than the norm threshold, optimizing the local calculation results;
[0048] The optimized local calculation results are fed back to the demand side and each of the data providers, so that the demand side and each of the data providers can update the local model parameters.
[0049] Further, the processor 1001 may call the model prediction program for combining multiple feature data stored in the memory 1005, and further perform the following operations:
[0050] The coordinator extracts the data label carried by the model prediction task;
[0051] Parse and identify label information of the data label, and determine the multi-party feature data required for processing the model prediction task based on the label information.
[0052] Furthermore, the processor 1001 may call the model prediction program for combining multiple feature data stored in the memory 1005, and after determining the multiple feature data required for processing the model prediction task, further perform the following operations:
[0053] The coordinator sends a public key to the demander and each of the data providers, so that the demander and each of the data providers can perform encrypted data exchange when performing linear regression calculations.
[0054] Further, the processor 1001 may call the model prediction program for combining multiple feature data stored in the memory 1005, and further perform the following operations:
[0055] The coordinator, together with the demander and each of the data providers, initializes a local model and calculates respective local intermediate prediction values, wherein the local model at least includes a linear regression model;
[0056] Coordinate the demander and each of the data providers to perform encrypted interaction on their respective local intermediate prediction values based on the public key, so as to calculate the local calculation results of their respective linear regression models.
[0057] Further, the processor 1001 may call the model prediction program for combining multi-party feature data stored in the memory 1005, and before executing the coordinator to initialize the local model in conjunction with the demander and each of the data providers and calculate the respective local intermediate prediction values, further perform the following operations:
[0058] In each round of training calculation of the linear regression model, the coordinator coordinates the demander to distribute a preset amount of data to each of the data providers, so that each of the data providers can provide their own feature data according to the preset amount of data.
[0059] Further, the processor 1001 may call the model prediction program for combining multiple feature data stored in the memory 1005, and further perform the following operations:
[0060] The coordinator extracts local calculation results of the demander and each of the data providers;
[0061] The preset private key is read to decrypt each of the local calculation results, and the sum of the norms of the decrypted local calculation results is superimposed and calculated.
[0062] Further, the processor 1001 may call the model prediction program for combining multiple feature data stored in the memory 1005, and further perform the following operations:
[0063] The coordinator encapsulates the optimized local calculation results into a notification message used to notify the demand party and each data provider of model convergence, so that the demand party and each data provider can extract the optimized local calculation results and update the local model parameters based on the notification message.
[0064] Based on the above structure, various embodiments of the model prediction method combining multiple feature data of the present invention are proposed.
[0065] Please refer to Figure 2 , Figure 2 Schematic diagram of the flow chart of the first embodiment of the model prediction method combining multiple feature data of the present invention.
[0066] The embodiments of the present invention provide an embodiment of a model prediction method combining multi-party feature data. It should be noted that although the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that here.
[0067] The model prediction method combining multi-party feature data in the embodiment of the present invention is applied to the above-mentioned terminal device. The terminal device in the embodiment of the present invention can be a PC, a portable computer or other terminal device, and no specific limitation is made here.
[0068] The model prediction method for combining multiple feature data in this embodiment is applied to a vertical federated learning system having multiple data providers at the same time, and is specifically applied to the coordinator of the vertical federated learning system. In the vertical federated learning system, the coordinator is connected in communication with the demander and each data provider, and the demander is connected in communication with each data provider. The model prediction method for combining multiple feature data in this embodiment includes:
[0069] Step S100, obtaining the model prediction task initiated by the demander, and determining the multi-party feature data required to process the model prediction task.
[0070] In a vertical federated learning system formed by a coordinator, a demander with labeled data, and multiple data providers with feature data, when it is detected that the demander has issued a model prediction task that requires model prediction to obtain a prediction result, the coordinator obtains the model prediction task and, based on the model prediction task, determines the multi-party feature data required to process the current model prediction task from the feature data owned by each data provider.
[0071] Furthermore, in step S100, the step of determining the multi-party feature data required for processing the model prediction task includes:
[0072] Step S101: the coordinator extracts the data label carried by the model prediction task.
[0073] After the coordinator obtains the model prediction task issued by the demand side that requires model prediction to obtain prediction results, the data label of the feature data specified by the demand side for this model prediction is extracted from the model prediction task.
[0074] Step S102, parse and identify the label information of the data label, and determine the multi-party feature data required for processing the model prediction task according to the label information.
[0075] After the coordinator extracts the data label carried in the model prediction task issued by the demand side, the data label is further parsed and identified to obtain the label information of the data label, and then based on the label information, the multi-party feature data required to process the model prediction task issued by the current demand side to obtain the model prediction result is determined from the feature data owned by multiple data providers in the current vertical federated learning system.
[0076] Furthermore, in another embodiment, after the step of determining the multi-party feature data required for processing the model prediction task in step S100, the model prediction method combining multi-party feature data of the present invention further includes:
[0077] In step A, the coordinator sends a public key to the demander and each of the data providers, so that the demander and each of the data providers can perform encrypted data exchange when performing linear regression calculations.
[0078] In such Figure 3 In the application scenario shown, in a vertical federated learning system formed by a coordinator, a demander with labeled data, and multiple data providers with feature data, after the coordinator obtains a model prediction task issued by the demander that requires model prediction to obtain a prediction result, and based on the model prediction task, determines the multi-party feature data required to process the current model prediction task in the feature data owned by each data provider, the same public key is sent to the demander of the current model prediction task (i.e., the demander) and the respective data providers of the determined multi-party feature data (i.e., the data providers), so that the demander and each data provider can perform homomorphic encryption on the intermediate results that need to be used interactively in the calculation process of local model training, thereby preventing the demander and each data provider from leaking their respective feature data to each other.
[0079] Step S200: performing linear regression calculation in conjunction with the demander and the data providers corresponding to the characteristic data to obtain local calculation results of the demander and the data providers.
[0080] In a vertical federated learning system formed by a coordinator, a demander with labeled data, and multiple data providers with feature data, the coordinator controls the joint demander and each data provider to perform local linear regression model training calculations in their respective local linear regression models based on the multi-party feature data required for processing the model prediction tasks issued by the demander, thereby calculating the local calculation results of their respective local linear regression models.
[0081] Further, step S200 includes:
[0082] Step S201: the coordinator, together with the demander and each of the data providers, initializes a local model and calculates their respective local intermediate prediction values.
[0083] The coordinator jointly controls the demand side and each data provider in the current vertical federated learning system, and each independently initializes the model of its own local linear regression model. After completing the initialization of the local model, it immediately starts to call the multi-party feature data required to process the model prediction task issued by the demand side that the coordinator has determined, and trains and calculates the local intermediate prediction value of each linear regression model.
[0084] Step S202, coordinate the demander and each of the data providers to perform encrypted interaction on their respective local intermediate prediction values based on the public key, so as to calculate the local calculation results of their respective linear regression models.
[0085] In such Figure 3 In the application scenario shown, when the demander and each data provider need to interactively use the local intermediate prediction values of their respective linear regression models obtained by their respective training calculations based on the local calculation results of the training calculations, the coordinator controls the demander and each data provider to use the public key pre-distributed to the demander and each data provider to adopt homomorphic encryption to encrypt each local intermediate prediction value, and then send the encrypted local intermediate prediction values interactively. In this way, the demander and each data provider can be prevented from leaking their respective feature data to each other, thereby ensuring the confidentiality of information data between the demander and each data provider.
[0086] Furthermore, in another embodiment, before the coordinator jointly initializes the local model with the demander and each of the data providers and calculates the local intermediate prediction values of each, in step S201, the model prediction method combining multi-party feature data of the present invention further includes:
[0087] Step B: In each round of training calculation of the linear regression model, the coordinator coordinates the demander to distribute a preset amount of data to each of the data providers, so that each of the data providers can provide their own feature data according to the preset amount of data.
[0088] In a vertical federated learning system formed by a coordinator, a demander with label data, and multiple data providers with feature data, when the coordinator controls the joint demander and each data provider to perform local training calculations in their respective local linear regression models based on the multi-party feature data required for processing the model prediction task issued by the demander, the coordinator controls the demander or the demander independently sends the amount of data for the current round of training calculations of the linear regression model to the coordinator and each data provider in the current vertical federated learning system before each round of local training of the linear regression model, so as to facilitate the coordinator to statistically process the maximum number of rounds of local model training of the linear regression model required for the current model prediction task, and the data providers with feature data can extract feature data of an amount of the same size from the features they own based on the amount of data for the current round of linear regression model training calculations sent by the demander for training calculations of the model in this round.
[0089] Step S300, calculating the sum of the norms of the local calculation results, and when it is detected that the sum of the norms is less than the norm threshold, optimizing the local calculation results.
[0090] The coordinator controls the joint demander and each data provider to perform local linear regression model training calculations in their respective local linear regression models based on the multi-party feature data required for processing the model prediction task issued by the demander, thereby calculating the local calculation results of their respective local linear regression models. At the same time, the sum of the norms of the local calculation results of the local linear regression models of the demander and each data provider is superimposed and calculated. When it is detected that the sum of the norms of the local calculation results obtained by the current round of linear regression model training calculations is less than the gradient norm threshold set in advance by the demander of the model prediction task, it is determined that the current linear regression model has converged, and then the local calculation results obtained by the current round of linear regression model training calculations are decrypted and multiplied by the update step size for optimization processing.
[0091] Furthermore, in step S300, the step of calculating the sum of the norms of the local calculation results includes:
[0092] Step S301, the coordinator extracts the local calculation results of the demander and each of the data providers;
[0093] Step S302, reading a preset private key to decrypt each of the local calculation results, and superimposing and calculating the sum of the norms of each of the decrypted local calculation results.
[0094] In the vertical federated learning system formed by the coordinator, the demander with label data and multiple data providers with feature data, after the coordinator receives the local calculation results (i.e., local gradients) of each round of linear regression model training calculation, it calls the public key sent in advance to the demander and each data provider to decrypt the encrypted local gradient with the corresponding unique private key, and superimposes the decrypted local gradient of the demander and the local gradients of multiple data providers to calculate the sum of the gradient norms.
[0095] Step S400, feeding back the optimized local calculation results to the demand side and each of the data providers, so that the demand side and each of the data providers can update the local model parameters.
[0096] Furthermore, step S400 includes:
[0097] In step S401, the coordinator encapsulates the optimized local calculation results into a notification message used to notify the demand party and each data provider of model convergence, so that the demand party and each data provider can extract the optimized local calculation results and update the local model parameters according to the notification message.
[0098] The coordinator determines whether the current linear regression model has converged by comparing whether the sum of each round of local calculation results (including the local gradients of the demander and each data provider) is less than the gradient norm threshold set in advance by the demander of the model prediction task. When it is determined that the current regression model has converged (that is, the sum of the local calculation results is less than the gradient norm threshold), the optimized local calculation results are encapsulated in a notification message used to notify the demander and each data provider that the current linear regression model has converged, thereby coordinating and controlling the demander and each data provider to extract the optimized local calculation results based on the notification message to update the local model parameters of their respective local linear regression models, thereby completing the prediction of the model prediction task initiated by the current demander.
[0099] Furthermore, in another embodiment, the coordinator may also coordinate and control the demander (i.e., the demander of the model prediction task) and each data provider to immediately start updating the model parameters of their respective local models when it detects that the model training round of the current linear regression model has reached the maximum training round calculated in advance based on the amount of data determined by the demander for each training calculation.
[0100] In this embodiment, in a vertical federated learning system formed by a coordinator, a demander with labeled data, and multiple data providers with feature data, when it is detected that a demander has issued a model prediction task that requires model prediction to obtain a prediction result, the coordinator obtains the model prediction task, and based on the model prediction task, determines the multi-party feature data required for processing the current model prediction task in the feature data owned by each data provider. In the vertical federated learning system formed by a coordinator, a demander with labeled data, and multiple data providers with feature data, the coordinator controls the joint demander and each data provider to perform local linear regression model training calculations in their respective local linear regression models based on the multi-party feature data required for processing the model prediction task issued by the demander, thereby calculating the local linear regression model of each local linear regression model. The calculation results are superimposed on the sum of the norms of the local calculation results of the local linear regression models of the demand side and each data provider. When it is detected that the sum of the norms of the local calculation results obtained by the current round of linear regression model training calculation is less than the gradient norm threshold set in advance by the demand side of the model prediction task, it is judged that the current linear regression model has converged, and then the local calculation results obtained by the current round of linear regression model training calculation are decrypted and multiplied by the update step size for optimization processing. The optimized local calculation results are encapsulated in a notification message used to notify the demand side and each data provider that the current linear regression model has converged, so as to coordinate and control the demand side and each data provider to extract the optimized local calculation results based on the notification message to update the local model parameters of their respective local linear regression models, that is, to complete the prediction of the model prediction task initiated by the current demand side.
[0101] It has been achieved that a model is established and effective model prediction is performed under the premise of ensuring that the demander and the data providers do not leak each other's characteristic information, which has promoted the development of effective machine learning models in the industry for many application scenarios with one demander and multiple data providers.
[0102] Furthermore, based on the first embodiment of the model prediction method for combining multiple feature data, a preferred embodiment of the model prediction method for combining multiple feature data of the present invention is proposed.
[0103] In a preferred embodiment of the model prediction method of combining multi-party feature data of the present invention, a vertical federated learning system is defined to be jointly formed by a coordinator A (arbiter), a demander (demander) G (guest) and multiple data providers H (host), and the following is defined:
[0104] H j : represents a data provider among multiple H sides; W G: represents the G-side model parameters; W Hj :Indicates H j Side model parameters;
[0105] x G : represents the sample characteristics of the G side; x Hj :Indicates H j Side sample features,y: represents label data, provided by the demand side G;
[0106] W G x G : represents the predicted value of each sample on the G side; W Hj x Hj :Indicates H j The predicted value of each sample on the side; [[]]: indicates the value after homomorphic encryption; represents the residual after encryption;
[0107] Indicates H j Gradient of encrypted side model parameters; Represents the encrypted gradient of the G-side model parameters;
[0108] Indicates H j Side model parameter gradient norm; Represents the gradient norm of the G-side model parameters; TOL: represents the gradient norm threshold.
[0109] Prerequisites: Each H j The H side and the G side complete the common sample screening through the encrypted ID intersection. In the following training steps, the same ID value is used by default each time. j At the same time, it participates in training and performs local intermediate calculation results with the G side (W G x G and W Hj x Hj ) interaction.
[0110] Step 1: When detecting that the G side issues a model prediction task, the A side generates a public key and transmits it to each H side. j side, G side;
[0111] Step 2: Party G decides the amount of training data per round and sends it to each H j side, G side;
[0112] Step 3: Each H j The local model is initialized on the G side and the local intermediate calculation result W is calculated. G x G and W Hj x Hj ;
[0113] Step 4: Each H j The intermediate calculation result W of the side facing oneself Hj x Hj Use homomorphic encryption technology to encrypt (using a public key) to generate each [[W Hj x Hj ]] and send it to the G side;
[0114] Step 5: G side combined with each H j The intermediate calculation results sent by the side [[W Hj x Hj ]]Calculate the encryption residual value [[d i ]], G sideways to all H j Side send [[d i ]](Each H j Side A and Side B cannot decrypt this value because they only have the public key);
[0115] Step 6: Each Hj side and G side uses its own intermediate calculation results and encrypted residual values to calculate the encrypted local gradient and send it to the A side;
[0116] Step 7: Side A uses the private key to decrypt the local gradient and optimize it (such as multiplying it by the update step size, etc.), and then sends the optimized model prediction value to side G and each H. j side, and side A decides whether to converge based on the gradient norm and notifies side G and all H j That is, at the end of each round of training of the current linear regression model, all G sides and H j The sum of the side gradient norms is compared with the gradient norm threshold TOL. If the sum of the norms is less than the threshold, the model is judged to have converged. If the sum of the norms is greater than or equal to the threshold, the model has not converged and enters the next round of training.
[0117] Step 8: Each H j After receiving the model convergence notification from party A, side G updates the local model parameters and repeats steps 3 to 8 until each H j All feature data provided by the side are used, and steps 2 to 8 are repeated until the current linear regression model converges or the maximum number of model training rounds is reached.
[0118] In this embodiment, through steps 1 to 8, each H j The H side and the G side each independently train some linear regression model parameters, and in the whole process each H j The A side and the G side do not disclose their own data and model parameter information to each other, and the A side cannot know the j The data information of the G side and the G side is realized in this way, while ensuring the G side and each H side jThe two parties can establish models and perform effective model predictions without leaking each other's feature information, which promotes the development of effective machine learning models in many application scenarios where there is one demander and multiple data providers.
[0119] In addition, please refer to Figure 4 The embodiment of the present invention further proposes a model prediction device for combining multiple feature data. The model prediction device for combining multiple feature data of the present invention is applied to a coordinator, the coordinator is connected to the demander and each data provider in communication, the demander is connected to each data provider in communication, and the model prediction device for combining multiple feature data of the present invention comprises:
[0120] An acquisition module, used to acquire a model prediction task and determine the multi-party feature data required to process the model prediction task;
[0121] A uniting module, used for uniting the characteristic data of multiple parties to perform calculations to obtain local calculation results, and calculating the sum of the norms of the local calculation results;
[0122] An acquisition module, used to acquire the model prediction task initiated by the demander, and determine the multi-party feature data required to process the model prediction task;
[0123] A uniting module, used to unite the demander and the data providers corresponding to the characteristic data to perform linear regression calculation, and obtain local calculation results of the demander and the data providers respectively;
[0124] an optimization module, configured to calculate the sum of the norms of the local calculation results, and when it is detected that the sum of the norms is less than the norm threshold, optimize the local calculation results;
[0125] The updating module is used to feed back the optimized local calculation results to the demander and each of the data providers, so that the demander and each of the data providers can update the local model parameters.
[0126] Preferably, the acquisition module includes:
[0127] A first extraction unit, used by the coordinator to extract the data label carried by the model prediction task;
[0128] A parsing unit is used to parse and identify the label information of the data label, and determine the multi-party feature data required for processing the model prediction task based on the label information.
[0129] Preferably, the model prediction device combining multiple feature data of the present invention further includes:
[0130] The key distribution module is used for the coordinator to send a public key to the demander and each of the data providers, so that the demander and each of the data providers can perform encrypted data interaction when performing linear regression calculations.
[0131] Preferably, the combined module comprises:
[0132] A first joint calculation unit, configured for the coordinator to jointly initialize a local model with the demander and each of the data providers and calculate respective local intermediate prediction values, wherein the local model at least includes a linear regression model;
[0133] The coordination unit is used to coordinate the demander and each of the data providers to perform encrypted interaction on their respective local intermediate prediction values based on the public key, so as to calculate the local calculation results of their respective linear regression models.
[0134] Preferably, the joint module further includes:
[0135] The first coordination unit is used for the coordination party to coordinate the demander to distribute a preset data volume to each data provider in each round of training calculation of the linear regression model, so that each data provider provides its own feature data according to the preset data volume.
[0136] Preferably, the optimization module comprises:
[0137] A second extraction unit, used for the coordinator to extract the local calculation results of the demander and each of the data providers;
[0138] The superposition calculation unit is used to read a preset private key to decrypt each of the local calculation results, and to superpositionally calculate the sum of the norms of the decrypted local calculation results.
[0139] Preferably, the update module includes:
[0140] The second coordination unit is used for the coordination party to encapsulate the local calculation results after optimization processing into a notification message used to notify the demand party and each of the data providers of model convergence, so that the demand party and each of the data providers can extract the local calculation results after optimization processing and update the local model parameters according to the notification message.
[0141] Among them, the steps implemented by each functional module of the model prediction device that combines multi-party feature data can refer to the various embodiments of the terminal face unlocking startup control method of the present invention, and will not be repeated here.
[0142] In addition, an embodiment of the present invention also proposes a computer-readable storage medium, which is applied to a computer. The computer-readable storage medium may be a non-volatile computer-readable storage medium, and a model prediction program for combining multi-party feature data is stored on the computer-readable storage medium. When the model prediction program for combining multi-party feature data is executed by a processor, the steps of the model prediction method for combining multi-party feature data as described above are implemented.
[0143] Among them, the steps implemented when the model prediction program for combining multi-party feature data running on the processor is executed can refer to the various embodiments of the model prediction method for combining multi-party feature data of the present invention, and will not be repeated here.
[0144] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0145] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0146] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0147] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A model prediction method combining multiple feature data, characterized in that: The model prediction method combining feature data of multiple parties is applied to the coordinating party, and the model prediction method combining feature data of multiple parties includes: Obtaining a model prediction task initiated by a demander, and determining multi-party feature data required to process the model prediction task; Performing linear regression calculation in conjunction with the demander and the data providers corresponding to the characteristic data of the multiple parties to obtain local calculation results of the demander and the data providers respectively; Calculating the sum of the norms of the local calculation results, and when it is detected that the sum of the norms is less than a preset norm threshold, optimizing the local calculation results; Feeding back the optimized local calculation results to the demander and the data providers, so that the demander and the data providers can update the local model parameters to complete the prediction of the model prediction task; Before performing linear regression calculation in conjunction with the demander and the data providers corresponding to the feature data of the multiple parties, the method further includes: The public key is sent to the demander and each of the data providers so that the demander and each of the data providers can perform encrypted data exchange when performing linear regression calculations.
2. The model prediction method combining multiple feature data as claimed in claim 1, characterized in that: The step of determining the multi-party feature data required for processing the model prediction task includes: Extracting data labels carried by the model prediction task; Parse and identify label information of the data label, and determine the multi-party feature data required for processing the model prediction task based on the label information.
3. The model prediction method combining multiple feature data as claimed in claim 1, characterized in that: The step of performing linear regression calculation on the demander and the data providers corresponding to the feature data to obtain local calculation results of the demander and the data providers respectively includes: The coordinator, together with the demander and each of the data providers, initializes a local model and calculates respective local intermediate prediction values, wherein the local model at least includes a linear regression model; Coordinate the demander and each of the data providers to perform encrypted interaction on their respective local intermediate prediction values based on the public key, so as to calculate the local calculation results of their respective linear regression models.
4. The model prediction method combining multiple feature data as claimed in claim 3, characterized in that: Before the step of the coordinator jointly with the demander and each of the data providers initializing the local model and calculating the respective local intermediate prediction values, the step further includes: In each round of training calculation of the linear regression model, the coordinator coordinates the demander to distribute a preset amount of data to each of the data providers, so that each of the data providers can provide their own feature data according to the preset amount of data.
5. The model prediction method combining multiple feature data as claimed in claim 1, characterized in that: The step of calculating the sum of the norms of the local calculation results comprises: The coordinator extracts local calculation results of the demander and each of the data providers; The preset private key is read to decrypt each of the local calculation results, and the sum of the norms of the decrypted local calculation results is superimposed and calculated.
6. The model prediction method combining multiple feature data as claimed in claim 1, characterized in that: The step of feeding back the optimized local calculation results to the demander and each of the data providers so that the demander and each of the data providers can update the local model parameters includes: The coordinator encapsulates the optimized local calculation results into a notification message used to notify the demand party and each data provider of model convergence, so that the demand party and each data provider can extract the optimized local calculation results and update the local model parameters based on the notification message.
7. A model prediction device combining multiple feature data, characterized in that: The model prediction device for combining multiple feature data is applied to the coordinator, the coordinator is connected in communication with the demander and each data provider, the demander is connected in communication with each data provider, and the model prediction device for combining multiple feature data includes: An acquisition module, used to acquire the model prediction task initiated by the demander, and determine the multi-party feature data required to process the model prediction task; A uniting module, used to unite the demander and the data providers corresponding to the characteristic data to perform linear regression calculation, and obtain local calculation results of the demander and the data providers respectively; an optimization module, configured to calculate the sum of the norms of the local calculation results, and when it is detected that the sum of the norms is less than the norm threshold, optimize the local calculation results; An updating module, used for feeding back the optimized local calculation results to the demander and each of the data providers, so that the demander and each of the data providers can update the local model parameters; The key distribution module is used for the coordinator to send a public key to the demander and each of the data providers, so that the demander and each of the data providers can perform encrypted data interaction when performing linear regression calculations.
8. A terminal device, characterized in that: The terminal device includes: a memory, a processor, and a model prediction program for joint multi-party feature data stored in the memory and executable on the processor. When the model prediction program for joint multi-party feature data is executed by the processor, the steps of the model prediction method for joint multi-party feature data as described in any one of claims 1 to 6 are implemented.
9. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the steps of the model prediction method for combining multi-party feature data according to any one of claims 1 to 6.
Citation Information
Patent Citations
Model parameter obtaining method and system based on federation learning and readable storage medium
CN109165515A
A time sequence generation method based on a block chain technology
CN109710488A