Tree model processing method and device based on secure multi-party computing
By extending the leaf node dimension in the tree model to the maximum depth, a new tree model is built, which solves the problem of data insecure in secure multi-party computing, and realizes the privacy protection of the tree model.
Patent Information
- Application Number
- CN202210671540.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2042-06-14
AI Technical Summary
In secure multi-party computing, the asymmetry of the tree model leads to data insecure, and data on the tree model may be disclosed during the calculation process.
By obtaining the maximum depth of the tree model, if the dimension of the leaf node is smaller than the maximum depth, expand the dimension of the leaf node to the maximum depth, and build a new tree model for execution in secure multi-party computing.
By expanding the dimensions of leaf nodes, the tree model has the dimension corresponding to the maximum depth on all branches, thereby protecting the privacy of the tree model in secure multi-party computing and preventing data disclosure.
Smart Images

Figure CN115017544B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a tree model processing method and device based on secure multi-party computing. Background Art
[0002] The research on secure multi-party computing (MPC) is mainly aimed at the problem of how to securely calculate a contract function without a trusted third party. In layman's terms, secure multi-party computing mainly solves the problem of how multiple participants can successfully complete the calculation without revealing their inputs to each other. It is the cryptographic basis for many applications such as electronic elections, threshold signatures, and electronic auctions.
[0003] In the field of machine learning, tree models are widely used. Since tree models are asymmetric in most cases, if such non-synthetic tree models are used in secure multi-party computing, the data of the tree model will become insecure, and the data on the tree model may be leaked during calculations.
[0004] Based on this, how to ensure the privacy security of the tree model of secure multi-party computing has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] In order to solve the existing technical problems, the embodiments of the present invention provide a tree model processing method, apparatus, computer equipment and readable storage medium based on secure multi-party computing.
[0006] To achieve the above object, the technical solution of the embodiment of the present invention is implemented as follows:
[0007] An embodiment of the present invention provides a tree model processing method based on secure multi-party computing, the method comprising:
[0008] Get the maximum depth of the first tree model;
[0009] If the dimension of the leaf nodes of the first tree model includes a first leaf node that is smaller than the maximum depth, the dimension of the first leaf node is expanded to the dimension corresponding to the maximum depth to construct a second tree model;
[0010] Secure multi-party computation is performed using the second tree model.
[0011] Preferably, if the dimension of the leaf nodes of the first tree model includes a first leaf node that is smaller than the maximum depth, the dimension of the first leaf node is expanded to the dimension corresponding to the maximum depth to construct the second tree model, including:
[0012] If the dimension of the leaf nodes of the first tree model includes a first leaf node that is smaller than the maximum depth, constructing a first node array including the first leaf node as a first node element;
[0013] Inserting a predetermined number of second node elements before the first node element of the first node array, constructing a second node array so that the number of elements of the second node array is the maximum depth, wherein the predetermined number is the difference between the number of elements of the first node array and the maximum depth;
[0014] Converting the second node array into a third tree model;
[0015] The second tree model is constructed according to the third tree model.
[0016] Preferably, the second node element includes: a randomly generated or fixed feature selection vector and a threshold condition; wherein the feature selection vector is used to characterize the value of the second node element, and the threshold condition is used to characterize the branch direction of the content node under different threshold conditions.
[0017] Preferably, the second leaf node is of the same node type as the first leaf node.
[0018] Preferably, if the dimension of the leaf nodes of the first tree model includes a first leaf node that is smaller than the maximum depth, then extending the dimension of the first leaf node to the dimension corresponding to the maximum depth includes:
[0019] If the dimension of the leaf nodes of the first tree model includes a first leaf node whose dimension is smaller than the maximum depth, determine the current dimension of the first leaf node to determine the dimension difference N between the current dimension of the first leaf node and the maximum depth;
[0020] Based on the dimension difference N, 2 are inserted between the first leaf node and the first content node of the previous dimension of the first leaf node according to the first tree model. N -1 second content node and add 2 N -1 third leaf node, so that the dimensions of the first leaf node and the third leaf node are equal to the dimension corresponding to the maximum depth.
[0021] Preferably, obtaining the maximum depth of the first tree model includes:
[0022] The tree-based credit plug-in is used to detect the dimensions of each leaf node in the first tree model, so as to obtain the depth corresponding to the leaf node with the largest dimension as the maximum depth of the first tree model.
[0023] The embodiment of the present invention further provides a tree model processing device based on secure multi-party computing, the device comprising:
[0024] An acquisition module, used to acquire the maximum depth of the first tree model;
[0025] An expansion module, configured to expand the dimension of the first leaf node by a dimension corresponding to the maximum depth to construct a second tree model if the dimension of the leaf node of the first tree model includes a first leaf node smaller than the maximum depth;
[0026] An execution module is used to execute secure multi-party computation using the second tree model.
[0027] An embodiment of the present invention also provides a computing device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor is used to implement the tree model processing method based on secure multi-party computing as described above when running the computer program.
[0028] An embodiment of the present invention further provides a terminal storing an executable program, wherein when the executable program is executed by a processor, the tree model processing method based on secure multi-party computing as described above is implemented.
[0029] The tree model processing method based on secure multi-party computing provided in the above embodiment is executed by a computer device, by obtaining the maximum depth of the first tree model, if the dimension of the leaf node of the first tree model includes a first leaf node less than the maximum depth, then the dimension of the first leaf node is expanded to the dimension corresponding to the maximum depth to construct a second tree model; and the second tree model is used to perform secure multi-party computing. In this way, since this embodiment will expand the first leaf node containing a first leaf node less than the maximum depth, the first tree model is no longer just a multi-dimensional branch model, but a branch with a dimension corresponding to the maximum depth on any branch, so that the node content in each branch node cannot be easily predicted during the secure multi-party computing process of the second tree model constructed by this method, etc., the node privacy of each node in the first tree model is preserved, thereby ensuring the privacy security of the tree model of secure multi-party computing. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a structural schematic diagram of a tree model in the prior art described in the present invention;
[0031] Figure 2 A flowchart of a tree model processing method based on secure multi-party computing provided by one embodiment of the present invention;
[0032] Figure 3 A schematic diagram of the structure of a first tree model provided in one embodiment of the present invention;
[0033] Figure 4 A schematic diagram of the structure of a second tree model provided by an embodiment of the present invention;
[0034] Figure 5 Another flowchart of a tree model processing method based on secure multi-party computing provided by one embodiment of the present invention;
[0035] Figure 6 A schematic diagram of the prediction sequence of the MPC tree model provided by an embodiment of the present invention;
[0036] Figure 7 Another flowchart of a tree model processing method based on secure multi-party computing provided by an embodiment of the present invention;
[0037] Figure 8 Another functional structure diagram of a tree model processing device based on secure multi-party computing provided by one embodiment of the present invention;
[0038] Fig. 9 A schematic diagram of the hardware structure of a computer device provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0039] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0041] It should be noted that at present, the application prospects of secure multi-party computing (MPC) are becoming more and more extensive, and the demand for collaborative business between enterprises, governments, academic institutions and individuals is becoming increasingly strong. A typical scenario is: in the rapid development of artificial intelligence (AI), the demand for data privacy has become increasingly strong. The data required for AI training cannot be obtained in many business scenarios due to privacy compliance reasons, resulting in the inability to complete training or poor training results. Privacy AI is trying to use MPC to solve the problem of privacy protection in AI computing, that is, how to complete collaborative training and collaborative prediction without directly exposing plaintext data to the data parties involved in AI training. In this way, the prediction model based on secure multi-party computing needs to have strong privacy.
[0042] As we know, in machine learning, tree prediction is widely used in tree models such as decision trees, random forests, or distributed gradient boosting libraries. Under the MPC privacy protection setting, the only information that a single tree model can expose in plain text is the depth of the tree. The problem that the prediction graph based on the MPC tree model needs to solve is how to make secure predictions on the ciphertext tree model while only exposing the depth of the tree.
[0043] See also Figure 1 , Figure 1 Schematic diagram of the structure of the tree model in the prior art described in the present invention, such as Figure 1 As shown in the figure, in the medical field, the diagnosis model is mostly represented by the user's tree model. Figure 1 It can be seen that this tree model is often not a full binary tree. In the prediction process, the possible content of each node can often be roughly predicted through the different depths of the tree model. For example, Figure 1 In the case of bone metastasis, if it is, then it is determined whether there is any other reason. If it is, there is only one result, which is easy to test out, thus destroying the privacy of the nodes of the tree model, and thus failing to protect the node information of the tree model, and ultimately leading to violations of relevant privacy compliance. Therefore, if this tree model is directly used for secure multi-party computing, it is obviously not conducive to the privacy protection of the tree model. Based on this, it is necessary to improve the privacy protection of the tree model in the application of secure multi-party computing.
[0044] Exemplarily, the technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments of the specification.
[0045] This embodiment provides a tree model processing method based on secure multi-party computing, which is executed by a server. Figure 2 A flowchart of a tree model processing method based on secure multi-party computing provided by an embodiment of the present invention is shown as follows: Figure 2 As shown, the method comprises the following steps:
[0046] Step 201: Obtain the maximum depth of the first tree model;
[0047] Step 202: If the dimension of the leaf nodes of the first tree model includes a first leaf node whose dimension is smaller than the maximum depth, the dimension of the first leaf node is expanded to the dimension corresponding to the maximum depth to construct a second tree model;
[0048] Step 203: Utilize the second tree model to perform secure multi-party computation.
[0049] The computer device here includes any computer device with data processing capability; specifically, the computer device can be a fixed terminal or a mobile terminal. The fixed terminal here can be a desktop or an all-in-one computer; the mobile terminal can be a mobile phone, a tablet computer or a wearable terminal, etc.
[0050] Here, the maximum depth of the first tree model may be obtained from model parameters of the first tree model pre-stored in the computer device.
[0051] In some embodiments, obtaining the maximum depth of the first tree model includes:
[0052] The tree dimension plug-in is used to detect the dimension of each leaf node in the first tree model to obtain the depth corresponding to the leaf node with the largest dimension as the maximum depth of the first tree model.
[0053] It can be understood that a leaf node is a concept in discrete mathematics. A tree without child nodes, that is, a node with a dimension of 0 is called a leaf node, also known as a terminal node.
[0054] See also Figure 3 , Figure 3 A schematic diagram of the structure of a first tree model provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the nodes n4, n5 and n3 are leaf nodes.
[0055] The tree dimension plug-in here may be a computer program stored in a computer device. In some embodiments, in response to the activation of the tree dimension plug-in, the tree dimension plug-in is run. In the following, taking the tree model as a binary tree as an example, the execution of the tree dimension plug-in includes:
[0056] First, declare a [TreeHeight] function and pass a [root] tree to it;
[0057] Then, we define the left and right subtrees, named [LCHeight] and [RCHeight];
[0058] At this point, we traverse the tree to see if it is empty, and if so, we exit the function directly.
[0059] At this time, LCHeight = TreeHeight (root->LC); and RCHeight = Tree Height (root->RC) are used for left and right recursive calls;
[0060] Next, accumulation is performed through a recursive accumulation function, so as to obtain the dimensions of each leaf node in the first tree model; thereby obtaining the maximum depth of the entire first tree model.
[0061] Of course, other methods may also be used to obtain the maximum depth of the first tree model, and no limitation is made here.
[0062] It should be noted that the second tree model here is based on the first tree model to complete the depth of leaf nodes. Please refer to Figure 4 , Figure 4 A schematic diagram of the structure of a second tree model provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, node A is a supplementary node of leaf node n3. Because of the addition of node A, the dimension of node n3 is expanded to the dimension corresponding to the maximum depth. In other words, the depth corresponding to the dimension of each leaf node of the second tree model here is the maximum depth. In this way, since the branches of node n1 are no longer only nodes n2 and n3, but node n3 is effectively protected by the addition of node A, the probability of being tried out has been reduced, thereby effectively protecting the node information of the first tree model. Therefore, the second tree model is used to perform secure multi-computing, which can effectively improve the privacy protection of the tree model in the application of secure multi-party computing. In addition, in this embodiment, by completing the first tree model, those incomplete binary trees can be safely predicted by the tree model.
[0063] In some embodiments, see Figure 5 , Figure 5 Another flowchart of a processing method of a tree model based on secure multi-party computing provided by an embodiment of the present invention is as follows: Figure 5 As shown, the step 202, i.e., if the dimension of the leaf nodes of the first tree model includes a first leaf node smaller than the maximum depth, then the dimension of the first leaf node is expanded to the dimension corresponding to the maximum depth to construct the second tree model, includes:
[0064] Step 2021: If the dimension of the leaf nodes of the first tree model includes a first leaf node whose depth is less than the maximum depth, construct a first node array including the first leaf node as the first node element;
[0065] Step 2023: inserting a predetermined number of second node elements before the first node element of the first node array to construct a second node array, so that the number of elements of the second node array is the maximum depth, wherein the predetermined number is the difference between the number of elements of the first node array and the maximum depth;
[0066] Step 2025: converting the second node array into a third tree model;
[0067] Step 2027: construct the second tree model based on the third tree model.
[0068] In this embodiment, the leaf node dimensions of the first tree model including the first leaf node which is smaller than the maximum depth are firstly arrayed, and then the first leaf node is used as the first node element of the first node array, and a new second node element is added before the first node element, so that the elements of the new node array have the same dimension values corresponding to the maximum depth, so that the new second node array can be used to construct a new tree model, and further the dimensions of all leaf nodes of the newly constructed third tree model are the dimensions corresponding to the maximum depth.
[0069] It should be added that the third tree model here can be the second tree model, or a tree model further completed on the basis of the second tree model. In short, the dimensions of the first leaf nodes in the third model are the same and cannot be easily detected.
[0070] By completing the first tree model in the above manner, the node information of the first tree model can be effectively protected, so that secure multi-computing can be performed using the second tree model, which can effectively improve the privacy protection of the tree model in the application of secure multi-party computing.
[0071] In order to further ensure the privacy of node information of each node in the first tree model, in some other embodiments, step 2027, i.e., constructing the second tree model according to the third tree model, includes:
[0072] In response to the fact that the content node in the third tree model has no branches, the branches are completed until the dimension of the second leaf node of the branch is equal to the dimension corresponding to the maximum depth, so as to construct the second tree model.
[0073] The content node here can be understood as the parent node of the leaf node, or the parent node of the parent node of the leaf node, etc. In other words, any node that is not a leaf node.
[0074] For example, please refer to Figure 4 , Figure 4 In the third model, node B is a supplement to the further branch of node A, thereby obtaining a leaf node B with the same dimension as node n3, which is conducive to further protecting the privacy of node n3.
[0075] In this way, by further completing the third tree model, any leaf node in the final second tree model is branched from the content node, thereby effectively protecting the privacy security of the node information of the first leaf node and providing favorable protection for performing secure multi-party computing based on the second tree model.
[0076] Exemplarily, the second node element includes: a randomly generated or fixed feature selection vector and a threshold condition; wherein the feature selection vector is used to characterize the value of the second node element, and the threshold condition is used to characterize the branch direction of the content node under different threshold conditions.
[0077] It should be noted that in the prediction of the tree model under MPC, when both the tree model and the data are ciphertext, the data trace is predicted without exposing the path of the data prediction process.
[0078] For example, the following data and tree model are given:
[0079] data:
[0080] Tree model: Tree = (InnerNodes, LeafNodes)
[0081]
[0082]
[0083] It should be noted that the tree model can be expressed as the sum of internal nodes and leaf nodes. The internal nodes can be represented by a vector innerNode, and each element of the vector contains two parts: (S i , T i ). Where S i The feature selection vector representing this node is a one-hot vector whose length is the same as the data x. i Indicates the threshold of this node. Data x and feature selection vector S i By doing the inner product, we can get a scalar, and then add this scalar and the threshold T i By comparison, the next step can be decided. i If the result is not found, it will go to the left child of the current node. Otherwise, it will go to the right child of the current node. Repeat the above process until it reaches a leaf node. Leaf nodes can also be represented by a vector LeafNodes. The predicted value (classification result) of each leaf node is represented by an element in the vector.
[0084] Both the data and the tree model are presented in ciphertext form.
[0085] When predicting, the MPC tree model will make predictions based on the prediction principle of layer by layer. For example, please refer to Figure 6 , Figure 6 A schematic diagram of the prediction sequence of the tree model under MPC provided by an embodiment of the present invention is shown in FIG. Figure 6As shown, predictions are made layer by layer, and each prediction executes all nodes in each layer. This is done to avoid leaking any information.
[0086] Here, the second node element is the randomly generated or fixed missing content node, for example, Figure 4 Node n3 in , or for example Figure 6 The node c3 in , i.e., the feature selection vector and the threshold condition, helps to hide the first leaf node in the first tree model under the branch. Thus, the privacy security of the node information of the first leaf node in the first tree model is protected.
[0087] In some other embodiments, the second leaf node is of the same node type as the first leaf node, for example Figure 4 In the example, the node type of the supplemented leaf node B is the same as the node type of the node n3. In this way, the privacy security of the node information of the first leaf node can be further protected.
[0088] In some other embodiments, please refer to Figure 7 , Figure 7 Another flowchart of a tree model processing method based on secure multi-party computing provided by an embodiment of the present invention is as follows: Figure 7 As shown, step 202, i.e., if the dimension of the leaf nodes of the first tree row includes a first leaf node smaller than the maximum depth, then the dimension of the first leaf node is expanded to the dimension corresponding to the maximum depth, including:
[0089] Step 2022: If the dimension of the leaf nodes of the first tree model includes a first leaf node that is smaller than the maximum depth, determine the current dimension of the first leaf node to determine the difference N between the current dimension of the first leaf node and the dimension before the maximum depth;
[0090] Step 2024: Based on the dimension difference N, insert 2 between the first leaf node and the first content node of the previous dimension of the first leaf node according to the first tree model. N -1 second content node and add 2 N -1 third leaf node, so that the dimensions of the first leaf node and the third leaf node are equal to the dimension corresponding to the maximum depth.
[0091] In this way, by completing the first tree model as described above, the node information of the first tree model can be effectively protected, so that secure multi-computing can be performed using the second tree model, which can effectively improve the privacy protection of the tree model in secure multi-party computing applications.
[0092] It should be supplemented that the above embodiments may be implemented independently or in any combination, and no limitation is made herein.
[0093] like Figure 8 As shown, an embodiment of the present invention further provides a tree model processing device based on secure multi-party computing, which is executed by a computer, and the device includes:
[0094] An acquisition module 81 is used to acquire the maximum depth of the first tree model;
[0095] An expansion module 82 is configured to expand the dimension of the first leaf node to the dimension corresponding to the maximum depth to construct a second tree model if the dimension of the leaf node of the first tree model includes a first leaf node smaller than the maximum depth;
[0096] Execution module 83: used to execute secure multi-party computation using the second tree model.
[0097] In some embodiments, the expansion module 82 is further used to:
[0098] If the dimension of the leaf nodes of the first tree model includes a first leaf node that is smaller than the maximum depth, constructing a first node array including the first leaf node as a first node element;
[0099] Inserting a predetermined number of second node elements before the first node element of the first node array, constructing a second node array so that the number of elements of the second node array is the maximum depth, wherein the predetermined number is the difference between the number of elements of the first node array and the maximum depth;
[0100] Convert the second node array into a third tree model;
[0101] The second tree model is constructed according to the third tree model.
[0102] In some embodiments, the expansion module 82 is further used to:
[0103] In response to the fact that the content node in the third tree model has no branches, the branches are completed until the dimension of the second leaf node of the branch is equal to the dimension corresponding to the maximum depth, so as to construct the second tree model.
[0104] In some embodiments, the second node element includes: a randomly generated or fixed feature selection vector and a threshold condition; wherein the feature selection vector is used to characterize the value of the second node element, and the threshold condition is used to characterize the branch direction of the content node under different threshold conditions.
[0105] In some embodiments, the second leaf node is of the same node type as the first leaf node.
[0106] In some embodiments, the expansion module 82 is further used to:
[0107] If the dimension of the leaf nodes of the first tree model includes a first leaf node whose dimension is smaller than the maximum depth, determine the current dimension of the first leaf node to determine the dimension difference N between the current dimension of the first leaf node and the maximum depth;
[0108] Based on the dimension difference N, 2 are inserted between the first leaf node and the first content node of the previous dimension of the first leaf node according to the first tree model. N -1 second content node and add 2 N -1 third leaf node, so that the dimensions of the first leaf node and the third leaf node are equal to the dimension corresponding to the maximum depth.
[0109] In some embodiments, the acquisition module 81 is further used to:
[0110] The tree dimension plug-in is used to detect the dimension of each leaf node in the first tree model to obtain the maximum depth corresponding to the leaf node with the largest dimension, which is the maximum depth of the first tree model.
[0111] It should be pointed out here that the description of the above tree model processing device based on secure multi-party computing is similar to the description of the above tree model processing method based on secure multi-party computing, and the description of the beneficial effects of the same method is not repeated. For technical details not disclosed in the embodiment of the tree model processing device based on secure multi-party computing of the present invention, please refer to the description of the embodiment of the tree model processing method based on secure multi-party computing of the present invention.
[0112] like Fig. 9 As shown, an embodiment of the present invention further provides a computer device, which includes a memory 92, a processor 91, and computer instructions stored in the memory 92 and executable on the processor 91; when the processor 51 executes the instructions, the steps of the tree model processing method based on secure multi-party computing applied to the server or the terminal are implemented.
[0113] In some embodiments, the memory 92 in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The memory 92 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0114] The processor 91 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 91 or the instructions in the form of software. The above processor 91 may be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor may be a microprocessor or the processor may also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 92, and the processor 91 reads the information in the memory 92 and completes the steps of the above method in combination with its hardware.
[0115] In some embodiments, the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSP devices, DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or a combination thereof.
[0116] For software implementation, the techniques described herein can be implemented by modules (e.g., procedures, functions, etc.) that perform the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0117] Another embodiment of the present invention provides a computer storage medium, the computer readable storage medium stores an executable program, and when the executable program is executed by the processor 91, the following can be achieved: Figures 2 to 7 The steps of the tree model processing method based on secure multi-party computing.
[0118] In some embodiments, the computer storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0119] It should be noted that the technical solutions described in the embodiments of the present invention can be combined arbitrarily without conflict.
[0120] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A tree model processing method based on secure multi-party computing, characterized in that: The method comprises: Get the maximum depth of the first tree model; If the dimension of the leaf nodes of the first tree model includes a first leaf node that is smaller than the maximum depth, the dimension of the first leaf node is extended to the dimension corresponding to the maximum depth to construct a second tree model; Performing secure multi-party computation using the second tree model; If the dimension of the leaf nodes of the first tree model includes a first leaf node that is smaller than the maximum depth, the dimension of the first leaf node is extended to the dimension corresponding to the maximum depth to construct a second tree model, including: If the dimension of the leaf nodes of the first tree model includes a first leaf node that is smaller than the maximum depth, constructing a first node array including the first leaf node as a first node element; Inserting a predetermined number of second node elements before the first node element of the first node array, constructing a second node array so that the number of elements of the second node array is the maximum depth, wherein the predetermined number is the difference between the number of elements of the first node array and the maximum depth; Converting the second node array into a third tree model; The second tree model is constructed according to the third tree model.
2. The method according to claim 1, characterized in that The step of constructing the second tree model according to the third tree model includes: In response to the content node in the third tree model having no branches, the branches are completed until the dimension of the second leaf node of the branch is equal to the dimension corresponding to the maximum depth, so as to construct the second tree model.
3. The method according to claim 2, characterized in that The second node element includes: a randomly generated or fixed feature selection vector and a threshold condition; wherein the feature selection vector is used to characterize the value of the second node element, and the threshold condition is used to characterize the branch direction of the content node under different threshold conditions.
4. The method according to claim 2, characterized in that: The second leaf node is of the same node type as the first leaf node.
5. The method according to claim 1, characterized in that If the dimension of the leaf nodes of the first tree model includes a first leaf node that is smaller than the maximum depth, extending the dimension of the first leaf node to the dimension corresponding to the maximum depth includes: If the dimension of the leaf nodes of the first tree model includes a first leaf node whose dimension is smaller than the maximum depth, determine the current dimension of the first leaf node to determine the dimension difference N between the current dimension of the first leaf node and the maximum depth; Based on the dimension difference N, 2 are inserted between the first leaf node and the first content node of the previous dimension of the first leaf node according to the first tree model. N -1 second content node and add 2 N -1 third leaf node, so that the dimensions of the first leaf node and the third leaf node are equal to the dimension corresponding to the maximum depth.
6. The method according to claim 1, characterized in that The obtaining the maximum depth of the first tree model includes: The tree dimension plug-in is used to detect the dimension of each leaf node in the first tree model to obtain the depth corresponding to the leaf node with the largest dimension as the maximum depth of the first tree model.
7. A tree model processing device based on secure multi-party computing, characterized in that: The device comprises: An acquisition module, used for acquiring the maximum depth of the first tree model; An expansion module, for expanding the dimension of the leaf node of the first tree model to the dimension corresponding to the maximum depth to construct a second tree model if the dimension of the leaf node includes a first leaf node less than the maximum depth; if the dimension of the leaf node of the first tree model includes a first leaf node less than the maximum depth, expanding the dimension of the first leaf node to the dimension corresponding to the maximum depth to construct a second tree model, comprising: if the dimension of the leaf node of the first tree model includes a first leaf node less than the maximum depth, constructing a first node array including the first leaf node as the first node element; inserting a predetermined number of second node elements before the first node element of the first node array to construct a second node array so that the number of elements of the second node array is the maximum depth, wherein the predetermined number is the difference between the number of elements of the first node array and the maximum depth; converting the second node array into a third tree model; constructing the second tree model according to the third tree model; An execution module is used to execute secure multi-party computation using the second tree model.
8. A computer device, characterized in that: include: A processor and a memory for storing a computer program that can be run on the processor, wherein the processor, when running the computer program, implements the tree model processing method based on secure multi-party computing as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: include: When the executable program is executed by a processor, the tree model processing method based on secure multi-party computing as described in any one of claims 1 to 6 is implemented.