Secure two-party financial risk prediction method and device based on trusted execution environment

By adopting a secure two-party computing method based on a trusted execution environment in decision tree prediction, the problem of high communication complexity in the existing technology is solved, and efficient financial risk prediction and strong privacy protection are achieved.

CN118864075BActive Publication Date: 2025-03-07ZHEJIANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411331174.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-03-07
Estimated Expiration
2044-09-24

AI Technical Summary

Technical Problem

The existing decision tree prediction scheme based on secure multi-party computing has the problem of high communication complexity and requires two-way multi-round communication, resulting in low efficiency and flexibility.

Method used

The secure two-party financial risk prediction method based on a trusted execution environment is adopted. The first party and the second party receive their respective feature vector secret shares, the index secret shares of the decision node, the threshold secret shares and the label secret shares of the leaf nodes respectively, and the secure comparison of the feature values ​​and thresholds is achieved, and the total path cost and prediction values ​​of each leaf node are calculated, so as to obtain the prediction results and complete them through one-way communication.

Benefits of technology

It realizes efficient financial risk prediction, reduces communication complexity and security risks, and improves computing efficiency and privacy protection levels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864075B_ABST
    Figure CN118864075B_ABST
Patent Text Reader

Abstract

The present invention discloses a secure two-party financial risk prediction method and device based on a trusted execution environment. When a data holder has a feature vector to be predicted, a model holder has a decision tree model, and both parties do not want to disclose privacy, a first party and a second party respectively receive their own secret shares of feature vectors, index secret shares of decision nodes in a full binary decision tree, threshold secret shares, and label secret shares of leaf nodes. Based on the trusted execution environment, the first party and the second party call a Shared OT protocol, a secure comparison protocol, and an AND gate protocol to obtain secret shares of prediction results, thereby achieving efficient secure prediction of decision trees in financial risk prediction scenarios, and only one-way communication between the parties is required to complete the task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of decision tree prediction, and in particular to a secure two-party financial risk prediction method and device based on a trusted execution environment. Background Art

[0002] As a common classification and regression model in machine learning, decision trees are widely used in many fields such as financial risk assessment, medical diagnosis, traffic analysis, and market analysis due to their high efficiency, simplicity, directness, ease of interpretation and visualization, and high accuracy. However, in practical applications, decision tree models and data are often not fully owned by one party. When the model or data is leaked to others, there is a risk of privacy leakage. For example, the decision nodes in the decision tree model may reflect certain characteristics of the training data. Privacy leakage will not only damage the relevant rights and interests of users and enterprises, but may even bring legal risks. Based on the above problems, decision tree prediction with privacy protection has become a research hotspot.

[0003] Secure two-party computing allows two parties who do not trust each other to jointly calculate the result of a common function without leaking the privacy of their own inputs. Trusted execution environment (TEE) can ensure the privacy and integrity of the code and data running in it, and can be applied to a variety of privacy protection scenarios. Using secure two-party computing and trusted execution environment in decision tree prediction scenarios can complete decision tree prediction with less accuracy loss while effectively protecting the privacy of the model and data.

[0004] At present, decision tree prediction schemes based on secure multi-party computing often have problems such as high communication complexity and the need for two-way multi-round communication, resulting in low efficiency and flexibility. For example, "Ji K, Zhang B, Lu T, et al. UCSecure Private Branching Program and Decision Tree Evaluation[J]. IEEE Transactions on Dependable and Secure Computing, 2022." provides a three-party decision tree security prediction scheme based on secure multi-party computing and function secret sharing, but it requires multiple rounds of communication in the online stage and cannot achieve one-way communication; "JPK Ma, RKH Tai, Y. Zhao, and SS Chow, "Let's strideblindfolded in a forest: Sublinear multi-client decision trees evaluation," in Proc. Netw. Distrib. Syst. Secur. Symp., 2021. " provides a decision tree security prediction scheme based on key management and conditional oblivious transfer, but it requires multiple rounds of communication in the online stage and cannot achieve one-way communication. Summary of the invention

[0005] In view of the problems existing in the prior art, the purpose of the embodiments of the present application is to provide a secure two-party financial risk prediction method and device based on a trusted execution environment.

[0006] According to a first aspect of an embodiment of the present application, a secure two-party financial risk prediction method based on a trusted execution environment is provided, comprising:

[0007] The first participant and the second participant respectively receive their own secret shares of feature vectors, secret shares of indexes of decision nodes in the full binary decision tree, secret shares of threshold values, and secret shares of labels of leaf nodes;

[0008] The first participant, for each decision node, inadvertently selects the corresponding eigenvalue according to the corresponding eigenvector secret share and index secret share, generates a first eigenvalue secret share, and implements a secure comparison of the eigenvalue and the threshold through the first eigenvalue secret share and the corresponding threshold secret share, obtains a first comparison result secret share, sets path cost secret shares for the left and right lines of the decision node based on the first comparison result secret share, calculates the total path cost secret share and the prediction value secret share of each leaf node, thereby obtaining a first prediction result secret share, and sends corresponding information to the second participant;

[0009] The second participant combines the information sent by the first participant, and inadvertently selects the corresponding eigenvalue according to the corresponding eigenvector secret share and index secret share, generates a second eigenvalue secret share, and implements a secure comparison of the eigenvalue and the threshold through the second eigenvalue secret share and the threshold secret share, obtains a second comparison result secret share, sets path cost secret shares for the left and right lines of the decision node based on the second comparison result secret share, calculates the total path cost secret share and the prediction value secret share of each leaf node, and thereby obtains a second prediction result secret share;

[0010] The result receiver performs an XOR calculation on the first prediction result secret share and the second prediction result secret share to obtain a prediction result.

[0011] Furthermore, for each decision node, according to the corresponding eigenvector secret share and index secret share, the corresponding eigenvalue is randomly selected to generate the first eigenvalue secret share, which is specifically:

[0012] A pseudo-random number generator is used to generate a feature vector mask, an index mask, and a first eigenvalue secret share of an inadvertently selected eigenvalue, wherein the index mask is used to perform a mask operation on the first index secret share to obtain a first masked index secret share, and the feature vector mask is used to perform a mask operation on the first eigenvector secret share to obtain a first masked eigenvector secret share.

[0013] Furthermore, through the first characteristic value secret share and the corresponding threshold secret share, a secure comparison of the characteristic value and the threshold is achieved to obtain a first comparison result secret share, which is specifically:

[0014] A pseudo-random number generator is used to generate an eigenvalue mask, a threshold mask, and a first comparison result secret share, wherein the eigenvalue mask performs a mask operation on the first eigenvalue secret share to obtain a first masked eigenvalue secret share, and the threshold mask performs a mask operation on the first threshold secret share to obtain a first masked threshold secret share.

[0015] Further, setting path cost secret shares for left and right lines of the decision node based on the first comparison result secret share, calculating the total path cost secret share and the prediction value secret share of each leaf node, thereby obtaining the first prediction result secret share, including:

[0016] Assigning the first path cost secret share of the left line of the decision node to the first comparison result secret share, and assigning the first path cost secret share of the right line of the decision node to the logical negation of the first comparison result secret share;

[0017] Based on the first path cost secret share of the left and right lines of each decision node, calculate the first total path cost secret share of each leaf node ,in represents the first total path cost secret share of all the paths from the root node to the leaf node, where is the height of the decision tree;

[0018] Based on the first total path cost secret share of each leaf node, calculate the corresponding first prediction value secret share;

[0019] XOR the first prediction value secret shares of all leaf nodes to obtain the first prediction result secret share;

[0020] The first prediction value secret share Depend on get, is the secret share of the first tag value, is the first total path cost secret share, The specific calculation process is:

[0021] Generate a label value mask, a total path cost mask, and a first prediction result secret share using a pseudo-random number generator;

[0022] Performing a mask operation on the first label value secret share based on the label value mask to obtain a first masked label value secret share;

[0023] Performing a mask operation on the first total path cost mask and the first total path cost secret share based on the total path cost mask to obtain a first masked total path cost secret share;

[0024] The first masked label value secret share and the first masked total path cost secret share are sent to the second party.

[0025] Further, in combination with the information sent by the first participant, according to the corresponding eigenvector secret share and the index secret share, the corresponding eigenvalue is inadvertently selected to generate a second eigenvalue secret share, including:

[0026] Performing an XOR operation on the second eigenvector secret share and the first masked eigenvector secret share to obtain a masked eigenvector;

[0027] Performing an XOR operation on the second index secret share and the first mask index secret share to obtain a masked index;

[0028] Using the trusted execution environment, the masked feature vector and index are calculated as follows to obtain the calculation results : Generate feature vector mask using pseudo-random number generator , Index Mask and the first eigenvalue secret share , where n is the dimension of the feature vector; the first prediction result secret share is set to the initial value of the calculation result t1, and right Update, where ;

[0029] The calculation results Set to the second eigenvalue secret share The initial value of right to update.

[0030] Furthermore, in combination with the information sent by the first participant, a secure comparison of the characteristic value and the threshold is achieved through the second characteristic value secret share and the threshold secret share, and a second comparison result secret share is obtained, including:

[0031] Performing an XOR operation on the first masked eigenvalue secret share and the second eigenvalue secret share to obtain a masked eigenvalue;

[0032] Performing an XOR operation on the first masked threshold secret share and the second threshold secret share to obtain a masked threshold;

[0033] Using the trusted execution environment, the masked feature values ​​and thresholds are calculated as follows to obtain the calculation results: : Generate eigenvalue mask using pseudo-random number generator and threshold mask and the first comparison result secret share , for the masked eigenvalues and threshold Decompose and get the corresponding bit representation , is the bit length of the feature value; the feature value mask is generated using a pseudo-random number generator , threshold mask and the first comparison result secret share; decompose the eigenvalue mask and the threshold mask to obtain the corresponding bit representation ;calculate ,in is the secret share of the first comparison result, , ,

[0034] , , , , ;

[0035] The calculation results Set to the second comparison result secret share.

[0036] Further, setting path cost secret shares for left and right lines of the decision node based on the second comparison result secret share, calculating the total path cost secret share and the secret share of the predicted value of each leaf node, thereby obtaining the second prediction result secret share, including:

[0037] Assign the second path cost secret shares of the left and right lines of the decision node to the second comparison result secret share;

[0038] Based on the second path cost secret share of the left and right lines of each decision node, the second total path cost secret share of each leaf node is calculated ,in A second total path cost secret share representing all routes from the root node to the leaf node;

[0039] Based on the second total path cost secret share of each leaf node, calculate the corresponding second prediction value secret share;

[0040] XOR the second prediction value secret shares of all leaf nodes to obtain the second prediction result secret share;

[0041] The second prediction value secret share Depend on get, is the second tag value secret share, is the second total path cost secret share, The specific calculation process is:

[0042] Performing an XOR operation on the first masked label value secret share and the second label value secret share to obtain a masked label value;

[0043] Performing an XOR operation on the first masked total path cost secret share and the second total path cost secret share to obtain a masked total path cost;

[0044] Using the trusted execution environment, the masked label value and the total path cost Perform the following calculation: Generate a label value mask using a pseudo-random number generator , total path cost mask and The first secret share , calculate the return value ;

[0045] Calculate the second prediction value secret share .

[0046] According to a second aspect of an embodiment of the present application, a secure two-party financial risk prediction device based on a trusted execution environment is provided, comprising:

[0047] A receiving module, used for the first participant and the second participant to respectively receive their respective secret shares of feature vectors, secret shares of indexes of decision nodes in a full binary decision tree, secret shares of threshold values, and secret shares of labels of leaf nodes;

[0048] A first prediction result secret share acquisition module is used for the first participant to inadvertently select a corresponding eigenvalue for each decision node according to the corresponding eigenvector secret share and index secret share, generate a first eigenvalue secret share, and implement a secure comparison of the eigenvalue and the threshold through the first eigenvalue secret share and the corresponding threshold secret share, obtain a first comparison result secret share, set a path cost secret share for the left and right lines of the decision node based on the first comparison result secret share, calculate the total path cost secret share and the prediction value secret share of each leaf node, thereby obtaining the first prediction result secret share, and send corresponding information to the second participant;

[0049] A second prediction result secret share acquisition module is used for the second participant to combine the information sent by the first participant, inadvertently select the corresponding eigenvalue according to the corresponding eigenvector secret share and index secret share, generate a second eigenvalue secret share, and achieve a secure comparison of the eigenvalue and the threshold through the second eigenvalue secret share and the threshold secret share, obtain a second comparison result secret share, set the path cost secret share for the left and right lines of the decision node based on the second comparison result secret share, calculate the total path cost secret share of each leaf node and the secret share of the prediction value, so as to obtain the second prediction result secret share;

[0050] The prediction result calculation module is used for the result receiver to perform an XOR calculation on the first prediction result secret share and the second prediction result secret share to obtain a prediction result.

[0051] According to a third aspect of an embodiment of the present application, there is provided a secure two-party financial risk prediction electronic device based on a trusted execution environment, comprising:

[0052] one or more processors;

[0053] A memory for storing one or more programs;

[0054] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in the first aspect.

[0055] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.

[0056] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0057] It can be seen from the above embodiments that this application, based on a trusted execution environment, can achieve efficient decision tree security prediction in financial risk prediction scenarios, and the participants only need one-way communication to complete it. The method described in this application has the following advantages:

[0058] (1) High communication efficiency: Since only one-way communication is required, the protocol has low communication overhead, which can significantly reduce the required bandwidth and time. Especially in an environment with large network delays, it can significantly improve computing efficiency.

[0059] (2) Easy to implement and deploy: The reduction in communication rounds makes the protocol easier to implement and deploy, reducing the need for complex synchronization and coordination.

[0060] (3) Reduce security risks: Reducing the number of communications also means reducing the opportunities for interaction that may be exploited by attackers, thereby reducing the risk of security threats such as man-in-the-middle attacks and replay attacks.

[0061] (4) Applicable to asymmetric communication scenarios: In some scenarios, there may be one party that cannot actively send data (such as a sensor node in a sensor network). In this case, a one-way communication protocol can still achieve secure computing under these constraints.

[0062] (5) Privacy protection: One-way communication allows one party to perform calculations without exposing its own information, thereby improving the privacy protection level of the participants.

[0063] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0065] Figure 1 The present invention is a flowchart of a secure two-party financial risk prediction method based on a trusted execution environment according to an exemplary embodiment.

[0066] Figure 2 It is a block diagram of a secure two-party financial risk prediction device based on a trusted execution environment according to an exemplary embodiment.

[0067] Figure 3 The diagram is a schematic diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0068] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.

[0069] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0070] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0071] Parameter declaration:

[0072] In this application, for a variable , express No. Components (when is a vector) or bits (when is a scalar), express No. The secret sharing scheme adopted in this application is two-party XOR secret sharing. , divide it into two bits of length The secret share and ,satisfy , two secret shares and It is necessary to satisfy that one of them is uniformly randomly selected. Without loss of generality, in this application, it is assumed that the first secret share is randomly selected.

[0073] The embodiment of the present application proposes a financial risk prediction method based on secure two-party computing and a trusted execution environment, the goal of which is to predict a financial risk for a given decision tree and a feature vector. , output its prediction results , and during the calculation process, the decision tree and feature vector are not leaked Any private information. In this application, it involves data holders, model holders, first participants P1, second participants P2 and result receivers, wherein the first and second participants perform the prediction process, the second participant can call the trusted execution environment (TEE), the data holder has the feature vector to be predicted, the model holder has the decision tree model, both parties do not want to leak privacy, the result receiver receives the secret share of the first and second participants for the prediction result and calculates the prediction result, which is generally any one or more of the data owner and the model owner, or other parties. First, the data holder and the model holder share the feature vector and the decision tree model with the two participants P1 and P2 respectively through the secret sharing technology; then P1 and P2 jointly execute the decision tree security prediction protocol, and use the obtained secret share to predict the decision tree. When executing the protocol, only one-way communication from P1 to P2 will occur. When executing the decision tree security prediction protocol, three sub-protocols are used: Shared OT protocol, secure comparison protocol and AND gate protocol. After the protocol is executed, P1 and P2 will obtain the corresponding secret share of the prediction result. During the prediction process, if P1 and P2 do not collude, no single party will obtain any private information about the data and decision tree model.

[0074] It should be noted that the data owner and the model owner do not have to be distinguished from the first participant and the second participant. For example, P1 can be both the data owner and participate in the calculation with P2. The same applies to other situations.

[0075] Figure 1 is a flowchart of a secure two-party financial risk prediction method based on a trusted execution environment according to an exemplary embodiment. Figure 1 As shown, the method is applied in a terminal and may include the following steps:

[0076] S1: The first participant and the second participant receive their own secret shares of feature vectors, secret shares of indexes of decision nodes in the full binary decision tree, secret shares of threshold values, and secret shares of labels of leaf nodes respectively;

[0077] Specifically, the data holder feature vector , For one dimensional vector, each of whose components has a bit length of In financial risk prediction, feature vectors can include personal characteristics (such as age, marital status), income and expenditure characteristics (such as monthly income, monthly expenditure), credit record characteristics (such as credit score, overdue record), asset characteristics (such as real estate status, investment status), transaction behavior characteristics (such as account balance changes, transaction frequency), etc. These characteristics comprehensively reflect the customer's credit status, financial stability and repayment ability, thereby helping the model to effectively predict financial risks. The model holder holds a pre-trained decision tree model, which is used to predict financial risk predictions such as credit assessment of both parties to a transaction or transaction fraud. The prediction results of the decision tree can be one or more of the customer's default risk (such as default or non-default), credit rating (such as high risk, medium risk, low risk), loan approval decision (such as approval or rejection), fraud detection results (such as fraudulent transactions or non-fraudulent transactions) or loan interest rate classification (such as high interest rate, medium interest rate, low interest rate) (such as the first two digits of the label value represent the default risk, the middle two digits represent the credit rating, and the last two digits represent whether the loan is approved), or risk rating (such as level 1 to level 10). These label values ​​help financial institutions make reasonable risk management and decisions. If the decision tree is not a full binary tree, it can be converted into a full binary tree by adding nodes (it should be noted that if nodes are added in this way, the decision tree cannot have exactly the same decision nodes). The depth of the decision tree is , the number of decision nodes , the number of leaf nodes (i.e. classification nodes) is For each decision node , whose eigenvector index and threshold ,in Only one bit is 1, and the rest are 0. No. If the bit is 1, it means that the feature value selected by the node is For the convenience of expression, in this application, we use Represents a decision node The selected eigenvalues. For each leaf node , whose label value , for When making decision tree predictions, for a given feature vector , starting from the root node of the decision tree, for each decision node passed , according to its eigenvector index , select the eigenvalue and with the threshold For comparison, if If it is true, go to its left child node, otherwise go to its right child node, and repeat the above steps until you reach the first leaf node. The label value of this node is the final prediction result or prediction value.

[0078] In this step, the data holder and the model holder need to divide the feature vector and the decision tree model into two secret shares by XOR respectively, and distribute them to the first participant P1 and the second participant P2. Specifically:

[0079] The data holder has the feature vector , and divide it into two secret shares, namely, for , randomly generate the first eigenvalue secret share , and calculate the second eigenvalue secret share ,in represents uniform random selection. Based on this, the data holder will secret the first eigenvector Send to P1, the second eigenvector secret share Send to P2.

[0080] The model owner divides the decision tree into two secret shares, that is, for each decision node , randomly generate the first secret share of index and threshold and , and calculate the corresponding second secret share and ; For each leaf node , randomly generate the first secret share of the tag value And calculate the corresponding second secret share Based on this, the model holder will share the first index secret , the first threshold secret share and the first tag value secret share Send to P1, the second index secret share , the second threshold secret share and the second tag value secret share Send to P2.

[0081] Before the first participant P1 and the second participant P2 conduct the decision tree prediction process, P1 remotely authenticates P2's TEE to ensure the authenticity of the TEE and that the code running in it is the relevant code for executing the protocol. Subsequently, P1 and P2's TEE negotiate a random seed for a pseudorandom number generator (PRG). , The length of should be long enough to meet the security requirements of PRG. Visible only to P1 and P2 TEEs.

[0082] It should be noted that the specific remote authentication method is determined by the TEE of different manufacturers, and the negotiation seed Method and seeds The length should be determined according to the supported PRG algorithm and its security requirements, and this application does not impose any restrictions on it.

[0083] S2: The first participant inadvertently selects the corresponding eigenvalue for each decision node according to the corresponding eigenvector secret share and index secret share, generates a first eigenvalue secret share, and implements a secure comparison of the eigenvalue and the threshold through the first eigenvalue secret share and the corresponding threshold secret share, obtains a first comparison result secret share, sets path cost secret shares for the left and right lines of the decision node based on the first comparison result secret share, calculates the total path cost secret share and the prediction value secret share of each leaf node, thereby obtaining a first prediction result secret share, and sends corresponding information to the second participant;

[0084] Specifically, the first participant P1 first performs , according to the first eigenvector secret share and the first index secret share , calling the Shared OT protocol, inadvertently selecting the eigenvalue corresponding to the decision node from the eigenvector , and get the first eigenvalue secret share . Then P1 for each decision node , according to the first characteristic value secret share and the first threshold secret share , call the safe comparison protocol to compare the characteristic values and threshold and obtain the first comparison result secret share Then, according to all the comparison results, the path cost is set for the left and right lines of the corresponding decision node. Then P1 for each leaf node , call the AND gate protocol multiple times to obtain the path cost to each leaf node The first path cost secret share , and call the AND gate protocol to calculate the predicted value of the node The first predicted value secret share Finally, P1 locally calculates the first prediction result secret share , returned to the result recipient.

[0085] More specifically, this step may include the following sub-steps:

[0086] S21: When the first participant P1 obtains the secret share Then, for each decision node , implement the Shared OT protocol , inadvertently selecting the corresponding eigenvalue , and get the first secret share of the eigenvalue Specifically, for each decision node , The calculation process includes steps S211 - S215:

[0087] S211: Generate feature vector mask using PRG , Index Mask and the first eigenvalue secret share of the selected eigenvalue ,Right now ;

[0088] S212: Index-based masking Secret share for the first index Perform mask operation to obtain the first mask index secret share . Then you can Sent directly to P2, P2 cannot recover the secret value from it , effectively protect the privacy information of the model;

[0089] S213: Feature vector based masking , perform mask operation on the first eigenvector secret share to obtain the first masked eigenvector secret share , its weight , so that you can then Sent directly to P2, P2 cannot recover the feature vector from it and its weight, effectively protecting data privacy information;

[0090] S214: The first mask feature vector secret share and the first mask index secret share Send it to P2, which will use it in calculations. P1 can send it along with other data after all calculations in step S2 are completed.

[0091] S22: P1 For each decision node , after obtaining the first eigenvalue secret share of the corresponding eigenvalue After that, execute the security comparison protocol , realize the eigenvalue and threshold The first comparison result secret share is obtained by security comparison Specifically, for each decision node , The method comprises steps S221 to S225:

[0092] S221: Generate eigenvalue mask using PRG and threshold mask and the first comparison result secret share ,Right now ;

[0093] S222: Eigenvalue-based masking The secret share of the first eigenvalue Perform mask operation to obtain the first mask eigenvalue secret share . Then you can It is sent directly to P2, and P2 cannot obtain any private information about the selected feature values, effectively protecting the privacy information of the model and data;

[0094] S223: Threshold mask based For the first threshold secret share Perform mask operation to obtain the first mask threshold secret share . Then you can It is sent directly to P2, so P2 cannot obtain any privacy information about the threshold, which effectively protects the privacy information of the model.

[0095] S224: The first masked eigenvalue secret share and the first mask threshold secret share Send it to P2, which will use it in calculations. P1 can send it along with other data after all calculations in step S2 are completed.

[0096] S23: P1 For each decision node , after obtaining the secret share of the first comparison result between the feature value selected by the node and the threshold Afterwards, according to Set the path cost of the left and right lines of this node. A line refers to the path from the decision node to its left and right child nodes. Each decision node has two lines, and each line has a path cost. Assume that the decision node is numbered , the path cost of the left line is , the right line is .

[0097] Specifically, P1 for each decision node , the secret share based on the comparison result of the feature value in the node and the threshold , assign the first path cost secret share of the left line to ,Right now ; Assign the first path cost secret share of the right line to ,Right now ,in Represents the logical NOT operation.

[0098] S24: After P1 completes the assignment of the first secret share of the path cost of all decision nodes’ left and right lines, for each leaf node , call the AND gate protocol multiple times to calculate the first total path cost secret share of the node ,in Represents the first path cost secret share of all the lines from the root node to the leaf node, For P1, it represents the AND gate protocol For the same bit length (assuming )variable and , and its corresponding first secret share and , Expressed as , the result is The first secret share .

[0099] It should be noted that the first total path cost secret share of the computing node The AND gate protocol will be called multiple times during the process, and the corresponding data (that is, the two secret shares after masking) must be sent to P2. P1 only needs to keep .

[0100] S25: After P1 obtains the first total path cost secret share of all leaf nodes, it calls the AND gate protocol to calculate the first prediction value secret share of each leaf node ,in has been extended to and Equal length, that is, When expanded to ;when When expanded to Specifically, the gate protocol The calculation process is shown in steps S251 - S254:

[0101] S251: Generate label value mask using PRG and the total path cost mask And the first predicted value secret share of the leaf node ,Right now ;

[0102] S252: Masking based on label value Secret share for the first tag value Perform masking operation to obtain the secret share of the first masked tag value ; Based on the total path cost mask Secret share of the first total path cost Perform mask operation to obtain the secret share of the total path cost of the first mask . Then you can and Sent directly to P2, P2 cannot obtain the relevant label value and the total path cost Any privacy information of the data, effectively protecting data privacy information and prediction process information;

[0103] S253: and Send to P2, which will use this data in calculations. P1 can send it along with other data after all calculations in step S2 are completed;

[0104] S254: The first prediction value secret share As The return value of .

[0105] S26: P1 locally XORs the first prediction value secret shares of all leaf nodes to obtain the first prediction result secret share of the final prediction result , and The result is sent to the recipient. The recipient can be determined according to the specific situation, and is generally one or more of the data owner, the model owner, or other parties.

[0106] Note that when P1 calls the three sub-protocols, it will send the corresponding messages to P2. P1 can send them together after calculation without affecting the results.

[0107] S3: The second participant combines the information sent by the first participant, randomly selects the corresponding eigenvalue according to the corresponding eigenvector secret share and index secret share, generates a second eigenvalue secret share, and implements a secure comparison of the eigenvalue and the threshold through the second eigenvalue secret share and the threshold secret share, obtains a second comparison result secret share, sets path cost secret shares for the left and right lines of the decision node based on the second comparison result secret share, calculates the total path cost secret share and the prediction value secret share of each leaf node, and obtains the second prediction result secret share;

[0108] The second participant P2 first calculates each decision node , according to the second eigenvector secret share and the second index secret share , and the first mask feature vector secret share received from P1 and the first mask index secret share , calling the Shared OT protocol, inadvertently selecting the eigenvalue corresponding to the decision node from the eigenvector , and obtain the second eigenvalue secret share of the eigenvalue Then P2 for the decision node , based on the second eigenvalue secret share of the eigenvalue selected by the node and the second threshold secret share , and the first masked feature value secret share received from P1 and the first mask threshold secret share , call the safe comparison protocol to compare the characteristic values and threshold and obtain the second comparison result secret share Then, according to all the comparison results, the path cost is set for the left and right lines of the corresponding decision node. Then P2 sets the path cost for each leaf node. , call the AND gate protocol multiple times to obtain the path cost to each leaf node The second path cost secret share , and call the AND gate protocol to calculate the predicted value of the node The second predicted value secret share Finally, P2 locally obtains the second prediction result secret share for calculating the final prediction result , and returns it to the result recipient.

[0109] S31: When P2 obtains the secret share Then, for each decision node , after receiving the first mask feature vector secret share generated in steps S211 - S214 from P1 and the first mask index secret share After that, execute the Shared OT protocol , inadvertently selecting the corresponding eigenvalue , and obtain the corresponding second eigenvalue secret share Specifically, each decision node , The method comprises steps S311 to S316:

[0110] S311: For , calculate the masked feature vector No. Quantity ;

[0111] S312: Calculate the index value after masking ;

[0112] S313: Call TEE to pass the masked feature vector and the masked index value Input into TEE, TEE performs the following calculations:

[0113] (1) Generate feature vector mask using PRG and index mask and the first eigenvalue secret share ,Right now , because the same pseudo-random number generator seed is used , and the pseudo-random number generator call is consistent with P1, and the parameters generated in this step are exactly the same as those generated in step S211;

[0114] (2) Initialization results ;

[0115] (3) For , update the results ;

[0116] (4) The results Return to P2;

[0117] S314: Initialize the second characteristic value secret share to the result returned by TEE ,Right now ;

[0118] S315: For ,renew ;

[0119] It can be seen that in TEE, the vector and index This can, to a certain extent, prevent TEE channel attacks or problems where the TEE is not trustworthy enough.

[0120] S32: P2 for each decision node , after obtaining the second eigenvalue secret share , and receives from P1 the first masked feature value secret share generated in steps S221 - S224 and the first mask threshold secret share After that, execute the security comparison protocol , realize the eigenvalue and threshold , and obtain the second comparison result secret share Specifically, for each decision node , the calculation process includes steps S321 - S324:

[0121] S321: Calculate the masked eigenvalues ;

[0122] S322: Calculate the threshold after masking ;

[0123] S323: Call TEE to obtain the masked feature value and the threshold after masking Input into TEE, TEE performs the following calculations:

[0124] (1) Decomposed Bit Representation ,in yes The least significant bit of yes The most significant bit of

[0125] (2) Decomposed Bit Representation ,in yes The least significant bit of yes The most significant bit of

[0126] (3) Generate eigenvalue mask using PRG and threshold mask and the first comparison result secret share ,Right now . Because the same pseudo-random number generator seed is used , and the pseudo-random number generator call is consistent with P1, and the parameters generated in this step are exactly the same as those generated in step S221;

[0127] (4) Decomposed Bit Representation ,in yes The least significant bit of yes The most significant bit of

[0128] (5) Decomposed Bit Representation ,in yes The least significant bit of yes The most significant bit of

[0129] (6) Calculate the intermediate value ;

[0130] (7) Calculate the intermediate value ;

[0131] (8) Initialize boundary values , ;

[0132] (9) For , iterative calculation to get the intermediate value , and the median ;

[0133] (10) Return results Return to P2;

[0134] S324: P2 sets the second comparison result secret share Return value of TEE ,Right now ;

[0135] It can be seen that in TEE, the characteristic value is not and threshold This can, to a certain extent, prevent TEE channel attacks or problems where the TEE is not trustworthy enough.

[0136] S33: P2 For each decision node , after obtaining the secret share of the second comparison result between the feature value selected by the node and the threshold Afterwards, according to Set the path cost of the left and right lines of this node.

[0137] Specifically, P2 for each decision node , the secret share according to the second comparison result of the characteristic value in the node and the threshold , assign the second secret share of the left line to ,Right now ; Assign the second secret share of the right line to ,Right now .

[0138] S34: After P2 completes the assignment of the second path cost secret shares of all decision nodes’ left and right lines, for each leaf node , call the AND gate protocol multiple times to calculate the second total path cost secret share of the node ,in represents the second path cost secret share of all the lines from the root node to the leaf node, For P2, it represents the AND gate protocol For the same bit length (assuming )variable and , and its corresponding second secret share and , after P2 receives the masked variable calculated by P1 in step S242 The first secret share and the masked variables The first secret share back, Expressed as , the result is The first secret share .

[0139] S35: After P2 obtains the second total path cost secret share of all leaf nodes and the data sent by P1 in step S25, it calls the AND gate protocol to calculate the second predicted value secret share of each leaf node. ,in has been extended to and Equal length, that is, When expanded to ;when When expanded to ; Specifically, the AND gate protocol The calculation process is shown in steps S351 - S355:

[0140] S351: Calculate the masked label value ;

[0141] S352: Calculate the total path cost after masking ;

[0142] S353: Call TEE to and Input into TEE, TEE performs the following calculations:

[0143] (1) Generate label value mask using PRG and the total path cost mask And the first predicted value secret share of the leaf node ,Right now . Because the same pseudo-random number generator seed is used , and the pseudo-random number generator call is consistent with P1, and the parameters generated in this step are exactly the same as those generated in step S251;

[0144] (2) Calculate the return value ;

[0145] (3) Return to P2;

[0146] S344: P2 sets the second prediction value secret share of the leaf node ;

[0147] S345: The second predicted value secret share of the leaf node As The return value of .

[0148] S36: P2 locally performs XOR on the first prediction value secret shares of all leaf nodes to obtain the second prediction result secret share , and Send to the result recipient. It should be noted that if there is a result recipient, it needs to be ensured to be the same as the result recipient in step S26.

[0149] In the specific implementation, step S21 and step S31 constitute a two-party Shared OT protocol based on a given feature vector and the eigenvector index According to the secret share of the two parties' XOR secret sharing, it is possible to securely calculate ,in and express Middle The number of 1s.

[0150] In the specific implementation, step S22 and step S32 constitute a two-party security comparison protocol. For a given scalar The secret share of the two-party XOR secret sharing can be securely calculated . It can be verified Note that in TEE, and This can, to a certain extent, prevent TEE channel attacks or problems where the TEE is not trustworthy enough.

[0151] In the specific implementation, step S24 and step S34 constitute a two-party AND gate protocol. For the given two scalars The secret share of the two-party XOR secret sharing can be securely calculated .

[0152] S4: The result receiver performs an XOR calculation on the first prediction result secret share and the second prediction result secret share to obtain a prediction result;

[0153] Specifically, the result receiver calculates the predicted result .

[0154] In the above scheme, for the convenience of representation, the corresponding values ​​of feature vectors and decision trees are all unsigned integers. However, the above scheme is not limited to unsigned integers, and is also applicable to other data types that can be converted to unsigned integers, including but not limited to: strings (which can be encoded as unsigned integers), signed integers (which can be converted to unsigned integers by adding a value), etc.

[0155] The Trusted Execution Environment (TEE) can be replaced by other security environments implemented by software or hardware, such as the Trusted Platform Module (TPM), Secure Execution Environment (SEE), etc. Its essence is a secure processing environment.

[0156] In summary, the technical solution of this application can be summarized as follows:

[0157] 1) A secure two-party decision tree prediction method based on a trusted execution environment is proposed, which can communicate in one direction and only requires one round of one-way communication, thereby reducing communication overhead and improving performance.

[0158] 2) A new two-party Shared OT protocol is proposed, which is the key to achieving inadvertent feature selection and effectively protecting model privacy.

[0159] 3) A new secure comparison protocol is proposed, which is the key to achieve secure comparison of eigenvalues ​​and gate restrictions and effectively protect the privacy of models and data.

[0160] 4) A new AND gate circuit is proposed, which is the key to hiding the prediction path and effectively protecting the model and data privacy.

[0161] Based on the three proposed protocols, this application uses a trusted execution environment to enable some secret information to be generated and calculated in a trusted execution environment without having to be obtained through complex communications, thereby reducing the communication complexity in decision tree security prediction and realizing a one-way communication decision tree security prediction method, thereby improving the efficiency of decision tree security prediction.

[0162] Corresponding to the aforementioned embodiment of the secure two-party financial risk prediction method based on a trusted execution environment, the present application also provides an embodiment of a secure two-party financial risk prediction device based on a trusted execution environment.

[0163] Figure 2 The following is a block diagram of a secure two-party financial risk prediction device based on a trusted execution environment according to an exemplary embodiment. Figure 2 , the device may include:

[0164] A receiving module 21, configured for the first participant and the second participant to respectively receive their own secret shares of feature vectors, secret shares of indexes of decision nodes in a full binary decision tree, secret shares of threshold values, and secret shares of labels of leaf nodes;

[0165] The first prediction result secret share acquisition module 22 is used for the first participant to inadvertently select the corresponding eigenvalue for each decision node according to the corresponding eigenvector secret share and index secret share, generate a first eigenvalue secret share, and achieve a secure comparison of the eigenvalue and the threshold through the first eigenvalue secret share and the corresponding threshold secret share, obtain a first comparison result secret share, set the path cost secret share for the left and right lines of the decision node based on the first comparison result secret share, calculate the total path cost secret share and the prediction value secret share of each leaf node, thereby obtaining the first prediction result secret share, and send corresponding information to the second participant;

[0166] The second prediction result secret share acquisition module 23 is used for the second participant to combine the information sent by the first participant, inadvertently select the corresponding eigenvalue according to the corresponding eigenvector secret share and index secret share, generate a second eigenvalue secret share, and achieve a secure comparison of the eigenvalue and the threshold through the second eigenvalue secret share and the threshold secret share, obtain the second comparison result secret share, set the path cost secret share for the left and right lines of the decision node based on the second comparison result secret share, calculate the total path cost secret share of each leaf node and the secret share of the prediction value, so as to obtain the second prediction result secret share;

[0167] The prediction result calculation module 24 is used for the result receiver to perform an XOR calculation on the first prediction result secret share and the second prediction result secret share to obtain a prediction result.

[0168] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0169] 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 units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0170] Accordingly, the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the above-mentioned secure two-party financial risk prediction method based on a trusted execution environment.

[0171] Accordingly, the present application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned secure two-party financial risk prediction method based on a trusted execution environment. Figure 3 As shown, a hardware structure diagram of a secure two-party financial risk prediction device based on a trusted execution environment provided by an embodiment of the present invention is provided in any device with data processing capability, except Figure 3 In addition to the processor, memory and network interface shown, any device with data processing capability in which the apparatus in the embodiment is located may also include other hardware, generally based on the actual functions of the device with data processing capability, which will not be described in detail.

[0172] Accordingly, the present application also provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the secure two-party financial risk prediction method based on a trusted execution environment as described above is implemented. The computer-readable storage medium can be an internal storage unit of any device with data processing capabilities described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium can also include both an internal storage unit of any device with data processing capabilities and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and can also be used to temporarily store data that has been output or is to be output.

[0173] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the contents disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0174] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.

Claims

1. A secure two-party financial risk prediction method based on a trusted execution environment, characterized in that: include: The first participant and the second participant respectively receive their own secret shares of feature vectors, secret shares of indexes of decision nodes in the full binary decision tree, secret shares of threshold values, and secret shares of labels of leaf nodes; The first participant, for each decision node, inadvertently selects the corresponding eigenvalue according to the corresponding eigenvector secret share and index secret share, generates a first eigenvalue secret share, and implements a secure comparison of the eigenvalue and the threshold through the first eigenvalue secret share and the corresponding threshold secret share, obtains a first comparison result secret share, sets path cost secret shares for the left and right lines of the decision node based on the first comparison result secret share, calculates the total path cost secret share and the prediction value secret share of each leaf node, thereby obtaining a first prediction result secret share, and sends corresponding information to the second participant; The second participant combines the information sent by the first participant, and inadvertently selects the corresponding eigenvalue according to the corresponding eigenvector secret share and index secret share, generates a second eigenvalue secret share, and implements a secure comparison of the eigenvalue and the threshold through the second eigenvalue secret share and the threshold secret share, obtains a second comparison result secret share, sets path cost secret shares for the left and right lines of the decision node based on the second comparison result secret share, calculates the total path cost secret share and the prediction value secret share of each leaf node, and thereby obtains a second prediction result secret share; The result receiver performs an XOR calculation on the first prediction result secret share and the second prediction result secret share to obtain a prediction result; Among them, for each decision node, according to the corresponding eigenvector secret share and index secret share, the corresponding eigenvalue is randomly selected to generate the first eigenvalue secret share, which is specifically: Generate a feature vector mask, an index mask, and a first feature value secret share of the inadvertently selected feature value by using a pseudo-random number generator, wherein the index mask is used to perform a mask operation on the first index secret share to obtain a first masked index secret share, and the feature vector mask is used to perform a mask operation on the first feature vector secret share to obtain a first masked feature vector secret share; The method of setting path cost secret shares for left and right lines of the decision node based on the first comparison result secret share, calculating the total path cost secret share and the prediction value secret share of each leaf node, and obtaining the first prediction result secret share includes: Assigning the first path cost secret share of the left line of the decision node to the first comparison result secret share, and assigning the first path cost secret share of the right line of the decision node to the logical negation of the first comparison result secret share; Based on the first path cost secret share of the left and right lines of each decision node, calculate the first total path cost secret share of each leaf node ,in represents the first total path cost secret share of all the paths from the root node to the leaf node, where , is the height of the decision tree; Based on the first total path cost secret share of each leaf node, calculate the corresponding first prediction value secret share; XOR the first prediction value secret shares of all leaf nodes to obtain the first prediction result secret share; The first prediction value secret share Depend on get, is the secret share of the first tag value, is the first total path cost secret share, The specific calculation process is: Generate a label value mask, a total path cost mask, and a first prediction result secret share using a pseudo-random number generator; Performing a mask operation on the first label value secret share based on the label value mask to obtain a first masked label value secret share; Performing a mask operation on the first total path cost mask and the first total path cost secret share based on the total path cost mask to obtain a first masked total path cost secret share; sending the first masked label value secret share and the first masked total path cost secret share to the second participant; Wherein, combining the information sent by the first participant, according to the corresponding eigenvector secret share and the index secret share, randomly selecting the corresponding eigenvalue, and generating the second eigenvalue secret share, includes: Performing an XOR operation on the second eigenvector secret share and the first masked eigenvector secret share to obtain a masked eigenvector; Performing an XOR operation on the second index secret share and the first mask index secret share to obtain a masked index; Using the trusted execution environment, the masked feature vector and index are calculated as follows to obtain the calculation results : Generate feature vector mask using pseudo-random number generator , Index Mask and the first eigenvalue secret share , where n is the feature vector dimension; the first prediction result secret share is set to the calculated result The initial value of right Update, where ; The calculation results Set to the second eigenvalue secret share The initial value of right Make updates; The method of setting path cost secret shares for left and right lines of the decision node based on the second comparison result secret share, calculating the total path cost secret share and the prediction value secret share of each leaf node, and obtaining the second prediction result secret share includes: Assign the second path cost secret shares of the left and right lines of the decision node to the second comparison result secret share; Based on the second path cost secret share of the left and right lines of each decision node, the second total path cost secret share of each leaf node is calculated ,in represents the second total path cost secret share of all the paths from the root node to the leaf node, ; Based on the second total path cost secret share of each leaf node, calculate the corresponding second prediction value secret share; XOR the second prediction value secret shares of all leaf nodes to obtain the second prediction result secret share; The second prediction value secret share Depend on get, is the second tag value secret share, is the second total path cost secret share, The specific calculation process is: Perform an XOR operation on the first masked label value secret share and the second label value secret share to obtain a masked label value; Perform an XOR operation on the first masked total path cost secret share and the second total path cost secret share to obtain the masked total path cost; Using the trusted execution environment, the masked label value and the total path cost Perform the following calculation: Generate a label value mask using a pseudo-random number generator , total path cost mask and The first secret share , calculate the return value ; Calculate the second prediction value secret share .

2. The method according to claim 1, characterized in that Through the first eigenvalue secret share and the corresponding threshold secret share, a secure comparison of the eigenvalue and the threshold is achieved to obtain a first comparison result secret share, which is specifically: A pseudo-random number generator is used to generate an eigenvalue mask, a threshold mask, and a first comparison result secret share, wherein the eigenvalue mask performs a mask operation on the first eigenvalue secret share to obtain a first masked eigenvalue secret share, and the threshold mask performs a mask operation on the first threshold secret share to obtain a first masked threshold secret share.

3. The method according to claim 1, characterized in that In combination with the information sent by the first participant, a secure comparison of the characteristic value and the threshold is achieved through the second characteristic value secret share and the threshold secret share, and a second comparison result secret share is obtained, including: Perform an XOR operation on the first masked eigenvalue secret share and the second eigenvalue secret share to obtain a masked eigenvalue; Perform an XOR operation on the first masked threshold secret share and the second threshold secret share to obtain a masked threshold; Using the trusted execution environment, the masked feature values ​​and thresholds are calculated as follows to obtain the calculation results: : Generate eigenvalue mask using pseudo-random number generator and threshold mask and the first comparison result secret share , for the masked eigenvalues and threshold Decompose and get the corresponding bit representation , is the bit length of the feature value; the feature value mask is generated using a pseudo-random number generator , threshold mask and the first comparison result secret share; decompose the eigenvalue mask and the threshold mask to obtain the corresponding bit representation ;calculate ,in is the secret share of the first comparison result, , , , , , , ; The calculation results Set to the second comparison result secret share.

4. A secure two-party financial risk prediction device based on a trusted execution environment, characterized in that: include: A receiving module, used for the first participant and the second participant to respectively receive their respective secret shares of feature vectors, secret shares of indexes of decision nodes in a full binary decision tree, secret shares of threshold values, and secret shares of labels of leaf nodes; A first prediction result secret share acquisition module is used for the first participant to inadvertently select a corresponding eigenvalue for each decision node according to the corresponding eigenvector secret share and index secret share, generate a first eigenvalue secret share, and implement a secure comparison of the eigenvalue and the threshold through the first eigenvalue secret share and the corresponding threshold secret share, obtain a first comparison result secret share, set a path cost secret share for the left and right lines of the decision node based on the first comparison result secret share, calculate the total path cost secret share and the prediction value secret share of each leaf node, thereby obtaining the first prediction result secret share, and send corresponding information to the second participant; A second prediction result secret share acquisition module is used for the second participant to combine the information sent by the first participant, inadvertently select the corresponding eigenvalue according to the corresponding eigenvector secret share and index secret share, generate a second eigenvalue secret share, and achieve a secure comparison of the eigenvalue and the threshold through the second eigenvalue secret share and the threshold secret share, obtain a second comparison result secret share, set the path cost secret share for the left and right lines of the decision node based on the second comparison result secret share, calculate the total path cost secret share of each leaf node and the secret share of the prediction value, so as to obtain the second prediction result secret share; A prediction result calculation module, used for the result receiver to perform an XOR calculation on the first prediction result secret share and the second prediction result secret share to obtain a prediction result; Among them, for each decision node, according to the corresponding eigenvector secret share and index secret share, the corresponding eigenvalue is randomly selected to generate the first eigenvalue secret share, which is specifically: Generate a feature vector mask, an index mask, and a first feature value secret share of the inadvertently selected feature value by using a pseudo-random number generator, wherein the index mask is used to perform a mask operation on the first index secret share to obtain a first masked index secret share, and the feature vector mask is used to perform a mask operation on the first feature vector secret share to obtain a first masked feature vector secret share; The method of setting path cost secret shares for left and right lines of the decision node based on the first comparison result secret share, calculating the total path cost secret share and the prediction value secret share of each leaf node, and obtaining the first prediction result secret share includes: Assigning the first path cost secret share of the left line of the decision node to the first comparison result secret share, and assigning the first path cost secret share of the right line of the decision node to the logical negation of the first comparison result secret share; Based on the first path cost secret share of the left and right lines of each decision node, calculate the first total path cost secret share of each leaf node ,in represents the first total path cost secret share of all the paths from the root node to the leaf node, where , is the height of the decision tree; Based on the first total path cost secret share of each leaf node, calculate the corresponding first prediction value secret share; XOR the first prediction value secret shares of all leaf nodes to obtain the first prediction result secret share; The first prediction value secret share Depend on get, is the secret share of the first tag value, is the first total path cost secret share, The specific calculation process is: Generate a label value mask, a total path cost mask, and a first prediction result secret share using a pseudo-random number generator; Performing a mask operation on the first label value secret share based on the label value mask to obtain a first masked label value secret share; Performing a mask operation on the first total path cost mask and the first total path cost secret share based on the total path cost mask to obtain a first masked total path cost secret share; sending the first masked label value secret share and the first masked total path cost secret share to the second participant; Wherein, combining the information sent by the first participant, according to the corresponding eigenvector secret share and the index secret share, randomly selecting the corresponding eigenvalue, and generating the second eigenvalue secret share, includes: Performing an XOR operation on the second eigenvector secret share and the first masked eigenvector secret share to obtain a masked eigenvector; Performing an XOR operation on the second index secret share and the first mask index secret share to obtain a masked index; Using the trusted execution environment, the masked feature vector and index are calculated as follows to obtain the calculation results : Generate feature vector mask using pseudo-random number generator , Index Mask and the first eigenvalue secret share , where n is the feature vector dimension; the first prediction result secret share is set to the calculated result The initial value of right Update, where ; The calculation results Set to the second eigenvalue secret share The initial value of right Make updates; The method of setting path cost secret shares for left and right lines of the decision node based on the second comparison result secret share, calculating the total path cost secret share and the prediction value secret share of each leaf node, and obtaining the second prediction result secret share includes: Assign the second path cost secret shares of the left and right lines of the decision node to the second comparison result secret share; Based on the second path cost secret share of the left and right lines of each decision node, the second total path cost secret share of each leaf node is calculated ,in represents the second total path cost secret share of all the paths from the root node to the leaf node, ; Based on the second total path cost secret share of each leaf node, calculate the corresponding second prediction value secret share; XOR the second prediction value secret shares of all leaf nodes to obtain the second prediction result secret share; The second prediction value secret share Depend on get, is the second tag value secret share, is the second total path cost secret share, The specific calculation process is: Perform an XOR operation on the first masked label value secret share and the second label value secret share to obtain a masked label value; Perform an XOR operation on the first masked total path cost secret share and the second total path cost secret share to obtain the masked total path cost; Using the trusted execution environment, the masked label value and the total path cost Perform the following calculation: Generate a label value mask using a pseudo-random number generator , total path cost mask and The first secret share , calculate the return value ; Calculate the second prediction value secret share .

5. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 3.

6. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Federal learning gradient boosting decision tree training method based on trusted execution environment

    CN114817946A

  • Threat detection method, device and system

    CN115168841A