A method, device, storage medium, equipment and program product for joint prediction
Through the use of the same -state encryption processing and computing method in the privacy computing scenario, the problem of low efficiency of tree models in multi -party joint forecasting is solved, and efficient prediction results transmission under data security guarantee is realized.
Patent Information
- Application Number
- CN202411033477.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-07-30
AI Technical Summary
In privacy computing scenarios, it is difficult for the prior art to efficiently realize multi-party joint prediction based on tree models while ensuring data security.
Through the same encryption and operations between the first participants and the second participant, the prediction results of the target object are transmitted. Specific steps include: the first participant is encrypted based on local characteristics data, and the first ciphertext is generated; the second participant received and performed homogeneous computing to generate a second cipher; eventually the first participant to get the prediction results.
Under the premise of ensuring data security, this method has improved the efficiency of tree models in multi -party joint forecasts, and reduced the number of network communication times, especially in the scenario where the participating distance is far away or the network delay is high. Predictive value.
Smart Images

Figure CN118573471B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of privacy computing technology, and in particular, to a joint prediction method, apparatus, storage medium, device, and program product. Background Art
[0002] A tree model, also known as a decision tree model, is a binary tree model trained using machine learning methods. Non-leaf nodes in the tree model store judgment conditions, such as feature numbers and feature thresholds, and leaf nodes store prediction values. Through the tree model, a certain characteristic of a business object can be predicted based on its feature data.
[0003] In privacy computing scenarios, tree models are generally obtained through multi-party federation training. Each party only has part of the feature data of the business object and only maintains part of the node information of the tree model. That is, in each party's tree model, the non-leaf nodes corresponding to the feature data that the party does not have are unknown. Multiple parties can jointly use the tree model to jointly predict certain characteristics of the business object through the feature data of the business object they own.
[0004] It is hoped that there will be an improved solution that can more efficiently utilize the tree model to achieve multi-party joint prediction while ensuring data security. Summary of the invention
[0005] In view of this, one or more embodiments of the present specification provide a joint prediction method, apparatus, storage medium, device and program product, which can more efficiently implement tree model-based joint prediction while ensuring data security.
[0006] According to a first aspect of one or more embodiments of this specification, a joint prediction method is proposed, involving a first participant and a second participant, wherein the first participant and the second participant each maintain partial node information of a tree model; the method is applied to the second participant, comprising:
[0007] Determine, according to the second characteristic part of the target object held locally, a second leaf node list and a corresponding second prediction value list into which the target object may fall in the tree model;
[0008] receiving a first ciphertext sent by the first participant, where the first ciphertext is obtained by homomorphic encryption based on a first leaf node list and a first prediction value list; the first leaf node list and the first prediction value list are determined by the first participant according to a first feature portion of a target object held by the first participant;
[0009] Using the second leaf node list and the second prediction value list, performing a homomorphic operation on the first ciphertext to obtain a second ciphertext;
[0010] The second ciphertext is sent to the first participant so that the first participant decrypts the ciphertext to obtain the prediction result of the target object.
[0011] According to a second aspect of one or more embodiments of this specification, another joint prediction method is proposed, involving a first participant and a second participant, wherein the first participant and the second participant each maintain partial node information of a tree model, and the method is applied to the first participant, including:
[0012] Determine, according to the first characteristic part of the target object held locally, a first leaf node list and a corresponding first prediction value list into which the target object may fall in the tree model;
[0013] Based on the first leaf node list and the first predicted value list, homomorphic encryption processing is performed to obtain a first ciphertext;
[0014] sending the first ciphertext to the second party;
[0015] receiving a second ciphertext sent by the second participant; the second ciphertext is obtained by performing a homomorphic operation on the first ciphertext using a second leaf node list and a second prediction value list, wherein the second leaf node list and the second prediction value list are determined by the second participant according to a second feature portion of the target object held by the second participant;
[0016] The second ciphertext is decrypted to obtain a prediction result of the target object.
[0017] According to a third aspect of an embodiment of this specification, a joint prediction device is provided, wherein the joint prediction involves a first participant and a second participant, wherein the first participant and the second participant each maintain partial node information of a tree model; the device is applied to the second participant, and includes:
[0018] A determination module, configured to determine, based on a second characteristic portion of the target object held locally, a second leaf node list and a corresponding second prediction value list into which the target object may fall in the tree model;
[0019] A receiving module, configured to receive a first ciphertext sent by the first participant, where the first ciphertext is obtained by homomorphic encryption based on a first leaf node list and a first prediction value list; the first leaf node list and the first prediction value list are determined by the first participant according to a first feature portion of a target object held by the first participant;
[0020] A computing module, configured to perform a homomorphic operation on the first ciphertext by using the second leaf node list and the second prediction value list to obtain a second ciphertext;
[0021] The sending module is used to send the second ciphertext to the first participant so that the first participant can decrypt the second ciphertext to obtain the prediction result of the target object.
[0022] According to a fourth aspect of an embodiment of this specification, another joint prediction device is provided, wherein the joint prediction involves a first participant and a second participant, wherein the first participant and the second participant each maintain partial node information of a tree model, and the device is applied to the first participant, including:
[0023] A determination module, configured to determine, based on a first feature portion of a target object held locally, a first leaf node list and a corresponding first prediction value list into which the target object may fall in the tree model;
[0024] An encryption module, used for performing homomorphic encryption processing based on the first leaf node list and the first predicted value list to obtain a first ciphertext;
[0025] A sending module, used for sending the first ciphertext to the second participation method;
[0026] a receiving module, configured to receive a second ciphertext sent by the second participant; the second ciphertext is obtained by performing a homomorphic operation on the first ciphertext using a second leaf node list and a second prediction value list, wherein the second leaf node list and the second prediction value list are determined by the second participant according to a second feature portion of the target object held by the second participant;
[0027] A decryption module is used to decrypt the second ciphertext to obtain a prediction result of the target object.
[0028] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the joint prediction method as described in the first aspect or the second aspect of the embodiments of this specification is implemented.
[0029] According to the sixth aspect of the embodiments of this specification, a computer device is provided, comprising: a processor; a memory for storing processor executable instructions; the processor executes the executable instructions to implement the joint prediction method as described in the first aspect or the second aspect of the embodiments of this specification.
[0030] According to the seventh aspect of the embodiments of this specification, a computer program product is provided, including a computer program or instructions, which, when executed by a processor, implements the joint prediction method as described in the first aspect or the second aspect of the embodiments of this specification.
[0031] One or more embodiments of the present specification provide a joint prediction method, apparatus, storage medium, device and program product, involving two participants, a first participant and a second participant, each of which maintains information of different parts of nodes of the same tree model. The two participants determine the possible node list and prediction value list based on the characteristics of the target object held locally. The first participant encrypts the first leaf node list and the first prediction value list to obtain a first ciphertext, and sends the first ciphertext to the second participant. The second participant uses the second leaf node list and the second prediction value list obtained by local prediction to perform homomorphic operations on the first ciphertext to obtain a second ciphertext, and sends the second ciphertext to the first participant. The first participant decrypts the second ciphertext to obtain the prediction result of the target object.
[0032] In the above method, the intermediate results sent by the first and second participants are ciphertexts processed by homomorphic encryption, and the above method utilizes the characteristics of homomorphic operations. Through homomorphic operations between plaintext and ciphertext, the final prediction value is calculated. It can be seen that there is no leakage of intermediate information in the above calculation process. The first participant can only know the final prediction result, and cannot know the leaf node that each tree finally reaches. Although the second participant can receive the first ciphertext, the second participant cannot decrypt the first ciphertext and the second ciphertext to obtain the plaintext, nor can it obtain any intermediate information.
[0033] In addition, the communication efficiency of the above method is more efficient. Specifically, in the above communication process, only one round of network round-trips is required, in which the first participant sends the first ciphertext to the second participant and the second participant sends the second ciphertext to the first participant. In the scenario where the first participant and the second participant are far apart or the network delay is high, compared with the first and third methods in the related art, the first participant can obtain the predicted value more quickly.
[0034] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.
[0036] Figure 1 This is a schematic diagram of a tree model shown in this specification;
[0037] Figure 2 This is a schematic diagram of a tree model in a joint prediction scenario shown in this specification;
[0038] Figure 3This specification is a flowchart of a joint prediction method according to an exemplary embodiment;
[0039] Figure 4 This specification is a block diagram of a joint prediction device according to an exemplary embodiment;
[0040] Figure 5 This specification is a block diagram of another joint prediction device according to an exemplary embodiment;
[0041] Figure 6 It is a hardware structure diagram of a computer device shown in this specification according to an exemplary embodiment. DETAILED DESCRIPTION
[0042] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0043] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0044] A tree model is a model for decision-making that is trained using machine learning methods, also known as a decision tree. A general decision tree model consists of multiple binary trees. The non-leaf nodes of each tree store judgment conditions, which include feature numbers and feature thresholds. The feature number is also the data that characterizes the type of feature. The leaf nodes store the predicted value (score). By inputting the feature data of a business object into the tree model, the score of a certain characteristic of the business object can be predicted.
[0045] Specifically, in the process of prediction through the tree model, the characteristic data of the business object is first input into multiple trees respectively. In each tree, for any non-leaf node N where the business object falls, the characteristic data is compared with the characteristic threshold. If the corresponding characteristic data is less than the characteristic threshold, the business object is further divided into the left child node NL of the node N, and the judgment is continued according to the judgment condition of the child node NL; if the corresponding characteristic data is greater than or equal to the characteristic threshold, the business object is divided into the child node NR on the right side of the node N, and the judgment is performed according to the judgment condition of the child node NR; until the leaf node is reached. The predicted value of the leaf node reached is the predicted value of the business object under the tree. In this way, the predicted value of the business object under multiple trees can be obtained, and finally the predicted values of multiple trees are added to obtain the predicted value of the business object.
[0046] For example, Figure 1 As shown, the tree model includes tree 1 and tree 2. The vehicle driving safety score of the business object can be determined through tree 1 and tree 2. Feature 1 represents the driving age of the business object, and feature 2 represents the number of times the business object has learned traffic knowledge in the previous year.
[0047] Assume that the feature data of the input tree model is: feature 1 value is 2, feature value is 20.
[0048] First, for tree 1: input the feature data into tree 1. At the first non-leaf node (root node) of tree 1, if the value 2 of feature 1 is less than the feature threshold 3 of the non-leaf node, the business object is divided into the non-leaf node on the left. The judgment condition of the non-leaf node is feature 2 and feature threshold 10. Since the feature 2 value of the business object is 20, which is greater than the feature threshold 10, the business object falls into the leaf node on the right. Therefore, the predicted value of the business object in tree 1 is 0.2.
[0049] Secondly, for tree 2, similar to the processing method after inputting into tree 1, the predicted value of the business object in tree 2 is 0.2. Finally, the predicted value of tree 1, 0.2, is added to the predicted value of tree 2, 0.4, which means that the driving safety score of the business object is 0.4.
[0050] Recently, in order to protect data privacy, it is proposed to use tree models for multi-party joint prediction in privacy computing scenarios. Different from the method of using tree models for prediction in unilateral scenarios, the joint prediction using tree models in privacy computing scenarios has the following characteristics:
[0051] First of all, privacy computing is generally jointly participated by multiple parties, and different types of features belong to different participants. For example, participant P1 has the driving age data of the business object, and participant P2 has the data on the number of times the business object learned traffic knowledge in the previous year.
[0052] Secondly, the tree model is also trained by multiple participants using the federated learning method. Although each participant has a tree model, they only have a "partial" model. Specifically, the model structure owned by each participant is the same, but the content in the node may be different. For non-leaf nodes, each participant only maintains the non-leaf nodes involving the feature data it owns, and the judgment conditions of other non-leaf nodes are unknown to the participants. For leaf nodes, the predicted value of each leaf node is split into shards through secret sharing and distributed in the leaf nodes of multiple participants. That is, the sum of the shards of the corresponding leaf nodes of multiple participants is the predicted value of the trained leaf node.
[0053] Among them, secret sharing is a technology that divides secret information into multiple shares and distributes them to different participants. Each participant cannot infer the size of the secret information itself from the shares obtained. The reason why the prediction value needs to be split into the tree model of multiple participants through secret sharing is that the tree model is trained with the feature data of multiple participants. If a participant knows the prediction value of the leaf node obtained through training, then the data distribution of the feature data owned by other participants can be inferred, which will cause privacy data leakage.
[0054] In addition, in privacy computing scenarios, multiple parties are generally required to achieve joint prediction through a privacy protocol. Next, a specific example will be used to illustrate the joint prediction method in the privacy computing scenario in related technologies.
[0055] Figure 1 In the example shown, assuming that feature 1 belongs to Alice and feature 2 belongs to Bob, then the tree 1 model owned by Alice and Bob is as follows Figure 2 As shown in the figure, since the principles of tree 1 and tree 2 are the same, the tree 2 model will not be described in detail here.
[0056] like Figure 2 As shown in the figure, Alice only has feature 1, so Alice's tree model only maintains the judgment conditions of non-leaf nodes corresponding to feature 1, and the judgment conditions of non-leaf nodes related to feature 2 are unknown; Bob only has feature 2, so Bob's tree model only maintains the judgment conditions of non-leaf nodes corresponding to feature 2, and the judgment conditions of other non-leaf nodes are unknown. For leaf nodes, the corresponding leaf nodes of the two can be obtained by adding the slices together. Figure 1The predicted value of the corresponding leaf node in tree 1, for example, for the leaf node with node number 0, Figure 1 The predicted value of the leaf node in the tree model is 0.1. According to the secret sharing method, 0.1 is split into two parties. The predicted value of the leaf node in Alice's tree model is 0.07, and the predicted value of the leaf node in Bob's tree model is 0.03. The sum of the predicted values of the leaf node of the two is 0.1.
[0057] In the joint prediction process, the two participants first predict each tree independently. In each tree, if the judgment condition of the non-leaf node is a known state, that is, the participant has the feature data corresponding to the non-leaf node, then Figure 1 Similar to the example shown, if the value of the feature data is less than the feature threshold of the non-leaf node, it is divided into the node on the left, and if the value of the feature data is greater than or equal to the feature threshold, it is divided into the node on the right. If the judgment condition of the non-leaf node is an unknown state, it is divided into nodes on both sides at the same time, and finally a list of leaf nodes that may be reached can be obtained. The leaf node list can be in the form of a binary vector, and the value of the element in the vector can be used to represent whether the leaf node corresponding to the element can be reached. For example, if the corresponding leaf node can be reached, the corresponding element takes 1, otherwise it takes 0.
[0058] Assume that for the target object, the feature 1 data of the target object owned by Alice is 2, and the feature 2 data of the target object owned by Bob is 20. Next, several joint prediction methods in related technologies will be described by taking Alice's need to obtain the predicted value of the business object as an example.
[0059] For the convenience of explanation, the concept of prediction node vector is introduced here, and the prediction node vector can correspond to the leaf node list mentioned above. The prediction node vector is used to represent the reachable leaf nodes in a certain tree predicted by any participant for the characteristic data of a certain business object. The prediction node vector can be represented as a binary vector. The number of elements in the vector is equal to the number of leaf nodes in the tree. The value of the element at each position in the vector is used to represent whether it will fall into the leaf node at that position in the tree. For example, for Alice, when using the characteristic data of the business object for prediction, in tree 1, if the node numbers of the reachable leaf nodes corresponding to the target object are 0 and 1, then for the business object, the prediction node vector of Alice's tree 1 is [1,1,0]. Here, the leaf node that can fall into the corresponding position is represented by the value of 1 in the vector.
[0060] The first method of joint prediction:
[0061] First, Alice and Bob predict each tree independently. For example, for tree 1, Alice inputs the data of feature 1 with value 2. According to the above prediction rules and Figure 2 From the tree 1 shown in , we can see that in Alice's tree 1, the target object can reach the nodes with leaf nodes numbered 0 and 1. Correspondingly, in Alice's tree 1, the predicted node vector is [1,1,0]. Similar to Alice, it can be determined that in Bob's tree 1, the predicted node vector is [0, 1, 1].
[0062] Secondly, Bob sends the prediction node vector corresponding to each of his trees to Alice. Alice multiplies the prediction node vector of the tree with that of Bob by element, and obtains the leaf node that the target object reaches. For example, for tree 1, Alice multiplies the prediction node vectors [1,1,0] and [0,1,1] for tree 1 by element, and obtains [0,1,0], which means that the leaf node that the target object finally reaches in tree 1 is the leaf node with node number 1. It can be proved that there is only one element 1 in the vector obtained by element-wise multiplication.
[0063] Finally, Alice sends the node number of the leaf node that each tree finally reaches to Bob, and Bob adds the predicted values of the nodes corresponding to the above node numbers of each tree together and sends it back to Alice. For example, for tree 1, the final leaf node reached is the leaf node with node number 1. Assuming that Bob maintains two trees, and the leaf node that tree 2 finally reaches is the leaf node with node number 0, and the predicted value of the leaf node with node number 0 of tree 2 is 0.06, then the predicted value 0.1 of the leaf node with node number 1 of tree 1 and the predicted value 0.06 of the leaf node with node number 0 of tree 2 can be added to get 0.16, which is sent to Alice.
[0064] Alice then adds the predicted value of the node corresponding to the above node number in each tree maintained by Alice to the predicted value sent by Bob, and obtains the final predicted value result. Using the above example, assuming that the predicted value of the leaf node with node number 0 of tree 2 maintained by Alice is 0.14, then Alice can add the predicted value 0.1 of the leaf node with node number 1 of tree 1 to the received 0.16, and the predicted value 0.14 corresponding to tree 2, to obtain the final predicted value 0.4.
[0065] However, the above method has the following problems:
[0066] First, two network round trips are required, which will consume more network communication resources if the distance between Alice and Bob is far or the communication is blocked.
[0067] Secondly, the above method is not secure enough. Specifically, Alice can know the list of nodes that Bob may reach, and Bob can know the number of the node that is finally reached, which leaks the intermediate values except the results. Furthermore, Alice may obtain the prediction results by constructing data, and then infer the conditions of the non-leaf nodes of the tree model and the predicted values of the leaf nodes through the prediction results. The model is obtained by the two parties through federal training. If the value of the tree model is leaked, the distribution of the data used to train the tree model may be leaked, and the security is insufficient.
[0068] Second method:
[0069] The second method is similar to the first method and is an improvement on the first method. In the first method, Bob sends the prediction node vector of each of his trees to Alice. The difference is that in the second method, Alice sends the prediction node vector of each of her trees to Bob. For example, in the above example, Alice can send the prediction node vector [1,1,0] of tree 1 to Bob. Bob multiplies it with the prediction node vector of his own tree 1 element by element to obtain the leaf node that the target object reaches. For example, for tree 1, Bob multiplies the prediction node vectors [1,1,0] and [0, 1, 1] of tree 1 element by element to obtain [0,1,0], indicating that the leaf node that the target object finally reaches in tree 1 is the leaf node with node number 1.
[0070] After Bob determines the leaf node that each tree will eventually reach, he can add up his own prediction values of the leaf nodes reached by each tree to get his own prediction value. Bob sends his own prediction value and his own prediction node vector to Alice. Alice also multiplies her own prediction node vector by the received prediction node vector of Bob element by element to determine the leaf node that the target object can reach in each tree, and then can add up the prediction value of the leaf node reached by each tree maintained by herself and the prediction value received by Bob to get the final prediction value.
[0071] Although the second method reduces one communication compared to the first method, it leaks more intermediate information. Alice and Bob know each other's predicted node vector and the final leaf node at the same time, which has insufficient security.
[0072] Third method:
[0073] Alice and Bob each obtain their own prediction node vectors, and intersect the two prediction node vectors using the Private Set Intersection (PSI) technology to obtain the final leaf node.
[0074] However, the above method still requires multiple rounds of interaction. And the above method is only applicable to the scenario of one tree. If the tree model includes multiple trees, it is necessary to use PSI to find the intersection of each tree to obtain the leaf node that each tree finally reaches. Moreover, the leaf node that each tree finally reaches is still an intermediate value. The above method still leaks intermediate information and is not secure enough.
[0075] In order to solve the above problems, a joint prediction method is provided in one or more embodiments of the present specification, involving two participants, a first participant and a second participant, each of which maintains information of different parts of nodes of the same tree model. The two participants determine the node list and prediction value list that may fall into the target object based on the characteristics of the local target object. The first participant performs homomorphic encryption processing based on the first leaf node list and the first prediction value list obtained to obtain a first ciphertext, and sends the first ciphertext to the second participant. The second participant uses the second leaf node list and the second prediction value list obtained by local prediction to perform homomorphic operation on the first ciphertext to obtain a second ciphertext, and sends the second ciphertext to the first participant. The first participant decrypts the second ciphertext to obtain the prediction result of the target object.
[0076] In the above method, the intermediate results sent by the first participant and the second participant are ciphertexts processed by homomorphic encryption, and the above method utilizes the characteristics of homomorphic operations. Through homomorphic operations between plaintext and ciphertext, the final prediction value is calculated. It can be seen that there is no leakage of intermediate information in the above calculation process. The first participant can only know the final prediction result, and cannot know the leaf node that each tree finally reaches. Although the second participant can receive the first ciphertext, the second participant cannot decrypt the first ciphertext and the second ciphertext to obtain the plaintext, nor can it obtain any intermediate information.
[0077] In addition, the communication efficiency of the above method is more efficient. Specifically, in the above communication process, only one round of network round-trips is required, in which the first participant sends the first ciphertext to the second participant and the second participant sends the second ciphertext to the first participant. In the scenario where the first participant and the second participant are far apart or the network delay is high, compared with the first and third methods in the related art, the first participant can obtain the predicted value more quickly.
[0078] Next, the joint prediction method shown in this specification will be described in detail.
[0079] For the sake of convenience, the homomorphic encryption algorithm will be explained here first. Homomorphic encryption is a form of encryption that allows people to perform a specific form of algebraic operations on ciphertext and obtain a result that is still encrypted. The result obtained by decrypting it is the same as the result of the same operation on the plaintext. Homomorphic encryption allows algebraic calculations to be performed on encrypted data and obtain the correct result without decrypting the data during the entire processing process.
[0080] Homomorphic encryption operations are generally divided into fully homomorphic encryption (FHE) and semi-homomorphic encryption (PHE).
[0081] FHE supports homomorphic encryption operations of addition and multiplication on ciphertexts. For example, Enc(a) + Enc(b) = Enc(a+b) and Enc(a) * Enc(b) = Enc(a*b) can be satisfied. a and b are plaintexts, and Enc() indicates encryption operation on the content in brackets. It should also be noted that Enc(a) + Enc(b) represents homomorphic addition of ciphertexts, and does not mean directly multiplying two ciphertexts. This is due to the limitations of the encryption method, which makes the results of other algebraic operations of Enc(a) and Enc(b) equivalent to Enc(a+b) in some cases. This algebraic operation equivalent to Enc(a+b) is called homomorphic addition. Multiplication is similar. Enc(a) * Enc(b) represents homomorphic multiplication of ciphertexts, not directly multiplying two ciphertexts. The specific implementation method of homomorphic addition and homomorphic multiplication depends on the encryption method.
[0082] PHE refers to a homomorphic encryption algorithm that only supports one type of homomorphic encryption operation on the ciphertext. An encryption algorithm that only supports additive homomorphic operations can be called an additive homomorphic encryption (AHE) algorithm. For example, Paillier and Okamoto-Uchiyama (OU) belong to additive homomorphic encryption algorithms, satisfying Enc(a) +Enc(b) = Enc(a+b). An encryption algorithm that only supports multiplicative homomorphic operations, such as asymmetric encryption (Rivest-Shamir-Adleman, RSA), is a multiplicative homomorphic encryption algorithm, satisfying Enc(a) * Enc(b) = Enc(a*b).
[0083] It should also be noted that in addition to the operations mentioned above, the additive homomorphic encryption algorithm also supports the following operations: First, the addition of plaintext and ciphertext, Enc(a)+ b = Enc(a+b); Second, the multiplication of plaintext and ciphertext, Enc(a)*b = Enc(a*b). It should be noted that Enc(a)+ b does not represent the direct addition of plaintext and ciphertext, but represents a method of operation that is equivalent to Enc(a+b). Enc(a)*b does not represent the direct multiplication of plaintext and ciphertext, but an algebraic operation method that is equivalent to Enc(a*b).
[0084] Based on the above principles of homomorphic encryption, this specification provides a joint prediction method, which involves a first participant and a second participant, and the two participants jointly perform a joint prediction. This method is applied to a privacy computing scenario, in which the first participant and the second participant performing the joint prediction respectively have different feature data in the same field. Specifically, the data possessed by the two participants may be different feature data of the same business object. The two participants can respectively use their own business data to implement joint prediction through the following method to obtain the predicted value of a certain characteristic of the business object. For example, the first participant can maintain the number of car insurance accidents of the business object last year, and the second participant can maintain the driving age of the business object. The two participants can use their own data to predict whether it is safe for the business object to drive the vehicle and obtain the predicted value of the user's safety level.
[0085] In this scenario, in addition to maintaining different feature data, the first and second parties also each maintain some node information of the tree model. That is, the tree model structure maintained by the two parties is the same, but each party only has the judgment conditions of the non-leaf nodes related to the feature data maintained by itself, and the judgment conditions of other non-leaf nodes are unknown information to itself. The predicted values of the leaf nodes of the tree model are distributed to the two parties in the form of secret shared shards. The distribution of the tree model is combined with Figure 2 Same as the description.
[0086] After describing the application scenario of the method, a joint prediction method shown in this specification will be described next. Figure 3 As shown, Figure 3 It is a flowchart of a joint prediction method shown in this specification according to an exemplary embodiment.
[0087] In this flowchart, it is assumed that the first party is the party that initiates the prediction request and hopes to obtain the prediction result. To this end, before performing the joint prediction, the first party can generate a public-private key pair used by the homomorphic encryption algorithm, including a first public key pk and a first private key sk. The first party can send the first public key pk to the second party for subsequent use in homomorphic operations. In the subsequent part of the specification, the encryption operations of the first party and the second party are performed using the above-mentioned first public key pk.
[0088] In addition, the first participant may send a prediction request to the second participant, including identification information of the target object to be predicted. In one implementation, the first participant may include multiple objects in one prediction request. In this case, each of the objects may be used as a target object to perform the following steps.
[0089] After completing the above preparations, the two parties can conduct joint forecasting. The joint forecasting process specifically includes the following steps.
[0090] Step 301: The first participant determines, based on the first characteristic portion of the target object held locally, a first leaf node list and a corresponding first prediction value list into which the target object may fall in the tree model.
[0091] Step 311: The second participant determines, based on the second characteristic portion of the target object held locally, a second leaf node list and a corresponding second prediction value list into which the target object may fall in the tree model.
[0092] The above steps 301 and 311 are steps in which the two participants perform local predictions respectively, that is, using the characteristic data of the target object stored locally to determine the node where the target object may fall in the tree model, so as to achieve local prediction.
[0093] The target object is a specific business object. The first participant holds the first characteristic part of the target object locally, and the second participant holds the second characteristic part of the target object locally. The first characteristic part and the second characteristic part are different. For example, the first participant can hold the target object's driving age, which is the first characteristic part, and the second participant can hold the number of car insurance claims of the target object last year locally, which is the second characteristic part.
[0094] In the above steps, the specific prediction method can refer to the description of the independent prediction process of Bob and Alice in the relevant technology, which will not be repeated here. The above method is to predict the leaf nodes that the target object may fall into based on the tree model of the local unknown non-leaf nodes. These leaf nodes that may fall into can form a leaf node list. The leaf nodes that may fall into include the leaf nodes that the target object actually falls into. For the first participant, the first participant uses the local first feature part to predict the target object. The list of leaf nodes that the target object may fall into in the tree model of the first participant is the first leaf node list; correspondingly, the list of leaf nodes that the target object may fall into in the tree model of the second participant is the second leaf node list.
[0095] In addition, each participant may also determine its own prediction value list. In an optional implementation, the prediction value list of the party indicates the predicted fragmentation value of the leaf nodes in the leaf node list of the party (hereinafter referred to as the predicted value of the party). Specifically, the first prediction value list includes the predicted values of the leaf nodes in the first leaf node list of the first participant. Correspondingly, the second prediction value list includes the predicted values of the leaf nodes in the second leaf node list of the second participant. For example, if the leaf nodes that the target object may fall into in the tree model of the first participant are nodes with node numbers 0 and 1, then the first prediction value list may include at least the predicted values of nodes 0 and 1 of the first participant (i.e., the predicted fragmentation values held by the first participant).
[0096] In addition, in another optional implementation, the first prediction value list may also include the predicted fragmentation values of all leaf nodes in the tree model of the first participant, and the second prediction value list may also include the predicted fragmentation values of all leaf nodes in the tree model of the second participant. This specification does not limit the specific content of the prediction value list.
[0097] In an optional implementation, the predicted value of the tree model may not be an integer, and the existing homomorphic encryption algorithm can generally only encrypt integers. Therefore, when the selected homomorphic encryption algorithm is an encryption algorithm that can only encrypt integers, and the predicted value of the tree model has a decimal value, the elements in the first prediction value list and the second prediction value list are integer values obtained by amplifying the predicted value of the leaf node (which can be a shard value) by a preset multiple. For example, the original prediction value of a leaf node is 0.05, and the integer value obtained after amplification by a preset multiple is 5. The first prediction value list can include 5 instead of 0.05. The magnification multiples of different leaf nodes can be the same, which can facilitate calculation.
[0098] Step 302: The first participant performs homomorphic encryption processing based on the first leaf node list and the first prediction value list to obtain a first ciphertext.
[0099] Step 303: The first participant sends the first ciphertext to the second participant.
[0100] Correspondingly, in step 313 (not shown in the figure), the second party receives the first ciphertext sent by the first party.
[0101] In order to ensure data privacy and security, when the first participant sends the data involved in the prediction value calculation to the second participant, the two data need to be encrypted first to obtain the first ciphertext. In this way, the second participant cannot obtain the intermediate values such as the first leaf node list and the first prediction value list through the received first ciphertext, thus ensuring data security.
[0102] The specific form of the first ciphertext may be: data obtained by encrypting the first leaf node list and the first prediction value list respectively, or data in other forms. The specific form of the first ciphertext will be described in detail below in conjunction with the specific implementation of step 314, and will not be described in detail here.
[0103] Step 314: The second participant uses the second leaf node list and the second prediction value list to perform a homomorphic operation on the first ciphertext to obtain a second ciphertext.
[0104] After receiving the first ciphertext, the second participant uses homomorphic operations to support the characteristic that the results of algebraic operations between ciphertexts are still encrypted data. Through homomorphic operations between the first ciphertext and the local prediction results, the encrypted result second ciphertext corresponding to the predicted value is obtained.
[0105] By using homomorphic operations, the first participant can only obtain the decryptable prediction value results. For the second participant, although the second participant can use the first ciphertext for calculation, since the first ciphertext is encrypted with the first public key pk of the first participant, it can only be decrypted with the first private key sk of the first participant. The second participant cannot obtain any intermediate results through decryption during the calculation process. It can be seen that in the above joint prediction process, neither the first participant nor the second participant can obtain the plaintext of any intermediate results, ensuring data privacy security.
[0106] Next, the implementation of step 314 will be described in combination with the specific forms of the leaf node list and the prediction value list.
[0107] In an optional embodiment, the specific forms of the first leaf node list and the second leaf node list may be the same as those described in the related art, that is, the leaf node list is represented by a predicted node vector. In other words, the first leaf node list and the second leaf node list are respectively represented as a first node vector and a second node vector in the form of a binary vector; the elements at any position in the binary vector are represented by two values to indicate whether the leaf node at the corresponding position is included or not, such as 0 to indicate that the leaf node at the corresponding position is not included, and 1 to indicate that the leaf node at the corresponding position is included. For specific examples, please refer to the description of the predicted node vector in the related art above, which will not be repeated here. For the convenience of explanation below, the first node vector is represented by A, the second node vector is represented by B, and the ciphertext of A is recorded as [A].
[0108] The first prediction value list and the second prediction value list can also be in the form of prediction value vectors. For example, each element in the prediction value vector corresponds to a leaf node one by one, and each element value is the prediction value of the corresponding leaf node (that is, the prediction fragment value). For example, Figure 2 In the example, in Alice's tree 1, the node vector is [1,1,0], and the corresponding prediction value vector can be [0.07,0.1, 0.1]. For the convenience of explanation below, the first prediction value list is represented by Sa, and the second prediction value list is represented by Sb. The ciphertext of Sa is recorded as [Sa].
[0109] In addition, it should be noted that, in the above case, encryption using the encryption algorithm can be: encrypting each element in the vector separately. For example, if the first node vector A is [1,1,0], encryption can be performed by encrypting 1, 1, and 0 separately to obtain the ciphertext [A].
[0110] In the above case, step 314 may be implemented in the following two specific ways, which do not limit the present specification.
[0111] In the first implementation, homomorphic encryption can be semi-homomorphic encryption or fully homomorphic encryption.
[0112] Among them, the semi-homomorphic encryption algorithm used above can be a homomorphic encryption algorithm such as Paillier or OU that supports homomorphic addition operations.
[0113] In this method, in step 302, the first ciphertext may be obtained by: performing homomorphic encryption on the first node vector A to obtain first encrypted data [A]; performing homomorphic encryption on the positional product (i.e., element-wise multiplication) A*Sa of the first node vector A and the first prediction value vector Sa to obtain second encrypted data [A*Sa]; and the first encrypted data and the second encrypted data are included in the first ciphertext.
[0114] For the second encrypted data A*Sa, the corresponding plaintext is actually a vector including the predicted fragmentation values of the leaf nodes that may fall into. In this vector, for the elements corresponding to the leaf nodes that may fall into the tree model, the value of the element is the predicted value of the corresponding leaf node, and for the elements corresponding to the leaf nodes that cannot fall into the tree model, the value of the element is a specific value, such as 0.
[0115] For example, assuming that the first node vector A is [1,1,0] and the first prediction value vector Sa is [0.07,0.1,0.1], then the element-wise multiplication of the two can obtain A*Sa [0.07,0.1,0]. Then A*Sa [0.07,0.1,0] is encrypted element-wise to obtain the second encrypted data [A*Sa], and the first node vector A[1,1,0] is encrypted to obtain the first encrypted data [A].
[0116] Correspondingly, in the above case, the implementation method of step 314 can be: perform an element-by-element plaintext-ciphertext product operation on the second node vector B, the second predicted value vector Sb and the first encrypted data [A] to obtain a first product ciphertext [A]*B*Sb; perform an element-by-element plaintext-ciphertext product operation on the second node vector B and the second encrypted data [A*Sa] to obtain a second product ciphertext [A*Sa]*B. In the above two steps, the plaintext-ciphertext product operation in the additive homomorphic operation is used. Next, a ciphertext addition operation is performed on the first product ciphertext [A]*B*Sb and the second product ciphertext [A*Sa]*B, and the second ciphertext is obtained according to the ciphertext addition result.
[0117] Specifically, the sum vector [PRED] of the first product ciphertext and the second product ciphertext can be calculated according to formula (1):
[0118] [PRED] = [A]*B*Sb + [A*Sa]*B (1)
[0119] In formula (1), the multiplication or addition is element-wise multiplication or addition, thereby obtaining the ciphertext sum result [PRED].
[0120] Then add all the elements in the ciphertext sum result [PRED] vector to obtain the second ciphertext. For example, the second ciphertext can be calculated using the following formula (2):
[0121] [SUM1] = reduce_sum([PRED]) (2)
[0122] That is, the ciphertext of each element in [PRED] is added together to obtain the second ciphertext, which is the encryption result corresponding to the predicted value.
[0123] The above method targets the additive homomorphic encryption algorithm (semi-homomorphic encryption). By encrypting [A] and [A*Sa], the second party is prevented from performing homomorphic multiplication operations. The operation can be completed using the more efficient semi-homomorphic encryption.
[0124] In addition, since fully homomorphic encryption can also support the above operations, the above encryption can also use a fully homomorphic encryption algorithm.
[0125] In the second implementation, homomorphic encryption may be fully homomorphic encryption.
[0126] In this method, in step 302, the first ciphertext may be obtained by performing homomorphic encryption on the first node vector A and the first prediction value vector Sa respectively to obtain first encrypted data [A] and second encrypted data [Sa], which are included in the first ciphertext.
[0127] The first encrypted data [A] here is the same as the first encrypted data [A] above, and the second encrypted data [Sa] is the homomorphic ciphertext obtained by directly encrypting the first prediction node vector Sa.
[0128] Correspondingly, the specific implementation method of step 314 is: perform an element-by-element plaintext-ciphertext product operation on the second node vector B and the first encrypted data [A] to obtain a first intermediate term [A]*B; perform an element-by-element plaintext-ciphertext addition operation on the second predicted value vector Sb and the second encrypted data [Sa] to obtain a second intermediate term Sb+[Sa]; perform a ciphertext multiplication operation on the first intermediate term and the second intermediate term, and obtain the second ciphertext according to the ciphertext multiplication result.
[0129] Specifically, the ciphertext multiplication operation of the first intermediate term and the second intermediate term can be calculated by formula (3):
[0130] [PRED] = [A]*B*(Sb+[Sa]) (3)
[0131] Wherein, [PRED] is a vector obtained by multiplying the ciphertext of the first intermediate term and the second intermediate term.
[0132] After obtaining the [PRED] vector, the [PRED] can be element-wise added using formula (2) to obtain the second ciphertext.
[0133] The above method is for one tree. When there are multiple trees, the above operation can be performed on the multiple trees respectively, and then the predicted value ciphertexts of the multiple trees are added together to obtain the second ciphertext.
[0134] Specifically, the tree model includes multiple subtrees; the first leaf node list and the second leaf node list each contain multiple subnode lists for the multiple subtrees; the first prediction value list and the second prediction value list each include multiple sub-prediction lists for the multiple subtrees. Correspondingly, step 314 includes: performing homomorphic operations on each subtree to obtain multiple sub-results corresponding to the multiple subtrees; performing homomorphic addition operations on the multiple sub-results to obtain the second ciphertext. That is, the second ciphertext is obtained by performing homomorphic addition operations on multiple sub-results corresponding to the multiple subtrees, and the multiple sub-results corresponding to the multiple subtrees are obtained by performing homomorphic operations on each subtree.
[0135] For example, for any subtree, the above method can be used to obtain a sub-result, and then multiple sub-results can be homomorphically added to obtain the second ciphertext.
[0136] Step 315: The second participant sends the second ciphertext to the first participant.
[0137] Correspondingly, in step 305 (not shown in the figure), the first participant receives the second ciphertext sent by the first participant;
[0138] Step 306: The first participant decrypts the second ciphertext to obtain a prediction result of the target object.
[0139] The second participant sends the second ciphertext to the first participant, which can decrypt the second ciphertext to obtain the prediction result of the target object. In this way, the joint prediction is completed.
[0140] The first private key sk of the first participant may be used for decryption. Specifically, the prediction result may be a prediction value of a certain characteristic of the target object, such as a prediction value of driving safety, etc.
[0141] In addition, in the case where the first prediction vector and the second prediction vector are magnified by a preset multiple, step 306 here can be: decrypting the second ciphertext, reducing the decrypted data by the preset multiple, and obtaining the prediction result of the target object. In this way, an accurate prediction result can be obtained.
[0142] The above is described in conjunction with an embodiment in which both the leaf node list and the prediction value list are represented as vectors. In other embodiments, the leaf node list and the prediction value list may also be recorded in other forms, such as an ordered array. The operation logic for vector elements in the above embodiments may also be equally applicable to array elements, which will not be repeated here.
[0143] The above method uses a homomorphic encryption algorithm to fully encrypt the intermediate results without information leakage, thus protecting the security of the tree model and feature data. In addition, compared with the methods in the related art, the above method has fewer communications and higher processing efficiency when there is a network delay.
[0144] Next, the above method will be explained through a specific example. The method involves two participants, Alice and Bob, where Alice can be understood as the first participant and Bob as the second participant. The multiple tree models maintained by Alice and Bob include multiple subtrees, where the model of tree 1 is as follows: Figure 2 Next, we will take tree 1 as an example to illustrate the joint prediction method. The processing methods of other subtrees are the same as those of tree 1 and will not be repeated here.
[0145] like Figure 2 As shown, the first prediction value vector Sa of Alice's tree 1 is [0.07, 0.1, 0.1], and the second prediction value vector Sb of Bob's tree 1 is [0.03, 0.1, 0.4]. The encryption algorithm used is the additive homomorphic encryption algorithm.
[0146] In the above case, joint prediction is achieved through the following steps.
[0147] First, since PHE can only encrypt integers, the first prediction value vector and the second prediction value vector are magnified 100 times to get integers, then the first prediction value vector becomes: [7, 10, 10], and the second prediction value vector becomes [3, 10, 40].
[0148] Second, when Alice needs to obtain the prediction results, Alice generates the public key and private key of PHE and sends the public key to Bob.
[0149] Third, Alice and Bob make local predictions and obtain the first node vector A and the second node vector B respectively.
[0150] When the feature 1 data of the target object owned by Alice is 2 and the feature 2 data of the target object owned by Bob is 20, A is [1,1,0] and B is [0, 1, 1].
[0151] Fourth, Alice uses PHE to encrypt A and A*Sa to obtain [A] and [A*Sa]. The encryption method is element-by-element encryption. For example, [A] means that each element in A is encrypted with PHE to obtain a vector, and each element of the vector is a ciphertext. [A*Sa] means that each element in A is multiplied by the corresponding leaf node prediction value, and the product is encrypted with PHE.
[0152] Fifth, Alice sends [A] and [A*Sa] to Bob, who calculates:
[0153] (1)[PRED] = [A]*B*Sb + [A*Sa]*B, using element-wise multiplication and addition to obtain the [PRED] vector.
[0154] (2) [SUM1] = reduce_sum([PRED]), add each element in [PRED] together to get the encrypted integer, [SUM1] is the ciphertext of the predicted value of tree 1.
[0155] (3) The same method can be used to predict the ciphertext of the predicted values of other sub-scores, and finally all the scores are added together to obtain the overall prediction value of the model [SUM].
[0156] Sixth, Bob sends [SUM] to Alice, who decrypts it and gets the result. Since the predicted value is magnified by a preset multiple, sum / 100 is the final result.
[0157] Corresponding to the embodiments of the aforementioned method, this specification also provides embodiments of an apparatus and a computer device to which it is applied.
[0158] like Figure 4 As shown, Figure 4 This is a block diagram of a joint prediction device according to an exemplary embodiment of the present specification, the device involves a first participant and a second participant, the first participant and the second participant each maintain partial node information of a tree model; the device is applied to the second participant, including:
[0159] A determination module 410, configured to determine, based on a second characteristic portion of the target object held locally, a second leaf node list and a corresponding second prediction value list into which the target object may fall in the tree model;
[0160] A receiving module 420 is used to receive a first ciphertext sent by the first participant, where the first ciphertext is obtained by homomorphic encryption based on a first leaf node list and a first prediction value list; the first leaf node list and the first prediction value list are determined by the first participant according to a first feature portion of a target object held by the first participant;
[0161] A calculation module 430, configured to perform a homomorphic operation on the first ciphertext by using the second leaf node list and the second prediction value list to obtain a second ciphertext;
[0162] The sending module 440 is used to send the second ciphertext to the first participant so that the first participant can decrypt it to obtain the prediction result of the target object.
[0163] In an optional embodiment, the first leaf node list and the second leaf node list are respectively represented as a first node vector and a second node vector in the form of a binary vector; an element at any position in the binary vector is represented by two values to indicate whether the leaf node at the corresponding position is included or not; the first prediction value list and the second prediction value list are respectively represented as a first prediction value vector and a second prediction value vector.
[0164] In an optional implementation, the first ciphertext includes first encrypted data and second encrypted data, the first encrypted data is the homomorphic ciphertext corresponding to the first node vector, and the second encrypted data is the homomorphic ciphertext corresponding to the product of the first node vector and the first prediction value vector.
[0165] In an optional implementation, the homomorphic encryption is semi-homomorphic encryption; the computing module 430 is specifically used to: perform an element-by-element plaintext-ciphertext product operation on the second node vector, the second predicted value vector and the first encrypted data to obtain a first product ciphertext; perform an element-by-element plaintext-ciphertext product operation on the second node vector and the second encrypted data to obtain a second product ciphertext; and obtain the second ciphertext based on a ciphertext addition operation of the first product ciphertext and the second product ciphertext.
[0166] In an optional implementation, the first ciphertext includes first encrypted data and second encrypted data, the first encrypted data is the homomorphic ciphertext corresponding to the first node vector, and the second encrypted data is the homomorphic ciphertext corresponding to the first prediction value vector.
[0167] In an optional implementation, the homomorphic encryption is fully homomorphic encryption; the computing module 430 is specifically used to: perform an element-by-element plaintext-ciphertext product operation on the second node vector and the first encrypted data to obtain a first intermediate term; perform an element-by-element plaintext-ciphertext addition operation on the second predicted value vector and the second encrypted data to obtain a second intermediate term; and obtain the second ciphertext based on a ciphertext multiplication operation of the first intermediate term and the second intermediate term.
[0168] In an optional implementation, the elements in the first prediction value list and the second prediction value list are integer values obtained by amplifying the prediction value of the leaf node by a preset multiple.
[0169] In an optional implementation, the receiving module 420 is further configured to: receive a prediction request for the target object sent by the first party.
[0170] In an optional embodiment, the tree model includes multiple subtrees; the first leaf node list and the second leaf node list each contain multiple subnode lists for the multiple subtrees; the first prediction value list and the second prediction value list each include multiple sub-prediction lists for the multiple subtrees; the calculation module 430 is specifically used to: perform homomorphic operations on each subtree respectively to obtain multiple sub-results corresponding to the multiple subtrees; perform homomorphic addition operations on the multiple sub-results to obtain the second ciphertext.
[0171] like Figure 5 As shown, Figure 5 This is a block diagram of another joint prediction device according to an exemplary embodiment of the present specification, the device involves a first participant and a second participant, the first participant and the second participant each maintain partial node information of a tree model, and the device is applied to the first participant, including:
[0172] A determination module 510, configured to determine, based on the first characteristic portion of the target object held locally, a first leaf node list and a corresponding first prediction value list into which the target object may fall in the tree model;
[0173] An encryption module 520, configured to perform homomorphic encryption processing based on the first leaf node list and the first prediction value list to obtain a first ciphertext;
[0174] A sending module 530, configured to send the first ciphertext to the second participation method;
[0175] The receiving module 540 is used to receive a second ciphertext sent by the second participant; the second ciphertext is obtained by performing a homomorphic operation on the first ciphertext using a second leaf node list and a second prediction value list, and the second leaf node list and the second prediction value list are determined by the second participant according to a second feature portion of the target object held by the second participant;
[0176] The decryption module 550 is used to decrypt the second ciphertext to obtain the prediction result of the target object.
[0177] In an optional embodiment, the first leaf node list and the second leaf node list are respectively represented as a first node vector and a second node vector in the form of a binary vector; an element at any position in the binary vector is represented by two values to indicate whether the leaf node at the corresponding position is included or not; the first prediction value list and the second prediction value list are respectively represented as a first prediction value vector and a second prediction value vector.
[0178] In an optional implementation, the encryption module 520 is specifically used to: perform homomorphic encryption on the first node vector to obtain first encrypted data; perform homomorphic encryption on the product of the first node vector and the first prediction value vector to obtain second encrypted data; and the first encrypted data and the second encrypted data are included in the first ciphertext.
[0179] In an optional embodiment, the homomorphic encryption is semi-homomorphic encryption, and the second ciphertext is obtained by adding the ciphertexts of the first product ciphertext and the second product ciphertext, the first product ciphertext is obtained by the element-by-element plaintext-ciphertext product of the second node vector, the second prediction value vector and the first encrypted data, and the second product ciphertext is obtained by the element-by-element plaintext-ciphertext product of the second node vector and the second encrypted data.
[0180] In an optional implementation, the encryption module 520 is specifically used to: perform homomorphic encryption on the first node vector and the first prediction value vector respectively to obtain first encrypted data and second encrypted data, which are included in the first ciphertext.
[0181] In an optional embodiment, the homomorphic encryption is fully homomorphic encryption, the second ciphertext is obtained by multiplying the ciphertext of the first intermediate term and the second intermediate term, the first intermediate term is obtained by the element-by-element plaintext-ciphertext product operation of the second node vector and the first encrypted data, and the second intermediate term is obtained by the element-by-element plaintext-ciphertext addition operation of the second prediction value vector and the second encrypted data.
[0182] In an optional embodiment, the elements in the first prediction value list and the second prediction value list are integer values obtained by amplifying the prediction value of the leaf node by a preset multiple; the decryption module 550 is specifically used to: decrypt the second ciphertext, reduce the decrypted data by the preset multiple, and obtain the prediction result of the target object.
[0183] In an optional implementation, the sending module 530 is further configured to send a prediction request for the target object to the second party.
[0184] In an optional embodiment, the tree model includes multiple subtrees; the first leaf node list and the second leaf node list each contain multiple subnode lists for the multiple subtrees; the first prediction value list and the second prediction value list each include multiple sub-prediction lists for the multiple subtrees; the second ciphertext is obtained by performing homomorphic addition operations on multiple sub-results corresponding to the multiple subtrees, and the multiple sub-results corresponding to the multiple subtrees are obtained by performing homomorphic operations on each subtree respectively.
[0185] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0186] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0187] like Figure 6 As shown, Figure 6 A hardware structure diagram of a computer device in which the joint prediction device of the embodiment is located is shown, and the device may include: a processor 1010 and a memory 1020 for storing processor executable instructions. In addition, the computer device may also include an input / output interface 1030, a communication interface 1040 and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030 and the communication interface 1040 are connected to each other in communication within the device through the bus 1050.
[0188] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification. The processor can implement the above-mentioned joint prediction method by running executable instructions.
[0189] The memory 1020 for storing processor executable instructions can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020.
[0190] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0191] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0192] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).
[0193] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0194] The embodiments of the present specification also provide a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned joint prediction method is implemented.
[0195] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0196] The present specification also provides a computer program product, including a computer program or instructions, and when the computer program or instructions are executed by a processor, the above-mentioned joint prediction method is implemented.
[0197] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0198] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0199] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
Claims
1. A joint prediction method, involving a first participant and a second participant, wherein the first participant and the second participant each maintain partial node information of a tree model; The method is applied to a second party, comprising: Determine, according to the second characteristic part of the target object held locally, a second node vector and a corresponding second prediction value vector into which the target object may fall in the tree model; Receive a first ciphertext sent by the first participant, the first ciphertext includes first encrypted data and second encrypted data, the first encrypted data is a homomorphic ciphertext corresponding to a first node vector, and the second encrypted data is a homomorphic ciphertext corresponding to a positional product of the first node vector and a first prediction value vector; the first node vector and the first prediction value vector are determined by the first participant according to a first feature portion of a target object held by the first participant; the first node vector and the second node vector are represented in a binary vector form; an element at any position in the binary vector is represented by two values to indicate whether or not a leaf node at the corresponding position is included; Using the second node vector and the second predicted value vector, a homomorphic operation is performed on the first ciphertext to obtain a second ciphertext; Sending the second ciphertext to the first participant so that the first participant decrypts the ciphertext to obtain a prediction result of the target object; The homomorphic ciphertext is a ciphertext obtained by semi-homomorphic encryption; the method of using the second leaf node vector and the second prediction value vector to perform a homomorphic operation on the first ciphertext to obtain the second ciphertext includes: Performing an element-by-element plaintext-ciphertext product operation on the second node vector, the second predicted value vector, and the first encrypted data to obtain a first product ciphertext; Performing an element-by-element plaintext-ciphertext product operation on the second node vector and the second encrypted data to obtain a second product ciphertext; A ciphertext addition operation is performed on the first product ciphertext and the second product ciphertext, and the second ciphertext is obtained according to the ciphertext addition result.
2. The method according to claim 1, wherein: The elements in the first prediction value vector and the second prediction value vector are integer values obtained by amplifying the prediction value of the leaf node by a preset multiple.
3. The method according to claim 1, before determining the second node vector and the corresponding first prediction value vector into which the target object may fall in the tree model according to the second feature part of the target object held locally, further comprises: A prediction request for the target object is received from the first participant.
4. The method according to claim 1, wherein: The tree model includes a plurality of subtrees; The first node vector and the second node vector each include a plurality of child node vectors for the plurality of subtrees; the first prediction value vector and the second prediction value vector each include a plurality of child prediction vectors for the plurality of subtrees; The step of performing a homomorphic operation on the first ciphertext by using the second node vector and the second prediction value vector to obtain the second ciphertext includes: Perform homomorphic operations on each subtree to obtain multiple sub-results corresponding to multiple subtrees; Perform a homomorphic addition operation on the multiple sub-results to obtain the second ciphertext.
5. A joint prediction method, involving a first participant and a second participant, wherein the first participant and the second participant each maintain partial node information of a tree model, and the method is applied to the first participant, comprising: Determine, according to the first feature part of the target object held locally, a first node vector and a corresponding first prediction value vector into which the target object may fall in the tree model; Performing semi-homomorphic encryption on the first node vector to obtain first encrypted data; performing semi-homomorphic encryption on the bitwise product of the first node vector and the first prediction value vector to obtain second encrypted data; the first encrypted data and the second encrypted data are included in a first ciphertext; sending the first ciphertext to the second party; receiving a second ciphertext sent by the second participant; The second ciphertext is obtained by performing a ciphertext addition operation on the first product ciphertext and the second product ciphertext; The first product ciphertext is obtained by performing an element-by-element plaintext-ciphertext product operation on the second node vector, the second predicted value vector, and the first encrypted data; The second product ciphertext is obtained by performing an element-by-element plaintext-ciphertext product operation on the second node vector and the second encrypted data; The second node vector and the second predicted value vector are determined by the second participant according to the second feature part of the target object held by the second participant; the first node vector and the second node vector are expressed in the form of binary vectors; an element at any position in the binary vector is represented by two values to indicate whether or not a leaf node at the corresponding position is included; The second ciphertext is decrypted to obtain a prediction result of the target object.
6. The method according to claim 5, wherein: The elements in the first prediction value vector and the second prediction value vector are integer values obtained by amplifying the prediction value of the leaf node by a preset multiple; The decrypting the second ciphertext to obtain the prediction result of the target object includes: The second ciphertext is decrypted, and the decrypted data is reduced by the preset multiple to obtain a prediction result of the target object.
7. The method according to claim 5, before determining the first node vector and the corresponding first prediction value vector into which the target object may fall in the tree model according to the first feature part of the target object held locally, further comprising: A prediction request for the target object is sent to the second participant.
8. The method according to claim 5, wherein: The tree model includes a plurality of subtrees; The first node vector and the second node vector each include multiple child node vectors for the multiple subtrees; the first prediction value vector and the second prediction value vector each include multiple child prediction vectors for the multiple subtrees; the second ciphertext is obtained by performing homomorphic addition operations on multiple child results corresponding to the multiple subtrees, and the multiple child results corresponding to the multiple subtrees are obtained by performing homomorphic operations on each subtree respectively.
9. A joint prediction device, the joint prediction involving a first participant and a second participant, the first participant and the second participant each maintaining partial node information of a tree model; The device is applied to a second participant, and includes: A determination module, configured to determine, based on a second characteristic portion of the target object held locally, a second node vector and a corresponding second prediction value vector into which the target object may fall in the tree model; A receiving module, used to receive a first ciphertext sent by the first participant, the first ciphertext including first encrypted data and second encrypted data, the first encrypted data being a homomorphic ciphertext corresponding to a first node vector, and the second encrypted data being a homomorphic ciphertext corresponding to a positional product of the first node vector and a first prediction value vector; the first node vector and the first prediction value vector are determined by the first participant according to a first feature portion of a target object held by the first participant; the first node vector and the second node vector are represented in a binary vector form; an element at any position in the binary vector is represented by two values to indicate whether or not a leaf node at the corresponding position is included; a calculation module, configured to perform an element-by-element plaintext-ciphertext product operation on the second node vector, the second predicted value vector, and the first encrypted data to obtain a first product ciphertext; perform an element-by-element plaintext-ciphertext product operation on the second node vector and the second encrypted data to obtain a second product ciphertext; perform a ciphertext addition operation on the first product ciphertext and the second product ciphertext, and obtain a second ciphertext according to the ciphertext addition result; The sending module is used to send the second ciphertext to the first participant so that the first participant can decrypt the second ciphertext to obtain the prediction result of the target object.
10. A joint prediction device, the joint prediction involving a first participant and a second participant, the first participant and the second participant each maintaining partial node information of a tree model, the device applied to the first participant, comprising: A determination module, configured to determine, based on a first feature portion of a target object held locally, a first node vector and a corresponding first prediction value vector into which the target object may fall in the tree model; an encryption module, configured to perform semi-homomorphic encryption on the first node vector to obtain first encrypted data; perform homomorphic encryption on the bitwise product of the first node vector and the first prediction value vector to obtain second encrypted data; and the first encrypted data and the second encrypted data are classified into a first ciphertext; A sending module, used for sending the first ciphertext to the second participation method; A receiving module, used for receiving a second ciphertext sent by the second participant; The second ciphertext is obtained by performing a ciphertext addition operation on the first product ciphertext and the second product ciphertext; The first product ciphertext is obtained by performing an element-by-element plaintext-ciphertext product operation on the second node vector, the second predicted value vector, and the first encrypted data; The second product ciphertext is obtained by performing an element-by-element plaintext-ciphertext product operation on the second node vector and the second encrypted data; The second node vector and the second predicted value vector are determined by the second participant according to the second feature part of the target object held by the second participant; the first node vector and the second node vector are expressed in the form of binary vectors; an element at any position in the binary vector is represented by two values to indicate whether or not a leaf node at the corresponding position is included; A decryption module is used to decrypt the second ciphertext to obtain a prediction result of the target object.
11. A computer device comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 8 by running the executable instructions.
12. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the method according to any one of claims 1 to 8.
13. A computer program product, comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Method and device for evaluating federal learning model
CN116541870A