Joint prediction method, computer equipment and program product
By using homomorphic encryption and homomorphic computing methods in privacy computing scenarios, the first participant and the second participant perform homomorphic encryption processing and exchange ciphertexts respectively, solving the security and efficiency problems of joint prediction of multiple parties in privacy computing, and achieving efficient and secure prediction results acquisition.
Patent Information
- Application Number
- CN202510052234.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2025-07-18
AI Technical Summary
In the privacy computing scenario, it is difficult for the existing technology to efficiently realize multi-party joint prediction while ensuring data security, and there are problems of intermediate information leakage and low communication efficiency.
Through the first and second participants each maintain some node information of the tree model, and use homomorphic encryption and homomorphic operations to determine the leaf node list and predicted value list that the target object may fall into the tree model. The homomorphic encryption process is performed and the ciphertext is exchanged, and the final decryption is used to obtain the prediction result.
It realizes efficient joint prediction without intermediate information leakage, reduces the number of communications, and improves prediction efficiency in scenarios with high network delay or long distances.
Smart Images

Figure CN120342649A_ABST
Abstract
Description
[0001] This application is a divisional application; the parent application number is 202411033477X, the application date is July 30, 2024, and the invention-creation name of the parent application is a method, device, storage medium, equipment and program product for joint prediction. Technical Field
[0002] One or more embodiments of this specification relate to the field of privacy computing technology, and in particular, to a method, computer device, and program product for joint prediction. Background Art
[0003] A tree model, also known as a decision tree model, is a binary tree model trained by machine learning methods. The non-leaf nodes of the tree model store judgment conditions, such as the feature number and feature threshold, and the leaf nodes store prediction values. Through the tree model, the characteristics of a business object can be predicted based on the feature data of the business object.
[0004] In the privacy computing scenario, the tree model is generally obtained through multi-party federated training. Each party only has partial feature data of the business object and only maintains partial node information of the tree model. That is, in the tree model of each party, the non-leaf nodes corresponding to the feature data not owned by that party are unknown. Multiple parties can jointly use the tree model to jointly predict the characteristics of the business object through the feature data of the business object they each own.
[0005] It is hoped that there can be an improved solution that can more efficiently use the tree model to achieve multi-party joint prediction while ensuring data security. Summary of the Invention
[0006] In view of this, one or more embodiments of this specification provide a method, computer device, and program product for joint prediction, which can more efficiently achieve joint prediction based on the tree model while ensuring data security.
[0007] According to the first aspect of one or more embodiments of this specification, a method for joint prediction is proposed, which involves a first participant and a second participant, and the first participant and the second participant each maintain partial node information of the tree model; the method is applied to the second participant and includes:
[0008] Determine a second leaf node list and a corresponding second prediction value list in which the target object may fall in the tree model according to the second part of the features of the target object held locally;
[0009] Receive the first ciphertext sent by the first participant, where the first ciphertext is obtained by performing homomorphic encryption based on the first leaf node list and the first prediction value list; the first leaf node list and the first prediction value list are determined by the first participant according to the first feature part of the target object it holds;
[0010] Perform homomorphic operations on the first ciphertext using the second leaf node list and the second prediction value list to obtain a second ciphertext;
[0011] Send the second ciphertext to the first participant so that it can decrypt to obtain the prediction result of the target object.
[0012] According to the second aspect of one or more embodiments of this specification, another method for joint prediction is proposed, which involves a first participant and a second participant, and the first participant and the second participant each maintain partial node information of the tree model. The method is applied to the first participant and includes:
[0013] According to the first feature part of the target object held locally, determine the first leaf node list where the target object may fall in the tree model and the corresponding first prediction value list;
[0014] Based on the first leaf node list and the first prediction value list, perform homomorphic encryption processing to obtain a first ciphertext;
[0015] Send the first ciphertext to the second participant;
[0016] Receive the second ciphertext sent by the second participant; the second ciphertext is obtained by performing homomorphic operations on the first ciphertext using the second leaf node list and the second prediction value list, and the second leaf node list and the second prediction value list are determined by the second participant according to the second feature part of the target object it holds;
[0017] Decrypt the second ciphertext to obtain the prediction result of the target object.
[0018] According to the third aspect of the embodiments of this specification, a device for joint prediction is provided. The joint prediction involves a first participant and a second participant, and the first participant and the second participant each maintain partial node information of the tree model; the device is applied to the second participant and includes:
[0019] A determination module, configured to determine a second leaf node list where the target object may fall in the tree model and the corresponding second prediction value list according to the second feature part of the target object held locally;
[0020] A receiving module, configured to receive a first ciphertext sent by the first participant, where the first ciphertext is obtained by performing 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 part of a target object held by the first participant;
[0021] A computing module, configured to perform a homomorphic operation on the first ciphertext by using a second leaf node list and a second prediction value list to obtain a second ciphertext;
[0022] A sending module, configured to send the second ciphertext to the first participant so that the first participant decrypts it to obtain a prediction result of the target object.
[0023] According to a fourth aspect of the embodiments of this specification, another device for joint prediction is provided. The joint prediction 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 first participant and includes:
[0024] A determining module, configured to determine a first leaf node list in which the target object may fall in the tree model and a corresponding first prediction value list according to a first feature part of the target object held locally;
[0025] An encryption module, configured to perform homomorphic encryption processing based on the first leaf node list and the first prediction value list to obtain a first ciphertext;
[0026] A sending module, configured to send the first ciphertext to the second participant;
[0027] 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 by 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 part of the target object held by the second participant;
[0028] A decryption module, configured to decrypt the second ciphertext to obtain a prediction result of the target object.
[0029] 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 described in the first aspect or the second aspect of the embodiments of this specification is implemented.
[0030] According to a sixth aspect of the embodiments of the present specification, a computer device is provided. The computer device includes: a processor; a memory for storing processor-executable instructions; the processor runs the executable instructions to implement the joint prediction method described in the first aspect or the second aspect of the embodiments of the present specification.
[0031] According to a seventh aspect of the embodiments of the present specification, a computer program product is provided, including a computer program or instruction, which, when executed by a processor, implements the joint prediction method described in the first aspect or the second aspect of the embodiments of the present specification.
[0032] In one or more embodiments of the present specification, a joint prediction method, apparatus, storage medium, device, and program product are provided, which involve two parties, a first party and a second party, and each of the two parties maintains information of different partial nodes of the same tree model. The two parties respectively determine a list of possible nodes and a list of predicted values that may be fallen into according to the characteristics of the target object held locally. The first party encrypts the obtained first leaf node list and first predicted value list to obtain a first ciphertext, and sends the first ciphertext to the second party. The second party performs a homomorphic operation on the first ciphertext by using the second leaf node list and the second predicted value list obtained by local prediction to obtain a second ciphertext, and sends the second ciphertext to the first party. The first party decrypts the second ciphertext to obtain the prediction result of the target object.
[0033] In the above method, the intermediate results sent by the first party and the second party are ciphertexts after homomorphic encryption processing, and the characteristics of homomorphic operations are utilized in the above method. Through the homomorphic operation between the plaintext and the ciphertext, the final predicted value is calculated. It can be seen that no intermediate information is leaked during the above calculation process. The first party can only know the final prediction result, and it is even more impossible to know the leaf nodes finally reached by each tree. Although the second party can receive the first ciphertext, the second party cannot decrypt the first ciphertext and the second ciphertext to obtain the plaintext, nor can it obtain any intermediate information.
[0034] In addition, the communication efficiency of the above method is more efficient. Specifically, during the above communication process, only the first party needs to send the first ciphertext to the second party, and the second party sends the second ciphertext to the first party for such a round-trip network. In the scenario where the first party and the second party are far apart or the network latency is high, compared with the first and third methods in the related art, the first party can obtain the predicted value more quickly.
[0035] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present specification. Description of the Drawings
[0036] The accompanying drawings here are incorporated into the specification and form a part of the specification, showing embodiments consistent with the specification, and are used together with the specification to explain the principles of the specification.
[0037] Figure 1 is a schematic diagram of a tree model shown in this specification;
[0038] Figure 2 is a schematic diagram of a tree model in a joint prediction scenario shown in this specification;
[0039] Figure 3 is a flowchart of a joint prediction method shown in this specification according to an exemplary embodiment;
[0040] Figure 4 is a block diagram of a joint prediction device shown in this specification according to an exemplary embodiment;
[0041] Figure 5 is a block diagram of another joint prediction device shown in this specification according to an exemplary embodiment;
[0042] Figure 6 is a hardware structure diagram of a computer device shown in this specification according to an exemplary embodiment. Detailed implementation manners
[0043] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with one or more embodiments of this specification. On the contrary, 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.
[0044] It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily executed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or fewer 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 also be combined into a single step for description in other embodiments.
[0045] The tree model is a model for decision-making trained through machine learning methods, also known as a decision tree. Generally, a decision tree model consists of multiple binary trees. The non-leaf nodes of each tree store judgment conditions, which include a feature number and a feature threshold. The feature number is the data representing the type of the 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.
[0046] Specifically, in the process of prediction through the tree model, first, the feature data of the business object are respectively input into multiple trees. In each tree, for any non-leaf node N that the business object falls into, the feature data are compared with the feature threshold. If the corresponding feature data is less than the feature threshold, then the business object is further divided into the left sub-node N-L of the node N and continues to be judged according to the judgment condition of this sub-node N-L; if the corresponding feature data is greater than or equal to the feature threshold, then the business object is divided into the right sub-node N-R of the node N and judged according to the judgment condition of this sub-node N-R; until a leaf node is reached. The predicted value of the reached leaf node is the predicted value of the business object under this tree. In this way, the predicted values of the business object under multiple trees can be obtained, and finally, the predicted values of multiple trees are added together to obtain the predicted value of the business object.
[0047] For example, as Figure 1 shown, the tree model includes Tree 1 and Tree 2. Through Tree 1 and Tree 2, the vehicle driving safety score of the business object can be judged. Feature 1 represents the driving age of the business object, and Feature 2 represents the number of times of traffic knowledge learning of the business object in the previous year.
[0048] Suppose the feature data input into the tree model are: the value of Feature 1 is 2, and the value of the feature is 20.
[0049] First, for Tree 1: Input the feature data into Tree 1. At the first non-leaf node (root node) of Tree 1, judge that the value 2 of Feature 1 is less than the feature threshold 3 of this non-leaf node. Then the business object is divided into the left non-leaf node. The judgment condition of this non-leaf node is Feature 2 and the feature threshold 10. Since the value of Feature 2 of the business object is 20, which is greater than the feature threshold 10, the business object falls into the right leaf node. It can be seen from this that the predicted value obtained by the business object in Tree 1 is 0.2.
[0050] Secondly, for Tree 2, similar to the processing method after inputting into Tree 1 above, the predicted value that the business object can obtain in Tree 2 is 0.2. Finally, add the predicted value 0.2 of Tree 1 and the predicted value 0.2 of Tree 2 to obtain the predicted value of the business object as 0.4, that is, the driving safety score of the business object is 0.4.
[0051] Recently, due to the need for data privacy protection, it has been 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 a single-party scenario, the use of tree models for joint prediction in privacy computing scenarios has the following characteristics:
[0052] First of all, privacy computing generally involves multiple participants. Different types of features belong to different participants. For example, participant P1 has the driving age data of business objects, and participant P2 has the data of the number of traffic knowledge learning times of business objects in the previous year.
[0053] Secondly, the tree model is also trained by multiple participants using the method of federated learning. Although each participant has the tree model, they only have "partial" models. Specifically, the model structures owned by each participant are the same, but the content in the nodes may be different. For non-leaf nodes, each participant only maintains the non-leaf nodes related to the feature data it owns, and the judgment conditions of other non-leaf nodes are unknown to the participant. For leaf nodes, the predicted value of each leaf node is split into shards through the method of 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.
[0054] Among them, secret sharing is a technology that splits secret information into multiple shares and distributes them to different participants. Each participant cannot infer the size of the secret information itself from the obtained shares. The reason for splitting the predicted value into the tree models of multiple participants through the method of secret sharing is that the tree model is trained with the feature data of multiple participants. If a certain participant knows the predicted value of the trained leaf node, then it can reverse the data distribution of the feature data owned by other participants, which will cause privacy data leakage.
[0055] In addition, in privacy computing scenarios, multiple participants generally need to achieve joint prediction through privacy protocols. Next, a specific example will be used to illustrate the joint prediction method in privacy computing scenarios in related technologies.
[0056] Figure 1 In the example shown, assume that feature 1 belongs to Alice and feature 2 belongs to Bob. Then the tree 1 models owned by Alice and Bob are as Figure 2 shown. Since the principles of tree 1 and tree 2 are the same, the tree 2 model will not be described in detail here.
[0057] As Figure 2As shown, Alice only has Feature 1. Therefore, only the judgment conditions of the non-leaf nodes corresponding to Feature 1 are maintained in Alice's tree model, and the judgment conditions of the non-leaf nodes related to Feature 2 are unknown. Bob only has Feature 2. Therefore, only the judgment conditions of the non-leaf nodes corresponding to Feature 2 are maintained in Bob's tree model, and the judgment conditions of the remaining non-leaf nodes are unknown. For the leaf nodes, the shards of the corresponding leaf nodes of the two are added together to obtain Figure 1 the 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 this leaf node in [reference] is 0.1. According to the secret sharing method, 0.1 is split into two parties. The predicted value of this leaf node in Alice's tree model is 0.07, and the predicted value of this leaf node in Bob's tree model is 0.03. The sum of the predicted values of this leaf node of the two is 0.1.
[0058] In the joint prediction process, the two participants first independently predict each tree separately. In each tree, if the judgment condition of a non-leaf node is in a known state, that is, the participant has the feature data corresponding to this non-leaf node, then similar to the example shown in Figure 1 if the value of the feature data is less than the feature threshold of the non-leaf node, it is divided into the left node, and if the value of the feature data is greater than or equal to the feature threshold, it is divided into the right node. If the judgment condition of the non-leaf node is unknown, it is divided into both nodes at the same time, and finally a list of possible reached leaf nodes can be obtained. The leaf node list can be in the form of a binary vector, and whether it can reach the leaf node corresponding to the element can be characterized by the value of the element in the vector. For example, it can be that when it can reach the corresponding leaf node, the corresponding element takes 1, otherwise it takes 0.
[0059] Suppose 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, taking the example that Alice needs to obtain the predicted value of the business object, several joint prediction methods in the related technology will be described.
[0060] For ease of explanation, the concept of a predicted node vector is introduced here. The predicted node vector can correspond to the list of leaf nodes mentioned above. The predicted node vector is used to represent the reachable leaf nodes in a certain tree predicted by any participating party for the feature data of a certain business object. The predicted 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 each element 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 feature data of the business object for prediction, in Tree 1, if the node numbers of the leaf nodes that the target object can reach are 0 and 1, then for this business object, Alice's predicted node vector for Tree 1 is [1, 1, 0]. Here, it is represented by the value of the element in the vector being 1 that it can fall into the corresponding leaf node.
[0061] The first method of joint prediction:
[0062] First, Alice and Bob independently predict each tree. For example, for Tree 1, the data input by Alice is that the value of Feature 1 is 2. According to the above prediction rules and Figure 2 the Tree 1 shown in it, in Alice's Tree 1, the target object can reach the nodes with leaf node numbers 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].
[0063] Secondly, Bob sends the predicted node vector corresponding to each of his trees to Alice. Alice multiplies the predicted node vectors of herself and Bob element by element to obtain the leaf node reached by the target object. For example, for Tree 1, Alice multiplies the predicted node vectors [1, 1, 0] and [0, 1, 1] for Tree 1 element by element to get [0, 1, 0]. This means that the leaf node finally reached by the target object in Tree 1 is the leaf node with node number 1. It can be proved that there is exactly one element in the vector obtained by multiplying element by element that is 1.
[0064] Finally, Alice sends the node numbers of the leaf nodes finally reached by each tree to Bob. Bob adds up the predicted values of the nodes corresponding to the above node numbers for each tree and sends them back to Alice. For example, for Tree 1, the finally reached is the leaf node with node number 1. Suppose Bob maintains two trees, and the finally reached leaf node of Tree 2 is the leaf node with node number 0, and the predicted value of the leaf node with node number 0 in Tree 2 is 0.06. Then the predicted value 0.1 of the leaf node with node number 1 in Tree 1 can be added to the predicted value 0.06 of the leaf node with node number 0 in Tree 2 to get 0.16 and sent to Alice.
[0065] Alice then adds, on the basis of the predicted values sent by Bob that it receives, the predicted values of the nodes corresponding to the above node numbers in each tree maintained by Alice to obtain the final predicted value result. Continuing with the above example, assuming that the predicted value of the leaf node with node number 0 in tree 2 maintained by Alice is 0.14, then Alice can add, on the basis of the received 0.16, the predicted value 0.1 of the leaf node with node number 1 in tree 1 and the predicted value 0.14 corresponding to tree 2 to obtain the final predicted value of 0.4.
[0066] However, the above method has the following problems:
[0067] First of all, two network round-trips are required. In the case where the distance between Alice and Bob is far or the communication is blocked, more network communication resources will be consumed.
[0068] Secondly, the above method is not secure enough. Specifically, Alice can know the list of nodes that may be reached on Bob's side, and Bob can know the finally reached node number, leaking intermediate values other than the result. Furthermore, Alice may construct data to obtain the predicted result, and then infer the conditions of the non-leaf nodes and the predicted values of the leaf nodes of the tree model from the predicted result. Since the model is obtained by the two parties through federated training, if the values of the tree model are leaked, the distribution of the data used to train the tree model may be leaked, and there are security deficiencies.
[0069] The second method:
[0070] The second method is similar to the first method and is an improvement on the first method. In the first method, Bob sends the predicted node vectors of each of his trees to Alice. Different from this, in the second method, Alice sends the predicted node vectors of each of her trees to Bob. For example, in the above example, Alice can send the predicted node vector [1, 1, 0] of tree 1 to Bob. Bob multiplies it element-wise with the predicted node vector of his own tree 1, and then obtains the leaf node reached by the target object. For example, for tree 1, Bob multiplies the predicted node vectors [1, 1, 0] and [0, 1, 1] for tree 1 of the two to obtain [0, 1, 0], indicating that the leaf node finally reached by the target object in tree 1 is the leaf node with node number 1.
[0071] After Bob determines the leaf nodes that each tree finally reaches, he can add up the predicted values of his own side for the leaf nodes reached by each tree to obtain his own predicted value. Bob sends his predicted value and his predicted node vector to Alice. Alice also multiplies her predicted node vector element by element with the received predicted node vector of Bob to determine the leaf nodes that the target object can reach in each tree. Furthermore, she can add up the predicted values of the leaf nodes reached by each tree she maintains and the received predicted values of Bob to obtain the final predicted value.
[0072] Although the second method reduces one communication compared with the first method, it reveals more intermediate information. Alice and Bob both know each other's predicted node vectors and the finally reached leaf nodes, so there are security deficiencies.
[0073] The third method:
[0074] Alice and Bob respectively obtain their own predicted node vectors, and use the Private Set Intersection (PSI) technology to find the intersection of the two predicted node vectors to obtain the finally reached leaf nodes.
[0075] However, the above method still requires multiple rounds of interaction. And the above method is applicable to the scenario of one tree. If the tree model includes multiple trees, it is necessary to use PSI to find the intersection for each tree respectively to obtain the finally reached leaf nodes of each tree. Moreover, the finally reached leaf nodes of each tree still belong to intermediate values, and the above method still reveals intermediate information, so there are security deficiencies.
[0076] To solve the above problems, one or more embodiments of this specification provide a joint prediction method, which involves two participants, namely the first participant and the second participant. The two participants respectively maintain information on different partial nodes of the same tree model. The two participants respectively determine the list of possible nodes and the list of predicted values that may be fallen into according to the characteristics of the target object held locally. The first participant performs homomorphic encryption processing based on the obtained first leaf node list and the first predicted value list to obtain the first ciphertext, and sends the first ciphertext to the second participant. The second participant performs homomorphic operations on the first ciphertext using the locally predicted second leaf node list and the second predicted value list to obtain the second ciphertext, and sends the second ciphertext to the first participant.
[0077] The first participant decrypts the second ciphertext to obtain the prediction result of the target object.
[0078] In the above method, the intermediate results sent by the first participant and the second participant are both ciphertexts after homomorphic encryption. Moreover, the characteristics of homomorphic operations are utilized in the above method, and the final prediction value is calculated through homomorphic operations between plaintext and ciphertext. It can be seen that no intermediate information is leaked during the above calculation process. The first participant can only know the final prediction result and cannot know the leaf nodes reached by each tree in the end. 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 know any intermediate information.
[0079] In addition, the communication efficiency of the above method is higher. Specifically, during the above communication process, only one round of network round-trip is required, where the first participant sends the first ciphertext to the second participant, and the second participant sends the second ciphertext to the first participant. In scenarios where the first participant and the second participant are far apart or the network latency is high, compared with the first and third methods in the related art, the first participant can obtain the prediction value more quickly.
[0080] Next, the joint prediction method shown in this specification will be specifically described.
[0081] For the convenience of description, the homomorphic encryption algorithm will be described first here. Homomorphic encryption is a form of encryption that allows people to perform specific forms of algebraic operations on ciphertexts and still obtain encrypted results. The result obtained by decrypting it is the same as the result of performing the same operation on the plaintext. Homomorphic encryption enables algebraic calculations to be performed on encrypted data and correct results to be obtained, without the need to decrypt the data throughout the processing process.
[0082] Homomorphic encryption operations are generally divided into fully homomorphic encryption (FHE) and partially homomorphic encryption (PHE).
[0083] FHE supports homomorphic encryption operations of addition and multiplication on ciphertexts. For example, it can satisfy Enc(a) + Enc(b) = Enc(a + b) and Enc(a) * Enc(b) = Enc(a * b), where a and b are plaintexts, and Enc() represents the encryption operation on the content in the parentheses. It should also be noted that Enc(a) + Enc(b) represents the homomorphic addition operation of ciphertexts, which does not mean directly multiplying the two ciphertexts; due to the limitations of the encryption method, in some cases, the results of other algebraic operations on Enc(a) and Enc(b) are equivalent to Enc(a + b), and this algebraic operation equivalent to Enc(a + b) is called the homomorphic addition operation. The same is true for multiplication. Enc(a) * Enc(b) represents the homomorphic multiplication operation of ciphertexts, not directly multiplying the two ciphertexts. The specific implementation methods of the homomorphic addition operation and the homomorphic multiplication operation are determined according to the encryption method.
[0084] PHE refers to a homomorphic encryption algorithm that only supports one type of homomorphic encryption operation on ciphertexts. An encryption algorithm that only supports the additive homomorphic operation can be called an additive homomorphic encryption (Additive Homomorphic Encryption, AHE) algorithm. For example, Paillier and Okamoto-Uchiyama (OU) belong to the additive homomorphic encryption algorithm and satisfy Enc(a) + Enc(b) = Enc(a + b). Asymmetric encryption (Rivest-Shamir-Adleman, RSA), etc., which only support the multiplicative homomorphic operation, are multiplicative homomorphic encryption algorithms and satisfy Enc(a) * Enc(b) = Enc(a * b).
[0085] It should also be noted that in addition to the operations mentioned above, the additive homomorphic encryption algorithm also supports the following operations: First, adding a plaintext to a ciphertext, Enc(a) + b = Enc(a + b); Second, multiplying a plaintext by a ciphertext, Enc(a) * b = Enc(a * b). It should be noted that Enc(a) + b does not mean directly adding the plaintext and the ciphertext, but represents an operation method whose result is equivalent to Enc(a + b), and Enc(a) * b does not mean directly multiplying the plaintext and the ciphertext, but an algebraic operation method whose result is equivalent to Enc(a * b).
[0086] 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.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] On the basis of completing the above preparatory work, the two parties can conduct a joint prediction. The joint prediction process specifically includes the following steps.
[0092] Step 301, the first participating party determines a first leaf node list and a corresponding first prediction value list in which the target object may fall in the tree model according to the first feature part of the target object held locally.
[0093] Step 311, the second participating party determines a second leaf node list and a corresponding second prediction value list in which the target object may fall in the tree model according to the second feature part of the target object held locally.
[0094] The above Step 301 and Step 311 are steps for the two participating parties to conduct local predictions respectively, that is, to use the feature data of the target object stored locally to determine the nodes in the tree model where the target object may fall, so as to achieve local predictions.
[0095] The target object is a specific business object. The first participating party holds the first feature part of the target object locally, and the second participating party holds the second feature part of the target object locally. The first feature part and the second feature part are different. For example, the first participating party may hold the driving experience of the target object, that is, the first feature part, and the second participating party may hold locally the number of motor vehicle insurance claims of the target object last year, and the number of motor vehicle insurance claims is the second feature part.
[0096] In the above steps, for the specific prediction method, reference can be made to the description of the independent prediction processes of Bob and Alice in the related technology, which will not be elaborated here. The above method is to predict the leaf nodes where the target object may fall according to the tree model with unknown non-leaf nodes locally. These leaf nodes where the target object may fall can form a leaf node list. The leaf nodes where the target object may fall include the leaf node where the target object actually falls. For the first participating party, the first participating party uses the first feature part locally to predict the target object. The list of leaf nodes where the target object may fall in the tree model of the first participating party is the first leaf node list; correspondingly, the list of leaf nodes where the target object may fall in the tree model of the second participating party is the second leaf node list.
[0097] In addition, each participating party can also determine its own list of predicted values. In an alternative embodiment, the list of the party's predicted values represents the predicted shard values of the leaf nodes in the list of the party's leaf nodes (hereinafter simply referred to as the party's predicted values). Specifically, the first list of predicted values includes the predicted values of the leaf nodes in the first list of leaf nodes at the first participating party. Correspondingly, the second list of predicted values includes the predicted values of the leaf nodes in the second list of leaf nodes at the second participating party. For example, the leaf nodes in the tree model of the first participating party where the target object may fall are the nodes numbered 0 and 1. Then, the first list of predicted values can at least include the predicted values of nodes 0 and 1 at the first participating party (i.e., the predicted shard values held by the first participating party).
[0098] In addition, in another alternative embodiment, the first list of predicted values can also include the predicted shard values of all the leaf nodes in the tree model of the first participating party, and the second list of predicted values can also include the predicted shard values of all the leaf nodes in the tree model of the second participating party. This specification does not limit the specific content included in the list of predicted values.
[0099] In an alternative embodiment, the predicted value of the tree model may not be an integer, while the existing homomorphic encryption algorithms generally can 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 fractional value, the elements in the first list of predicted values and the second list of predicted values are integer values obtained by magnifying the predicted value (which can be a shard value) of the leaf node by a preset multiple. For example, if the original predicted value of a certain leaf node is 0.05, the integer value obtained after magnifying by the preset multiple is 5. The first list of predicted values can include 5 instead of 0.05. The magnification multiples of different leaf nodes can be the same, which is convenient for calculation.
[0100] Step 302, the first participating party performs homomorphic encryption processing based on the first list of leaf nodes and the first list of predicted values to obtain a first ciphertext.
[0101] Step 303, the first participating party sends the first ciphertext to the second participating party.
[0102] Correspondingly, in step 313 (not shown in the figure), the second participating party receives the first ciphertext sent by the first participating party.
[0103] To ensure data privacy and security, when the first participating party sends the data participating in the predicted value calculation to the second participating party, it needs to first encrypt the two data to obtain a first ciphertext. In this way, the second participating party cannot obtain intermediate values such as the first list of leaf nodes and the first list of predicted values through the received first ciphertext, ensuring data security.
[0104] For the specific form of the first ciphertext, it can 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 combination with the specific implementation manner of step 314, and will not be elaborated here for the time being.
[0105] 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.
[0106] After receiving the first ciphertext, the second participant makes use of the feature that homomorphic operations can support the result of algebraic operations between ciphertexts to still be encrypted data. Through the homomorphic operation between the first ciphertext and the local prediction result, the second ciphertext, which is the encrypted result corresponding to the prediction value, is obtained.
[0107] By using homomorphic operations, the first participant can finally only obtain the decryptable prediction value result. For the second participant, although the second participant can perform calculations using the first ciphertext, since the first ciphertext is encrypted with the first public key pk of the first participant and 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 operation 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 and security.
[0108] Next, the implementation manner of step 314 will be described in combination with the specific forms of the leaf node list and the prediction value list.
[0109] In an optional implementation manner, for the specific forms of the first leaf node list and the second leaf node list, they can be the same as the forms described in the related art, that is, the leaf node list is represented by a prediction 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; for any element at any position in the binary vector, the inclusion / exclusion of the leaf node at the corresponding position is represented by two values. For example, 0 is used to represent that the leaf node at the corresponding position is not included, and 1 is used to represent that the leaf node at the corresponding position is included. For specific examples, please refer to the description of the prediction node vector in the related art above, and will not be elaborated here. For the convenience of description below, the first node vector is represented by A, the second node vector is represented by B, and the ciphertext of A is denoted as [A].
[0110] The first prediction value list and the second prediction value list can also be in the form of a prediction value vector. For example, each element in the prediction value vector corresponds to a leaf node one by one, and the value of each element is the prediction value (i.e., the prediction shard value) of the corresponding leaf node. For example, Figure 2In the example, in Alice's Tree 1, the node vector is [1, 1, 0]. Correspondingly, the predicted value vector can be [0.07, 0.1, 0.1]. For the convenience of explanation below, the first predicted value list is denoted by Sa, and the second predicted value list is denoted by Sb. The ciphertext of Sa is denoted as [Sa].
[0111] In addition, it should be noted that in the above case, the encryption using the encryption algorithm can be: encrypt each element in the vector separately. For example, for the first node vector A = [1, 1, 0], the encryption can be to encrypt 1, 1, and 0 respectively to obtain the ciphertext [A].
[0112] In the above case, step 314 can be implemented in the following two specific ways, and the two implementation ways do not represent limitations in this specification.
[0113] In the first implementation, the homomorphic encryption can be semi - homomorphic encryption or fully homomorphic encryption.
[0114] Among them, the semi - homomorphic encryption algorithm adopted above can be Paillier or OU and other homomorphic encryption algorithms that support homomorphic addition operations.
[0115] In this method, in step 302, the way to obtain the first ciphertext can be: perform homomorphic encryption on the first node vector A to obtain the first encrypted data [A]; perform homomorphic encryption on the element - by - element product (i.e., element - wise multiplication) A * Sa of the first node vector A and the first predicted value vector Sa to obtain the second encrypted data [A * Sa]; the first encrypted data and the second encrypted data are included in the first ciphertext.
[0116] For the second encrypted data A * Sa, the corresponding plaintext is actually a vector including the predicted shard values of the leaf nodes that may be fallen into. In this vector, for the elements corresponding to the leaf nodes that may be fallen into in the tree model, the value of this element is the predicted value of the corresponding leaf node, and for the elements corresponding to the leaf nodes that cannot be fallen into, the value of this element is a specific value, such as 0.
[0117] For example, assume that the first node vector A is [1, 1, 0], and the first predicted value vector Sa is [0.07, 0.1, 0.1]. Then, multiplying them element - by - element can get A * Sa = [0.07, 0.1, 0]. Then, perform element - by - element encryption on A * Sa = [0.07, 0.1, 0] to obtain the second encrypted data [A * Sa], and encrypt the first node vector A = [1, 1, 0] to obtain the first encrypted data [A].
[0118] Correspondingly, in the above case, the implementation of step 314 can be: perform an element-wise plaintext-ciphertext multiplication operation on the second node vector B, the second predicted value vector Sb, and the first encrypted data [A] to obtain the first product ciphertext [A]*B*Sb; perform an element-wise plaintext-ciphertext multiplication operation on the second node vector B and the second encrypted data [A*Sa] to obtain the second product ciphertext [A*Sa]*B. In the above two steps, the plaintext-ciphertext multiplication operation in the additive homomorphic operation is used. Then, perform a ciphertext addition operation on the first product ciphertext [A]*B*Sb and the second product ciphertext [A*Sa]*B, and obtain the second ciphertext according to the ciphertext addition result.
[0119] Specifically, the sum vector [PRED] of the first product ciphertext and the second product ciphertext can be calculated according to formula (1):
[0120] [PRED] = [A]*B*Sb + [A*Sa]*B (1)
[0121] Among them, in formula (1), the above multiplication or addition is element-wise multiplication or addition, so as to obtain the ciphertext addition result [PRED].
[0122] Then, add all the elements in the ciphertext addition result [PRED] vector to obtain the second ciphertext. For example, the second ciphertext can be calculated through the following formula (2):
[0123] [SUM1] = reduce_sum([PRED]) (2)
[0124] That is, add each element in [PRED] in ciphertext to obtain the second ciphertext. The second ciphertext is the encrypted result corresponding to the predicted value.
[0125] The above method is for the additive homomorphic encryption algorithm (semi-homomorphic encryption). By encrypting [A] and [A*Sa], the second party is avoided from performing homomorphic multiplication operations, and the operation can be completed using the more efficient semi-homomorphic encryption.
[0126] In addition, since fully homomorphic encryption can also support the above operations, the above encryption can also use the fully homomorphic encryption algorithm.
[0127] In the second implementation, the homomorphic encryption can be fully homomorphic encryption.
[0128] In this method, in step 302, the first ciphertext can be obtained by: respectively performing homomorphic encryption on the first node vector A and the first predicted value vector Sa to obtain the first encrypted data [A] and the second encrypted data [Sa], which are classified into the first ciphertext.
[0129] 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 predicted node vector Sa.
[0130] Correspondingly, the specific implementation of step 314 is as follows: perform an element-wise plaintext-ciphertext multiplication operation on the second node vector B and the first encrypted data [A] to obtain a first intermediate term [A]*B; perform an element-wise 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 result of the ciphertext multiplication.
[0131] Specifically, the ciphertext multiplication operation of the first intermediate term and the second intermediate term can be calculated by formula (3):
[0132] [PRED] = [A]*B*(Sb + [Sa]) (3)
[0133] Where, [PRED] is the vector obtained by the ciphertext multiplication operation of the first intermediate term and the second intermediate term.
[0134] After obtaining the [PRED] vector, the operation of element-wise addition can be performed on [PRED] through formula (2) to obtain the second ciphertext.
[0135] The above method is for one tree. In the case of multiple trees, the above operations can be performed on each tree separately, and then the predicted value ciphertexts of multiple trees are added together to obtain the second ciphertext.
[0136] Specifically, the tree model includes multiple subtrees; the first leaf node list and the second leaf node list each contain multiple sub-node lists for the multiple subtrees; the first predicted value list and the second predicted value list each include multiple sub-predicted lists for the multiple subtrees. Correspondingly, step 314 includes: performing homomorphic operations on each subtree separately to obtain multiple sub-results corresponding to the multiple subtrees; performing a homomorphic addition operation on the multiple sub-results to obtain the second ciphertext. That is, the second ciphertext is obtained by performing a homomorphic addition operation on the 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 separately.
[0137] For example, for any subtree, a sub-result can be obtained by using the above method, and then the multiple sub-results are subjected to a homomorphic addition operation to obtain the second ciphertext.
[0138] In step 315, the second party sends the second ciphertext to the first party.
[0139] Correspondingly, in step 305 (not shown in the figure), the first participant receives the second ciphertext sent by the first participant;
[0140] In step 306, the first participant decrypts the second ciphertext to obtain the prediction result of the target object.
[0141] The second participant sends the second ciphertext to the first participant, enabling it to decrypt and obtain the prediction result of the target object. In this way, the joint prediction is completed.
[0142] Here, the first private key sk of the first participant can be used for decryption. Specifically, the prediction result here can be the predicted value of a certain characteristic of the target object, such as the predicted value of driving safety, etc.
[0143] In addition, in the case where the first prediction vector and the second prediction vector are amplified by a preset multiple as described above, step 306 here can be: decrypt the second ciphertext, and reduce the data obtained by decryption by the preset multiple to obtain the prediction result of the target object. In this way, an accurate prediction result can be obtained.
[0144] The above has been described in conjunction with the embodiments where 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 can also be recorded in other forms, such as ordered arrays. The operation logic for vector elements in the above embodiments can also be equivalently applied to array elements, which will not be elaborated here.
[0145] The above method utilizes the homomorphic encryption algorithm, making the intermediate results fully encrypted, without information leakage, and 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 communication times and higher processing efficiency in the case of network latency.
[0146] Next, a specific example will be used to illustrate the above method. This method involves two participants, Alice and Bob. Alice can be understood as the first participant above, and Bob is the second participant above. Among the multiple tree models maintained by Alice and Bob, there are multiple subtrees. Among them, the model of tree 1 is as Figure 2 shown. Next, tree 1 will be used 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 elaborated here.
[0147] As Figure 2 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.
[0148] In the above case, joint prediction is achieved through the following steps.
[0149] First, since PHE can only encrypt integers, the first prediction value vector and the second prediction value vector are magnified by 100 times to obtain integers. Then the first prediction value vector becomes: [7, 10, 10], and the second prediction value vector becomes [3, 10, 40].
[0150] Second, when Alice needs to obtain the prediction result, Alice generates the public key and private key of PHE, and sends the public key to Bob.
[0151] Third, Alice and Bob perform local predictions respectively, and obtain the first node vector A and the second node vector B respectively.
[0152] 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].
[0153] Fourth, Alice encrypts A and A*Sa using PHE to obtain [A] and [A*Sa]. The encryption method is element-wise encryption. For example, [A] means that each element in A is encrypted using 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 using PHE.
[0154] Fifth, Alice sends [A] and [A*Sa] to Bob, and Bob calculates:
[0155] (1) [PRED] = [A] * B * Sb + [A*Sa] * B. The method is element-wise multiplication and addition to obtain the [PRED] vector.
[0156] (2) [SUM1] = reduce_sum([PRED]). Add each element in [PRED] together to obtain an encrypted integer. [SUM1] is the ciphertext of the prediction value of tree 1.
[0157] (3) In the same way, the ciphertext of the prediction values of other sub-trees can be predicted, and finally all Scores are added to obtain the overall prediction value [SUM] of the model.
[0158] Sixth, Bob sends [SUM] to Alice, and Alice decrypts to obtain the result. Since the prediction value is magnified by a preset multiple, sum / 100 is the final result.
[0159] Corresponding to the embodiments of the foregoing method, this specification also provides embodiments of the apparatus and the computer device to which it is applied.
[0160] AsFigure 4 As shown in Figure 4 Figure 4 is a block diagram of a joint prediction device shown in this specification according to an exemplary embodiment. The device involves a first participant and a second participant, and 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:
[0161] A determination module 410, configured to determine a second leaf node list and a corresponding second prediction value list in which the target object may fall in the tree model according to a second feature part of the target object held locally;
[0162] A receiving module 420, configured to receive a first ciphertext sent by the first participant, where the first ciphertext is obtained by performing 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 part of the target object held by it;
[0163] 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;
[0164] A sending module 440, configured to send the second ciphertext to the first participant so that it decrypts to obtain a prediction result of the target object.
[0165] In an alternative 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; for any element at any position in the binary vector, two values are used to respectively represent whether the corresponding leaf node is included or not; the first prediction value list and the second prediction value list are correspondingly represented as a first prediction value vector and a second prediction value vector.
[0166] In an alternative embodiment, the first ciphertext includes first encrypted data and second encrypted data. The first encrypted data is a homomorphic ciphertext corresponding to the first node vector, and the second encrypted data is a homomorphic ciphertext corresponding to the product of the first node vector and the first prediction value vector.
[0167] In an alternative embodiment, the homomorphic encryption is semi-homomorphic encryption; the calculation module 430 is specifically configured to: perform an element-by-element plaintext-ciphertext multiplication operation on the second node vector, the second prediction value vector, and the first encrypted data to obtain a first product ciphertext; perform an element-by-element plaintext-ciphertext multiplication operation on the second node vector and the second encrypted data to obtain a second product ciphertext; and obtain the second ciphertext according to a ciphertext addition operation of the first product ciphertext and the second product ciphertext.
[0168] In an alternative embodiment, the first ciphertext includes first encrypted data and second encrypted data, where 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 predicted value vector.
[0169] In an alternative embodiment, the homomorphic encryption is fully homomorphic encryption; the computing module 430 is specifically configured to: perform an element-wise plaintext-ciphertext multiplication operation on the second node vector and the first encrypted data to obtain a first intermediate term; perform an element-wise 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 according to the ciphertext multiplication operation of the first intermediate term and the second intermediate term.
[0170] In an alternative embodiment, the elements in the first predicted value list and the second predicted value list are integer values obtained by magnifying the predicted values of the leaf nodes by a preset multiple.
[0171] In an alternative embodiment, the receiving module 420 is further configured to: receive a prediction request for the target object sent by the first party.
[0172] In an alternative embodiment, the tree model includes multiple subtrees; the first leaf node list and the second leaf node list each contain multiple sub-node lists for the multiple subtrees; the first predicted value list and the second predicted value list each include multiple sub-prediction lists for the multiple subtrees; the computing module 430 is specifically configured to: perform homomorphic operations on each subtree respectively to obtain multiple sub-results corresponding to the multiple subtrees; and perform a homomorphic addition operation on the multiple sub-results to obtain the second ciphertext.
[0173] As Figure 5 shown, Figure 5 is a block diagram of another joint prediction device illustrated in this specification according to an exemplary embodiment. The device relates to a first party and a second party, and the first party and the second party each maintain partial node information of a tree model. The device is applied to the first party and includes:
[0174] A determination module 510, configured to determine a first leaf node list and a corresponding first predicted value list in which the target object may fall in the tree model according to a first feature part of the target object held locally;
[0175] An encryption module 520, configured to perform homomorphic encryption processing based on the first leaf node list and the first predicted value list to obtain a first ciphertext;
[0176] A sending module 530, configured to send the first ciphertext to the second party;
[0177] A receiving module 540, configured to receive a second ciphertext sent by the second participating party; the second ciphertext is obtained by performing a homomorphic operation on the first ciphertext by 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 participating party according to a second feature part of a target object held by the second participating party;
[0178] A decryption module 550, configured to decrypt the second ciphertext to obtain a prediction result of the target object.
[0179] In an alternative 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 a binarized vector form; for an element at any position in the binarized vector, two values are used to respectively represent whether the corresponding leaf node is included or not; the first prediction value list and the second prediction value list are correspondingly represented as a first prediction value vector and a second prediction value vector.
[0180] In an alternative embodiment, the encryption module 520 is specifically configured 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; the first encrypted data and the second encrypted data are included in the first ciphertext.
[0181] In an alternative embodiment, the homomorphic encryption is semi-homomorphic encryption, and the second ciphertext is obtained by performing a ciphertext addition operation on a first product ciphertext and a second product ciphertext. The first product ciphertext is obtained by performing an element-by-element plaintext-ciphertext multiplication operation on the second node vector, the second prediction value vector, and the first encrypted data, and the second product ciphertext is obtained by performing an element-by-element plaintext-ciphertext multiplication operation on the second node vector and the second encrypted data.
[0182] In an alternative embodiment, the encryption module 520 is specifically configured 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, and include them in the first ciphertext.
[0183] In an alternative embodiment, the homomorphic encryption is fully homomorphic encryption, and the second ciphertext is obtained by performing a ciphertext multiplication operation on a first intermediate term and a second intermediate term. The first intermediate term is obtained by performing an element-by-element plaintext-ciphertext multiplication operation on the second node vector and the first encrypted data, and the second intermediate term is obtained by performing an element-by-element plaintext-ciphertext addition operation on the second prediction value vector and the second encrypted data.
[0184] In an alternative embodiment, the elements in the first prediction value list and the second prediction value list are integer values obtained by magnifying the prediction values of the leaf nodes by a preset multiple; the decryption module 550 is specifically configured to: decrypt the second ciphertext, and reduce the decrypted data by the preset multiple to obtain the prediction result of the target object.
[0185] In an alternative embodiment, the sending module 530 is further configured to send a prediction request for the target object to the second party.
[0186] In an alternative embodiment, the tree model includes a plurality of subtrees; the first leaf node list and the second leaf node list each contain a plurality of sub-node lists for the plurality of subtrees; the first prediction value list and the second prediction value list each include a plurality of sub-prediction lists for the plurality of subtrees; the second ciphertext is obtained by performing a homomorphic addition operation on a plurality of sub-results corresponding to the plurality of subtrees, and the plurality of sub-results corresponding to the plurality of subtrees are obtained by performing homomorphic operations on each respective subtree.
[0187] The implementation processes of the functions and roles of each module in the above device are specifically detailed in the implementation processes of the corresponding steps in the above method, and will not be elaborated here.
[0188] 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 embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place, or may be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in this specification. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0189] As Figure 6 shown, Figure 6 FIG. shows a hardware structure diagram of a computer device where the device for collaborative prediction in the embodiment is located. The device may include: a processor 1010 and a memory 1020 for storing instructions executable by the processor. In addition, the computer device may further 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 communicatively connected to each other inside the device through the bus 1050.
[0190] The processor 1010 can be implemented in the form of 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.
[0191] The memory 1020 for storing processor-executable instructions can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1020 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020.
[0192] The input / output interface 1030 is used to connect to the input / output module to implement information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Among them, the input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.
[0193] The communication interface 1040 is used to connect to a communication module (not shown in the figure) to implement communication interaction between this device and other devices. Among them, the communication module can implement communication through a wired method (such as USB, network cable, etc.) or through a wireless method (such as a mobile network, WIFI, Bluetooth, etc.).
[0194] The bus 1050 includes a path for transmitting information between various components of the device (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0195] 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, this device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary to implement the solutions of the embodiments of this specification, and does not necessarily include all the components shown in the figure.
[0196] An embodiment of this specification also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the above-described method for joint prediction is implemented.
[0197] Computer-readable media include both permanent and non-permanent, removable and non-removable media and can be implemented by any method or technology for storing information. The 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 technologies, compact disc read-only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0198] This specification also provides a computer program product, including a computer program or instructions. When the computer program or instructions are executed by a processor, the above-described method for joint prediction is implemented.
[0199] It should also be noted that the term "comprises", "comprising", or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but also other elements not expressly listed, or elements that are inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0200] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0201] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject.
Claims
1. A method for joint prediction, involving a first participant and a second participant, where the first participant and the second participant each maintain partial node information of a tree model; The method is applied to a second participating party and includes: Determining a second node vector composed of leaf nodes where the target object may fall in the tree model and a corresponding second prediction value vector according to a second feature part of the target object held locally; Receiving a first ciphertext sent by the first participating party, where the first ciphertext is obtained by homomorphic encryption based on a first node vector and a first prediction value vector; the first node vector and the first prediction value vector are determined by the first participating party according to a first feature part of the target object held by it; the first node vector and the second node vector are represented in the form of a binary vector; for any element in the binary vector, two values are used to represent whether the corresponding leaf node is included or not; Performing a homomorphic operation on the first ciphertext by using the second node vector and the second prediction value vector to obtain a second ciphertext; Sending the second ciphertext to the first participating party so that it can decrypt to obtain the prediction result of the target object.
2. The method according to claim 1, wherein, The first ciphertext includes first encrypted data and second encrypted data, where 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 pairwise product of the first node vector and the first prediction value vector; the homomorphic encryption is semi - homomorphic encryption; The performing a homomorphic operation on the first ciphertext by using the second node vector and the second prediction value vector to obtain a second ciphertext includes: Performing an element - by - element plaintext - ciphertext multiplication operation on the second node vector, the second prediction value vector and the first encrypted data to obtain a first product ciphertext; Performing an element - by - element plaintext - ciphertext multiplication operation on the second node vector and the second encrypted data to obtain a second product ciphertext; Performing a ciphertext addition operation on the first product ciphertext and the second product ciphertext, and obtaining the second ciphertext according to the result of the ciphertext addition operation.
3. The method according to claim 1, wherein The first ciphertext includes first encrypted data and second encrypted data, where 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; The homomorphic encryption is fully homomorphic encryption; The performing a homomorphic operation on the first ciphertext by using the second node vector and the second prediction value vector to obtain a second ciphertext includes: Performing an element - by - element plaintext - ciphertext multiplication operation on the second node vector and the first encrypted data to obtain a first intermediate term; Performing an element - by - element plaintext - ciphertext addition operation on the second prediction value vector and the second encrypted data to obtain a second intermediate term; Performing a ciphertext multiplication operation on the first intermediate term and the second intermediate term, and obtaining the second ciphertext according to the result of the ciphertext multiplication operation.
4. 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 magnifying the prediction values of the leaf nodes by a preset multiple.
5. According to the method described in claim 1, before determining, according to a second feature part of the target object held locally, a second node vector composed of leaf nodes where the target object may fall in the tree model and a corresponding first prediction value vector, it further includes: Receive a prediction request for the target object sent by the first participating party.
6. The method according to claim 1, wherein The tree model includes multiple subtrees; The first node vector and the second node vector each contain multiple sub-node vectors for the multiple subtrees; the first prediction value vector and the second prediction value vector each include multiple sub-prediction vectors for the multiple subtrees; The using the second node vector and the second prediction value vector to perform a homomorphic operation on the first ciphertext to obtain a second ciphertext includes: Performing homomorphic operations on each subtree respectively to obtain multiple sub-results corresponding to the multiple subtrees; Performing a homomorphic addition operation on the multiple sub-results to obtain the second ciphertext.
7. A method for joint prediction, involving a first participating party and a second participating party. The first participating party and the second participating party each maintain partial node information of a tree model. The method is applied to the first participating party and includes: Determine a first node vector and a corresponding first prediction value vector composed of leaf nodes in which the target object may fall in the tree model according to the first feature part of the target object held locally; Perform homomorphic encryption processing based on the first node vector and the first prediction value vector to obtain a first ciphertext; Send the first ciphertext to the second participating party; Receive a second ciphertext sent by the second participating party; 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. The second node vector and the second prediction value vector are determined by the second participating party according to the second feature part of the target object held by it; the first node vector and the second node vector are represented in the form of a binary vector; for any element at any position in the binary vector, two values are used to represent whether the corresponding leaf node is included or not; Decrypt the second ciphertext to obtain the prediction result of the target object.
8. The method according to claim 7, wherein The performing homomorphic encryption processing based on the first node vector and the first prediction value vector to obtain a first ciphertext includes: Perform homomorphic encryption on the first node vector to obtain a first encrypted data; perform homomorphic encryption on the pairwise product of the first node vector and the first prediction value vector to obtain a second encrypted data; the first encrypted data and the second encrypted data are included in the first ciphertext.
9. The method according to claim 7, wherein The performing homomorphic encryption processing based on the first node vector and the first prediction value vector to obtain a first ciphertext includes: Perform homomorphic encryption on the first node vector and the first prediction value vector respectively to obtain a first encrypted data and a second encrypted data, and include them in the first ciphertext.
10. The method according to claim 7, wherein, The elements in the first prediction value vector and the second prediction value vector are integer values obtained by magnifying 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: Decrypt the second ciphertext and reduce the decrypted data by the preset multiple to obtain the prediction result of the target object.
11. The method according to claim 7, before determining, in the first feature part of the target object held locally, the first node vector formed by the leaf nodes in which the target object may fall in the tree model and the corresponding first prediction value vector, further includes: Sending a prediction request for the target object to the second participating party.
12. The method according to claim 7, wherein, The tree model includes a plurality of subtrees; The first node vector and the second node vector each include a plurality of sub-node vectors for the plurality of subtrees; the first prediction value vector and the second prediction value vector each include a plurality of sub-prediction vectors for the plurality of subtrees; the second ciphertext is obtained by performing a homomorphic addition operation on the plurality of sub-results corresponding to the plurality of subtrees, and the plurality of sub-results corresponding to the plurality of subtrees are obtained by performing homomorphic operations on each subtree respectively.
13. A computer device, comprising: A processor; A memory for storing processor-executable instructions; Wherein, the processor realizes the method according to any one of claims 1-12 by running the executable instructions.
14. A computer program product, comprising a computer program or instruction, when the computer program or instruction is executed by a processor, realizes the method according to any one of claims 1-12.