A data processing method, device and system for machine learning model
By using inadvertent transmission protocol or homomorphic encryption algorithm in data interaction of machine learning models, and calling functions that implement comparison functions at each layer of the tree model, the problems of data interaction security and privacy are solved, and data transmission is realized security and privacy.
Patent Information
- Application Number
- CN201980091130.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-02-03
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2039-02-03
AI Technical Summary
When using machine learning models, how to ensure the security and privacy of data interactions, especially when the data holder and model holder are different users, how to prevent the leakage of sensitive information.
By using an inadvertent transmission protocol or homomorphic encryption algorithm, the data of the data holder is sent to the model holder, and the function that implements the comparison function is called at each layer of the tree model, ignoring the path selection of the data in the tree model. This ensures that only information outside the model output results is disclosed between the model holder and the data holder.
Ensure the security and privacy of data interaction of machine learning models, prevent the leakage of sensitive information, and realize the privacy of data transmission.
Smart Images

Figure CN113711247B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more particularly to a method, device and system for processing data of a machine learning model. Background Art
[0002] With the development of computer technology, machine learning models are increasingly used, and can be used for risk prediction and assessment. When using machine learning models, data needs to be collected, and the collected data is used for model training or model use. Usually, the data holder and the model holder may be different users. The data set owned by the data holder may contain sensitive information that cannot be made public and cannot be used by the model holder. The model holder cannot directly use the model parameters for the data holder. How to ensure the security and privacy of data interaction during machine model training and model use is a technical problem that urgently needs to be solved in this field. Summary of the invention
[0003] The purpose of this specification is to provide a data processing method, device and system for a machine learning model to achieve the security and privacy of machine learning model data interaction.
[0004] On the one hand, an embodiment of this specification provides a data processing method of a machine learning model, including:
[0005] Obtain data information of the second terminal using an oblivious transfer protocol or a homomorphic encryption algorithm;
[0006] Input the data information into a tree model, call a function implementing a comparison function at each layer of the tree model, and obtain a hash value corresponding to each node of the tree model according to the data information, wherein the function implementing the comparison function is used to generate two hash vectors based on the input data, and the hash vectors are used for hash calculation;
[0007] Generate node attribute value encryption information based on the hash value corresponding to the leaf node of the tree model, and send the node attribute value encryption information to the second terminal, so that the second terminal generates a second prediction value share corresponding to the second terminal based on the node attribute value encryption information.
[0008] On the other hand, this specification provides a data processing method of a machine learning model, comprising:
[0009] Using an oblivious transfer protocol or a homomorphic encryption algorithm, the data information is sent to a first terminal, so that a tree model in the first terminal calls a function implementing a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, wherein the function implementing the comparison function is used to generate two hash vectors based on the input data, and the hash vectors are used for hash calculation;
[0010] Receive node attribute value encryption information generated by the first terminal according to the hash value corresponding to the leaf node of the tree model;
[0011] The node attribute value encrypted information is decrypted to obtain a second predicted value share.
[0012] In another aspect, the present specification provides a data processing device for a machine learning model, comprising:
[0013] A first data transmission module, used to obtain data information of the second terminal by using an oblivious transfer protocol or a homomorphic encryption algorithm;
[0014] A first model calculation module is used to input the data information into a tree model, each layer of the tree model calls a function that implements a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, wherein the function that implements the comparison function is used to generate two hash vectors based on the input data, and the hash vectors are used for hash calculation;
[0015] The first prediction module is used to generate node attribute value encryption information according to the hash value corresponding to the leaf node of the tree model, and send the node attribute value encryption information to the second terminal, so that the second terminal generates a second prediction value share corresponding to the second terminal according to the node attribute value encryption information.
[0016] On the other hand, the present specification provides a data processing device for a machine learning model, comprising: at least one processor and a memory for storing processor executable instructions, wherein when the processor executes the instructions, the method corresponding to the first terminal in the embodiment of the present specification is implemented.
[0017] In another aspect, the present specification provides a data processing device for a machine learning model, comprising:
[0018] a second data transmission module, configured to send data information to a first terminal by using an oblivious transfer protocol or a homomorphic encryption algorithm, so that a tree model in the first terminal calls a function implementing a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, wherein the function implementing the comparison function is used to generate two hash vectors based on input data, and the hash vectors are used for hash calculation;
[0019] A data receiving module, used to receive node attribute value encrypted information generated by the first terminal according to the hash value corresponding to the leaf node of the tree model;
[0020] The second prediction module is used to decrypt the node attribute value encrypted information to obtain a second prediction value share.
[0021] On the other hand, the present specification provides an application navigation processing device, including: at least one processor and a memory for storing processor executable instructions, and when the processor executes the instructions, the method corresponding to the second terminal in the embodiment of the present specification is implemented.
[0022] On the other hand, the present specification provides a data processing system for a machine learning model, including: a model client, a data client, a data transmission module, and a comparison function module, wherein the model client includes one or more tree models, the data client includes data information, and the data transmission module includes an oblivious transfer protocol or a homomorphic encryption algorithm;
[0023] The model client and the data client transmit data by calling the data transmission module. The model client and the data client call the comparison function module to process data on each layer of the tree model in the model client. The model client is used to execute the method corresponding to the first terminal in the embodiment of this specification, and the data client is used to execute the method corresponding to the second terminal in the embodiment of this specification.
[0024] The data processing method, apparatus, processing device, and system of the machine learning model provided in this specification can use the oblivious transfer protocol or homomorphic encryption algorithm to send the data of the data holder to the model holder, and call the function that implements the comparison function at each layer of the tree model, ignoring the path selection of the data in the tree model. The oblivious transfer protocol or homomorphic encryption algorithm is combined with the function that implements the comparison function to ensure that the model holder and the data holder do not disclose any other information to each other except the model output results, thereby ensuring the security and privacy of data interaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0026] Figure 1is a flowchart of a data processing method of a machine learning model in one embodiment of this specification;
[0027] Figure 2 is a flowchart of a data processing method of a machine learning model in another embodiment of the present specification;
[0028] Figure 3 It is a schematic diagram of the module structure of an embodiment of a data processing device for a machine learning model provided in this specification;
[0029] Figure 4 It is a schematic diagram of the module structure of another embodiment of the data processing device of the machine learning model provided in this specification;
[0030] Figure 5 is a schematic diagram of the structure of a data processing device for a machine learning model in another embodiment of the present specification;
[0031] Figure 6 is a schematic diagram of the structure of a data processing system for a machine learning model in one embodiment of this specification;
[0032] Figure 7 It is a hardware structure block diagram of the data processing server of the machine learning model in the embodiment of this specification. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0034] With the continuous development of computer and Internet technology, there are more and more application scenarios for data training and processing using machine learning models. Machine learning models can generally be divided into supervised machine learning models and unsupervised machine learning models. Machine learning models can be used to predict risks such as disease prediction, fraud prediction, etc. The machine learning models in the embodiments of this specification can mainly include tree models such as decision tree models, random forest tree models, gradient enhanced decision tree models, etc. The tree model can be understood as a tree-based learning algorithm, and its structure is similar to that of a tree, with many nodes. Each node of the tree model can include the following 5 attributes: leaf, threshold, attribute, value, rotate, where leaf can indicate whether the current node is a leaf node, threshold can indicate the threshold of the current node, attribute can indicate the attribute of the current node, value can indicate the attribute value of the attribute of the current node, and rotate can indicate whether the two child nodes of the current node are swapped.
[0035] During the training and use of the model, data collection is usually required, and the data holder and the model holder are often different users, and both parties do not want the other party to obtain their sensitive data or model parameters. In the embodiments of this specification, a data processing method for a machine learning model is provided, which can use an oblivious transfer protocol or a homomorphic encryption algorithm to send the data of the data holder to the model holder to ensure the privacy of data transmission. In addition, a function that implements the comparison function is called at each layer of the tree model, ignoring the path selection of the data in the tree model, ensuring that the model holder and the data holder do not disclose any other information to each other except the model output results, thereby ensuring the security and privacy of data interaction.
[0036] The data processing method of the machine learning model in this specification can be applied in the client or server. The client can be an electronic device such as a smart phone, a tablet computer, a smart wearable device (smart watch, virtual reality glasses, virtual reality helmets, etc.), a smart car device, etc.
[0037] The first terminal in the embodiments of this specification may represent a client or server that owns a model, and the second terminal may represent a client or server that owns data.
[0038] Specifically, Figure 1 is a flow chart of a data processing method of a machine learning model in one embodiment of this specification, such as Figure 1 As shown, the data processing method of the machine learning model provided in one embodiment of this specification can represent the data processing process of the model holder, which can specifically include:
[0039] Step 102: Oblivious transfer protocol or homomorphic encryption algorithm is used to obtain data information of the second terminal.
[0040] The oblivious transfer protocol can represent a privacy-protecting two-party communication protocol that enables the two parties to transmit messages in a selectively ambiguous manner, so that the service receiver can obtain certain messages input by the service sender in an inadvertent manner, thereby protecting the privacy of the receiver from being known by the sender. In some embodiments of this specification, an oblivious transfer protocol module can be defined, and the oblivious transfer protocol module can achieve the following functions through cryptographic technology:
[0041] Receive and save the data information x=(x[1],…x[n]) sent by terminal 1;
[0042] When receiving the information (transmission, i) sent by terminal 2, c=x[i] is returned to terminal 2, and terminal 1 and terminal 2 cannot obtain any other information.
[0043] It can be seen that terminal 1 is the party that owns the data. By using the oblivious transfer protocol, terminal 2 can obtain the specified data information of terminal 1, and terminal 2 does not know other data information in terminal 1.
[0044] Homomorphic encryption is a cryptographic technique based on computational complexity theory of mathematical problems. The data that has been homomorphically encrypted is processed to obtain an output. When this output is decrypted, the result is the same as the output obtained by processing the original unencrypted data in the same way. Homomorphic encryption algorithms can protect privacy from the influence of the data processor. It is impossible to view the personal details being processed, only the final result of the processing can be seen.
[0045] In the embodiments of this specification, the data holder and the model holder can transmit data through an oblivious transfer protocol or a homomorphic encryption algorithm, so that the model holder can obtain the data information of the data holder and can ensure that other data information is not obtained, thereby ensuring the privacy of data transmission.
[0046] Step 104: input the data information into a tree model, each layer of the tree model calls a function that implements a comparison function, and obtains a hash value corresponding to each node of the tree model based on the data information, wherein the function that implements the comparison function is used to generate two hash vectors based on the input data, and the hash vectors are used for hash calculation.
[0047] In the specific implementation process, a function that can realize the comparison function can be pre-defined in some embodiments of this specification. The function that realizes the comparison function can be understood as a component that can realize a certain function and can be designed based on a cryptographic algorithm. The function that realizes the comparison function in the embodiments of this specification can realize: based on the data input by the model holder and the data holder, two hash vectors are generated and returned to the model holder and the data holder respectively. The model holder and the data holder can use the received data to perform hash calculations to complete the processing of the data in the tree model.
[0048] In some embodiments of this specification, after the model holder obtains the data of the data holder, the obtained data information can be input into the tree model. When the tree model processes the input data information, it can call the function that implements the comparison function in the data processing process of each layer of the tree model, and calculate the hash value corresponding to each node of the tree model according to the hash vector returned by the function that implements the comparison function. The calculated data of the previous layer can be used to calculate the hash value of the node of the next layer until the last layer of the tree model is calculated.
[0049] It can be seen that when the tree model in the embodiment of this specification processes the input data, it can process the data for each node of the tree model by calling a pre-defined function that can realize the comparison function at each layer of the tree model. There is no need to compare the input data with each node, and the selection of the data path in the tree model is ignored, thereby ensuring the privacy of the tree model parameters and data transmission.
[0050] Step 106: Generate node attribute value encryption information according to the hash value corresponding to the leaf node of the tree model, and send the node attribute value encryption information to the second terminal, so that the second terminal generates a second prediction value share corresponding to the second terminal according to the node attribute value encryption information.
[0051] In the specific implementation process, when each layer of the tree model is calculated, the hash value of each node of the tree model can be obtained, and the node attribute value encryption information can be generated according to the hash value corresponding to the last layer of the tree model, that is, the leaf node. The node attribute value encryption information is sent to the data holder, that is, the second terminal, and the second terminal can obtain the second prediction value share by decryption.
[0052] On the basis of the above embodiments, in some embodiments of this specification, generating node attribute value encryption information according to the hash value corresponding to the leaf node of the tree model may include:
[0053] Randomly generate a first prediction value share, and obtain the attribute value of the leaf node of the tree model;
[0054] Calculating XOR information of the attribute value of the leaf node and the first predicted value share;
[0055] The XOR information of the corresponding leaf node is encrypted using the hash value corresponding to the leaf node to obtain the node attribute value encrypted information.
[0056] In the specific implementation process, after each layer of the tree model is calculated, the first prediction value share can be randomly generated, and the attribute value of the leaf node of the tree model is obtained, and the attribute value of the leaf node is XORed with the first prediction value share to obtain the XOR information corresponding to the leaf node. The XOR information of the corresponding leaf node is encrypted using the hash value corresponding to the leaf node to obtain the node attribute value encryption information corresponding to the leaf node.
[0057] Among them, a leaf node can represent a node without child nodes in the tree model.
[0058] In the embodiments of this specification, a data processing method for a machine learning model is provided, which can use an oblivious transfer protocol or a homomorphic encryption algorithm to send the data of the data holder to the model holder, and call a function that implements the comparison function at each layer of the tree model, ignoring the path selection of the data in the tree model. The oblivious transfer protocol or the homomorphic encryption algorithm is combined with the function that implements the comparison function to ensure that the model holder and the data holder do not disclose any other information to each other except the output results of the model, thereby ensuring the security and privacy of data interaction.
[0059] Based on the above embodiments, in one embodiment of the present specification, each layer of the tree model calls a function that implements a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, including:
[0060] Generate first comparison data according to the data information, and call the function implementing the comparison function according to the second comparison data generated by the second terminal to obtain a first hash vector;
[0061] Generate a hash value of a node of the tree model according to the first hash vector, and use the hash value of the node to encrypt attribute information of the corresponding node to obtain node encryption information of each node;
[0062] Sending the node encryption information to the second terminal, so that the second terminal decrypts the node encryption information according to the second hash vector returned by the function implementing the comparison function to obtain the media data;
[0063] The first comparison data is regenerated according to the media data, and the second comparison data updated by the second terminal, and calculation of the next layer of the tree model is performed until the last layer of the tree model.
[0064] In the specific implementation process, the embodiments of this specification may pre-define a function that can realize the comparison function. The function that realizes the comparison function can be understood as a component that can realize a certain function and can be designed based on a cryptographic algorithm. In some embodiments of this specification, two functions F that can realize the comparison function can be provided. cmp , F cmp , The following methods can be used to define and implement the corresponding functions:
[0065] F cmp Definition:
[0066] Comparison data 1 sent by receiving terminal 1: (t A , x A , r A ), and the comparison data 2 sent by terminal 2: (t B , x B , r B );
[0067] calculate And randomly generate a vector (L 0 ,L 1 ) is sent to terminal 1, and then the vector (L b ,b) sent to terminal 2.
[0068] in, Represents a Boolean operation, specifically an XOR operation, where the value of b is 0 or 1. When b is 0, L b For L 0 , when b is equal to 1, L b For L 1 .
[0069] In some other embodiments of this specification, a comparison function is also provided. Define the method to achieve the corresponding function:
[0070] Comparison data 1 sent by receiving terminal 1: (t A , x A , r A ), and the comparison data 2 sent by terminal 2: (t B , x B , r B );
[0071] calculate And randomly generate a vector (L 0 ,L 1 ) is sent to terminal 1, and then the vector (L b ,b) sent to terminal 2.
[0072] in, It can represent Boolean operations, specifically XOR operations. The value of b is 0 or 1. When b is 0, L b For L 0 , when b is equal to 1, L b For L 1 .
[0073] After the function definition for implementing the comparison function is completed, the model owner and the data owner can respectively generate the first comparison data (t A , x A , r A ), and the second comparison data (t B , x B , r B ), calling the function that implements the comparison function can generate the first hash vector (X 0 ,X 1 ), and the second hash vector (X b ,b) Wherein, the first comparison data of the model holder can be generated according to the attributes of each node in the model and the data information of the acquired data holder, t A Can represent the threshold value of the node, x A It can represent the data information of the data holder obtained through the oblivious transfer protocol or it can represent the attribute value of the node. A It can indicate whether the two child nodes of a node are swapped, i.e., the node attribute rotate. In the calculation process of the first layer of the tree model, the second comparison data of the data holder, i.e., the second terminal, can be randomly generated, and the calculation result of the first layer of the tree model can be used to generate the second comparison data for the calculation of the second layer of the tree model, and so on.
[0074] Call F cmp , After that, the model holder, i.e., the first terminal, can obtain the first hash vector, and the second terminal can obtain the second hash vector. The model holder can use the first hash vector to calculate the hash value corresponding to each node, and encrypt the attribute information of the corresponding node according to the calculated hash value, obtain the node encryption information of each node, and send the node encryption information to the second terminal. When encrypting the attribute information of the node, the attribute information of the node can be subjected to Boolean operation or arithmetic operation with the randomly generated numerical value when calculating the previous layer of tree model, and then encrypted. In the embodiment of this specification, the three attribute information of the node, threshold, attribute, and rotation can be processed and encrypted. Of course, other attribute information of the node can also be encrypted according to actual needs. The second terminal can use the second hash vector to decrypt the received node encryption information to obtain the media data. Based on the media data, the first comparison data and the second comparison data for the next layer of model calculation can be generated, and the node calculation of the next layer of tree model can be performed until the last layer of the tree model is reached.
[0075] In some embodiments of this specification, if the model holder and the data holder adopt an oblivious transfer protocol, the encryption and decryption of the data holder's data information in the calculation process of each layer of the tree model can both adopt a symmetric encryption algorithm and a symmetric decryption algorithm. The encryption method using a single-key cryptographic system, in which the same key can be used for both encryption and decryption of information, can be called symmetric encryption, also known as single-key encryption. If the model holder and the data holder adopt a homomorphic encryption algorithm, the encryption and decryption of the data holder's data information in the calculation process of each layer of the tree model can both adopt homomorphic encryption and homomorphic decryption.
[0076] The embodiments of this specification provide a data processing method for a machine learning model, which calls a predefined function to implement a comparison function at each layer of a tree model, ignores the path selection of the data in the tree model, and ensures that the model holder and the data holder do not disclose any other information to each other except the model output results, thereby ensuring the security and privacy of data interaction.
[0077] Based on the above embodiments, the data transmission protocol between the model holder and the data holder in the embodiments of this specification is specifically introduced below, that is, the data processing process of the decision tree model:
[0078] 1. For each i∈[1,2 l), the first terminal, i.e. the model holder, randomly configures the value of T[i].rotate. If T[i].rotate=1, the two child nodes of the node are swapped. Where i represents the node number, l represents the layer number of the tree model, and T[i].rotate represents the rotate attribute of the i-th node in the tree model, i.e., whether the child nodes of the i-th node need to be swapped.
[0079] 2. The first terminal performs parameter initialization, and the following parameters can be set specifically: [t] A =T[1].threshold,[a] A =T[1].attribute,[r] A =T[1].rotate,[x] A =0, K 1 = 0. Among them, T[1].threshold can represent the threshold of the first node, T[1].attribute can represent the attribute of the first node, and T[1].rotate represents whether the child nodes of the first node are swapped. [t] A , [r] A , [x] A It can represent the data used when calling the defined function to implement the comparison function. 1 Can represent the initial hash parameter value.
[0080] 3. The second terminal, i.e. the data holder, performs parameter initialization. Specifically, the following parameters can be set: [t] B =0, [a] B =0, [r] B =0, K 1 =0, p = 1. Where, [t] B , [r] B It can represent the data used when calling the defined function to implement the comparison function. 1 can represent the initial hash parameter value, and p can represent a pointer parameter.
[0081] 4. For each layer of the tree model, perform the following operations, where l∈[0,h] and h represents the total number of layers of the tree model:
[0082] (a) The second terminal randomly generates parameters [x] B , change [x] B Add to the data information x held by the second terminal, and add [x] B The data information after the rotation is shifted leftwards[a] B Operation, about to add [x] B The data information after the rotation is moved to the left [a] BThe first terminal provides the parameter [a] A , the second terminal provides the parameter x′, and the oblivious transfer protocol function can return the calculation result to the first terminal, and the return value is recorded as [x] A .
[0083] (b) Call the function F that implements the comparison function cmp , wherein the first terminal provides the first comparison data ([t] A , [x] A , [r] A ), the second terminal provides the second comparison data ([t] B , [x] B , [r] B ). cmp The definition of is referred to the above embodiment, and will not be repeated here. Referring to the definition of the above embodiment, it can be seen that the first terminal is equivalent to terminal 1, the second terminal is equivalent to terminal 2, and calling F cmp , the first hash vector (L 0 ,L 1 ), returns the second hash vector (L b ,b).
[0084] (c) The first terminal randomly generates [t] A , [a] A , [r] A , for every i∈[2 l ,2 l+1 ) node, according to the received first hash vector (L 0 ,L 1 ), calculate the hash value K of each node 2i+c =H(K i ,L c ), where H represents hash calculation and c∈{0,1};
[0085] Use the hash value of each node to calculate the node encryption information of each node:
[0086]
[0087] In the above formula, Enc can represent the encryption operation, where K 2i+c Can represent the key, using K 2i+c right T[2i+c].attribute-[a] A , Encrypt and obtain node encryption information.
[0088] And {ei} is sent to the second terminal, where i∈[2 l+1 ,2 l+2 ).
[0089] (d) The second terminal updates the pointer parameter p=2p+b, and calculates according to the second hash vector:
[0090] K p =H(K p / 2 ,L b )
[0091] ([t] B ,[a] B ,[r] B )=Dec(K p ;e p )
[0092] Among them, can represent hash calculation, Dec can represent decryption calculation, using the key K p For p Decryption is performed, where [t] A ,[t] B , [a] A , [a] B , [r] A , [r] B The following conditions are met:
[0093]
[0094] 5. The first terminal randomly generates a first prediction value share [R] A , for every i∈[2 h ,2 h+1 ), find node j, node j satisfies the following conditions: T[j].leaf = true and node j is the parent node of node i, that is, obtain the leaf node of the tree model. According to the first prediction value share [R] A and the attribute value of node j, calculate the node attribute value encrypted information v i :
[0095]
[0096] Among them, Enc can represent encryption operation, using the key K i right Encryption is performed.
[0097] The calculated v i Sent to the second terminal.
[0098] It should be noted that in the embodiments of this specification, during the data processing, the tree model may be supplemented as a complete binary tree, that is, some nodes may be virtual nodes. The leaf nodes of the tree model in the embodiments of this specification represent the actual leaf nodes of the tree model and do not include supplementary virtual nodes.
[0099] 6. The second terminal receives the v i Perform decryption operation to obtain the second prediction value share [R] B = Dec(K p ;v p ), where Dec represents the decryption operation, using the key K p v p Perform decryption operation, where p represents the pointer parameter in step 4.
[0100] In some other embodiments of this specification, a method for processing data using a homomorphic encryption algorithm is also provided. The specific process may include:
[0101] 1. For each i∈[1,2 l ), the first terminal, i.e., the model holder, randomly configures the value of T[i].rotate. If T[i].rotate=1, the two child nodes of the node are swapped. Where i can represent the node number, l represents the layer number of the tree model, and T[i].rotate represents the rotate attribute of the i-th node in the tree model, i.e., whether the child nodes of the i-th node need to be swapped.
[0102] 2. The second terminal uses a homomorphic encryption algorithm to encrypt the data information it holds, that is, calculate X[i]=Enc(x[i]), where x[i] can represent the i-th data in the data information held by the second terminal, and Enc can represent homomorphic encryption, that is, X[i] can represent the ciphertext information of x[i]. The encrypted data information X[i] is sent to the first terminal.
[0103] 3. For any i∈T, T can represent a node of the tree model, i∈T can represent each node of the tree model, the first terminal randomly defines the value of the parameter T[i].value and calculates the following information:
[0104] Add(X[T[i].attribute],T[i].value)
[0105] Among them, X[i]=Enc(x[i]) can represent homomorphic encryption, wherein X[T[i].attribute] can represent the ciphertext of x[T[i].attribute], and Add(X[T[i].attribute],T[i].value) can represent the ciphertext information of x[T[i].attribute]+T[i].value. T[i].attribute can represent the attribute of the i-th node, and T[i].value can represent the attribute value of the i-th node.
[0106] The first terminal sends the calculated Add(X[T[i].attribute],T[i].value) to the second terminal, and the second terminal decrypts the received data to obtain T', where T'[i].value+T[i].value=x[T[i].attribute].
[0107] 4. The first terminal performs parameter initialization. Specifically, the following parameters can be set: [t] A =T[1].threshold, <x> A =T[1].value,[r] A =T[1].rotate, K 1 = 0. Among them, T[1].threshold can represent the threshold of the first node, T[1].value can represent the attribute value of the first node, and T[1].rotate represents whether the child nodes of the first node are swapped. [t] A , [r] A , <x> A It can represent the data used when calling the defined function to implement the comparison function. 1 Can represent the initial hash parameter value.
[0108] 5. The second terminal, i.e. the data holder, performs parameter initialization. Specifically, the following parameters can be set: [t] B =0, <x> B =T'[1].value,[r] B =0, K 1 =0, p = 1. Where, [t] B , <x> B , [r] B It can represent the data used when calling the defined function to implement the comparison function. 1 can represent the initial hash parameter value, and p can represent a pointer parameter.
[0109] 6. For each layer of the tree model, perform the following operations, where l∈[0,h] and h represents the total number of layers of the tree model:
[0110] (a) Call the function that implements the comparison function The first terminal provides the first comparison data ([t] A , <x> A , [r] A ), the second terminal provides the second comparison data ([t] B , <x> B , [r] B ). The definition of is referred to the above embodiment, and will not be repeated here. Referring to the definition of the above embodiment, it can be seen that the first terminal is equivalent to terminal 1, the second terminal is equivalent to terminal 2, and calling The first hash vector (L 0 ,L 1 ), returns the second hash vector (L b ,b).
[0111] (b) The first terminal randomly generates [t] A , <x> A , [r] A , for every i∈[2 l ,2 l+1 ) node, according to the received first hash vector (L 0 ,L 1 ), calculate the hash value K of each node 2i+c =H(K i ,L c ), where H represents hash calculation and c∈{0,1};
[0112] Use the hash value of each node to calculate the node encryption information of each node:
[0113]
[0114] In the above formula, Enc can represent the encryption operation, where K 2i+c Can represent the key, using K 2i+c right T[T[2i+c].attribute]- <x> A , ) to encrypt and obtain node encryption information.
[0115] And {e i } is sent to the second terminal, where i∈[2 l+1 ,2 l+2 ).
[0116] (c) The second terminal updates the pointer parameter p=2p+b, and calculates according to the second hash vector:
[0117] K p =H(K p / 2 ,L b )
[0118] ([t] B , <x> B ,[r] B )=Dec(K p ;e p )
[0119] Among them, can represent hash calculation, Dec can represent decryption calculation, using the key K p For p Decryption is performed, where [t] A ,[t] B , <x> A 、 <x> B The following conditions are met:
[0120]
[0121] (d) Second terminal update <x> B , <x> B = <x> B +T'[T[p].attribute].value, where <x> A + <x> B = x[T[p].attribute]
[0122] 7. The first terminal randomly generates a first prediction value share [R] A , for every i∈[2 h ,2 h+1 ), find node j, node j satisfies the following conditions: T[j].leaf=true and node j is the parent node of node i, that is, obtain the leaf node of the tree model.
[0123] According to the first forecast value share [R] A and the attribute value of node j, calculate the node attribute value encrypted information v i :
[0124] Enc can represent encryption operation, using the key K i right Encryption is performed.
[0125] The calculated v i Sent to the second terminal.
[0126] 8. The second terminal receives the v i Perform decryption operation to obtain the second prediction value share [R] B = Dec(K p ;v p ), where Dec represents the decryption operation, using the key K p v p Perform decryption operation, where p represents the pointer parameter in step 5.
[0127] It should be noted that, in the above embodiment, [.] can represent Boolean operations, and <□> can represent arithmetic operations. For example, given a Boolean operation string x∈{0,1} n The length is n, and the [x] operation represents the selection of a uniform random string t∈{0,1} n , then calculate [x] A =x, [x] A and [x] B are the numerical shares of the first terminal and the second terminal respectively. Similarly, if a x∈F is given, F can represent a set, <x>It means selecting a uniform random string t∈F and then calculating xt∈F. <x> A =t, <x> B =x-t, <x> A 、 <x> B They are the numerical shares of the first terminal and the second terminal respectively.
[0128] The predicted value predicted by the tree model in the embodiment of this specification can be divided into two parts, one of which is the first predicted value share [R] A , part of which is the second predicted value share [R] B , which are stored in the first terminal and the second terminal respectively. The above embodiment can represent the process of data processing by a tree model of the model holder, and a first prediction value share [R] can be obtained. A , a node attribute value encrypted information v i The second terminal generates [R] according to the first terminal. A and v i A second prediction value share [R] can be obtained B If the first terminal has multiple tree models, multiple [R] A , multiple v i , further obtain multiple second prediction value shares [R] B , the second terminal may convert the plurality of second prediction value shares [R] B Perform linear combination to obtain the final model prediction value.
[0129] The present specification provides a data processing method for a machine learning model in an embodiment, which combines an oblivious transfer protocol or a homomorphic encryption algorithm with a function that implements a comparison function, and uses the oblivious transfer protocol or the homomorphic encryption algorithm to transfer the data of the data holder to the model holder, so that the model holder can only obtain the data specified by the data holder. The function that implements the comparison function is called at each layer of the tree model, and the path selection of the data in the tree model is ignored, ensuring that the model holder and the data holder do not disclose any other information to each other except the output results of the model, thereby ensuring the security and privacy of data interaction.
[0130] Based on the above embodiments, in one embodiment of this specification, a data processing method based on a machine learning model performed by a data holder is also provided. Figure 2 is a flow chart of a data processing method of a machine learning model in another embodiment of the present specification, such as Figure 2 As shown, the data processing method of the machine learning model provided in the embodiment of this specification may include:
[0131] Step 202: Use an oblivious transfer protocol or a homomorphic encryption algorithm to send data information to a first terminal, so that the tree model in the first terminal calls a function that implements a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, wherein the function that implements the comparison function is used to generate two hash vectors based on the input data, and the hash vectors are used for hash calculation.
[0132] The specific meanings of the oblivious transfer protocol and the homomorphic encryption algorithm can be referred to the introduction of the above embodiments, which will not be repeated here. The data holder and the model holder use the oblivious transfer protocol or the homomorphic encryption algorithm to send the data information of the data holder to the model holder. The model holder processes the nodes of each layer of the tree model according to the received data. In the process of data processing at each layer, the function that implements the comparison function is called to calculate and obtain the hash value corresponding to each node. Among them, the definition method of the function that implements the comparison function can refer to the description of the above embodiments, which will not be repeated here.
[0133] Step 204: Receive node attribute value encryption information generated by the first terminal according to the hash value corresponding to the leaf node of the tree model.
[0134] In the specific implementation process, the first terminal, i.e., the model holder, processes data for each layer of the tree model according to the received data information until the last layer of the tree model is calculated, and the model holder randomly generates a first prediction value share. The hash value corresponding to the leaf node of the last layer of the tree model is obtained, and the node attribute value encryption information is calculated based on the hash value corresponding to the leaf node, the attribute value of the leaf node, and the first prediction value share. The specific calculation method of the node attribute encryption information can refer to the records of the above embodiment, which will not be repeated here.
[0135] Step 206: decrypt the node attribute value encrypted information to obtain a second predicted value share.
[0136] In a specific implementation process, the first terminal may send the calculated encrypted information of the node attribute value to the second terminal, and the second terminal may decrypt the received encrypted information of the node attribute value using the hash value of the corresponding node to obtain the second predicted value share.
[0137] On the basis of the above embodiment, when the model holder has multiple tree models, a first prediction value share and node attribute value encryption information can be generated according to each tree model. The second terminal, i.e., the data holder, can generate multiple second prediction value shares according to the first prediction value shares and node attribute value encryption information generated by each tree model, and the second terminal can linearly superimpose the second prediction value shares to obtain model prediction information.
[0138] The present specification provides a data processing method for a machine learning model in an embodiment, which combines an oblivious transfer protocol or a homomorphic encryption algorithm with a function that implements a comparison function, and uses the oblivious transfer protocol or the homomorphic encryption algorithm to transfer the data of the data holder to the model holder, so that the model holder can only obtain the data specified by the data holder. The function that implements the comparison function is called at each layer of the tree model, and the path selection of the data in the tree model is ignored, ensuring that the model holder and the data holder do not disclose any other information to each other except the output results of the model, thereby ensuring the security and privacy of data interaction.
[0139] Based on the above embodiment, in one embodiment of this specification, after sending the data information to the first terminal, the method may further include:
[0140] Initialize and generate second comparison data, and call the function implementing the comparison function according to the first comparison data generated by the first terminal to obtain a second hash vector;
[0141] receiving node encryption information generated by the first terminal according to the first hash vector, and decrypting the node encryption information according to the second hash vector to obtain media data;
[0142] The second comparison data is regenerated according to the media data and the first comparison data updated by the first terminal, and calculation of the next layer of the tree model is performed until the last layer of the tree model.
[0143] In the specific implementation process, before the data processing of the first layer of the tree model, the second terminal can initialize and generate the second comparison data, and the first terminal can generate the first comparison data based on the data information of the second terminal obtained. The specific generation method of the first comparison data and the second comparison data can refer to the records of the above embodiment, which will not be repeated here. Using the first comparison data and the second comparison data, the function that implements the comparison function is called to obtain the first hash vector and the second hash vector respectively. The first terminal can perform data processing on the node attributes of the tree model according to the first hash vector, obtain the node encryption information of each node, and obtain the hash value corresponding to each node. Among them, the data processing method of each node attribute can refer to the records of the above embodiment, which will not be repeated here. The second terminal can decrypt the node encryption information according to the obtained second hash vector to obtain the media data. Based on the media data, the second terminal can update the second comparison data, and the first terminal can update the first comparison data, and use the updated first comparison data and second comparison data to calculate the next layer of the tree model until the last layer of the tree model is calculated.
[0144] In the embodiments of the present specification, when the tree model processes data, the tree model of each layer calls a pre-defined function to implement the comparison function, and processes the data for each node. The path selection of the data in the tree model can be ignored, ensuring that the model holder and the data holder do not disclose any other information to each other except the model output results, thereby ensuring the security and privacy of data interaction.
[0145] In this specification, each embodiment of the above method is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. The relevant parts can be referred to the partial description of the method embodiment.
[0146] Based on the navigation method of the application described above, one or more embodiments of this specification also provide a data processing device for a machine learning model. The device may include a system (including a distributed system), software (application), module, component, server, client, etc. using the method described in the embodiment of this specification and a device combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiment of this specification is as described in the following embodiments. Since the implementation scheme and method of the device to solve the problem are similar, the implementation of the specific device in the embodiment of this specification can participate in the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0147] Specifically, Figure 3 is a schematic diagram of the module structure of an embodiment of a data processing device for a machine learning model provided in this specification, such as Figure 3 As shown, the data processing device of the machine learning model provided in this specification is mainly used in the model holder, and may include: a first data transmission module 31, a first model calculation module 32, and a first prediction module 33, wherein:
[0148] The first data transmission module 31 may be used to obtain data information of the second terminal using an oblivious transfer protocol or a homomorphic encryption algorithm;
[0149] The first model calculation module 32 may be used to input the data information into a tree model, each layer of the tree model calls a function implementing a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, wherein the function implementing the comparison function is used to generate two hash vectors based on the input data, and the hash vectors are used for hash calculation;
[0150] The first prediction module 33 can be used to generate node attribute value encryption information according to the hash value corresponding to the leaf node of the tree model, and send the node attribute value encryption information to the second terminal, so that the second terminal generates a second prediction value share corresponding to the second terminal according to the node attribute value encryption information.
[0151] The data processing device of the machine learning model provided in the embodiment of this specification can use the oblivious transfer protocol or homomorphic encryption algorithm to send the data of the data holder to the model holder, and call the function that implements the comparison function at each layer of the tree model, ignoring the path selection of the data in the tree model. Combining the oblivious transfer protocol or homomorphic encryption algorithm with the function that implements the comparison function ensures that the model holder and the data holder do not disclose any other information to each other except the output results of the model, thereby ensuring the security and privacy of data interaction.
[0152] Based on the above embodiment, the first model calculation module is specifically used for:
[0153] Generate first comparison data according to the data information, and call the function implementing the comparison function according to the second comparison data generated by the second terminal to obtain a first hash vector;
[0154] Generate a hash value of a node of the tree model according to the first hash vector, and use the hash value of the node to encrypt attribute information of the corresponding node to obtain node encryption information of each node;
[0155] Sending the node encryption information to the second terminal, so that the second terminal decrypts the node encryption information according to the second hash vector returned by the function implementing the comparison function to obtain the media data;
[0156] The first comparison data is regenerated according to the media data, and the second comparison data updated by the second terminal, and calculation of the next layer of the tree model is performed until the last layer of the tree model.
[0157] The embodiment of this specification calls a function that implements the comparison function at each layer of the tree model, ignoring the path selection of the data in the tree model, ensuring that the model holder and the data holder do not disclose any other information to each other except the model output results, thereby ensuring the security and privacy of data interaction.
[0158] Based on the above embodiment, the first model calculation module uses a symmetric encryption algorithm to encrypt the attribute information.
[0159] Based on the above embodiment, the first prediction module is specifically used for:
[0160] Randomly generate a first prediction value share, and obtain the attribute value of the leaf node of the tree model;
[0161] Calculating XOR information of the attribute value of the leaf node and the first predicted value share;
[0162] The XOR information of the corresponding leaf node is encrypted using the hash value corresponding to the leaf node to obtain the node attribute value encrypted information.
[0163] The embodiments of this specification process data at each layer of the tree model based on an oblivious transfer protocol or a combination of homomorphic encryption and a function for implementing a comparison function, ignoring the path selection of the data in the tree model, ensuring that the model holder and the data holder do not disclose any other information to each other except the model output results, thereby ensuring the security and privacy of data interaction.
[0164] Based on the above embodiment, the first prediction module is further used for:
[0165] If there are multiple tree models, multiple node attribute value encryption information is generated, and the multiple node attribute value encryption information is sent to the second terminal, so that the second terminal obtains multiple second prediction value shares according to the node attribute value encryption information.
[0166] In the embodiment of this specification, if there are multiple tree models, linear superposition is performed based on the prediction results of the multiple tree models to generate final prediction information, thereby improving the accuracy of the model output.
[0167] It should be noted that the above-mentioned device may also include other implementations according to the description of the method embodiment. The specific implementation methods can refer to the description of the relevant method embodiment, and will not be described one by one here.
[0168] The embodiment of this specification also provides a data processing device of a machine learning model, including: at least one processor and a memory for storing processor executable instructions, wherein the processor implements the navigation method of the application of the above embodiment when executing the instructions, such as:
[0169] Obtain data information of the second terminal using an oblivious transfer protocol or a homomorphic encryption algorithm;
[0170] Input the data information into a tree model, call a function implementing a comparison function at each layer of the tree model, and obtain a hash value corresponding to each node of the tree model according to the data information, wherein the function implementing the comparison function is used to generate two hash vectors based on the input data, and the hash vectors are used for hash calculation;
[0171] Generate node attribute value encryption information based on the hash value corresponding to the leaf node of the tree model, and send the node attribute value encryption information to the second terminal, so that the second terminal generates a second prediction value share corresponding to the second terminal based on the node attribute value encryption information.
[0172] The storage medium may include a physical device for storing information, which is usually a medium that digitizes the information and then stores it in an electrical, magnetic or optical manner. The storage medium may include: a device that stores information in an electrical energy manner, such as various memories, such as RAM, ROM, etc.; a device that stores information in a magnetic energy manner, such as a hard disk, a floppy disk, a magnetic tape, a magnetic core memory, a magnetic bubble memory, a USB flash drive; a device that stores information in an optical manner, such as a CD or a DVD. Of course, there are other readable storage media, such as quantum memory, graphene memory, etc.
[0173] It should be noted that the processing device described above may also include other implementations according to the description of the method embodiment. The specific implementation methods may refer to the description of the relevant method embodiment, which will not be described one by one here.
[0174] In some embodiments of the present invention, a data processing device for a machine learning model is provided for use by a data holder. Figure 4 is a schematic diagram of the module structure of another embodiment of the data processing device of the machine learning model provided in this specification, such as Figure 4 As shown, the data processing device of the machine learning model provided in this specification may include: a second data transmission module 41, a data receiving module 42, and a second prediction module 43, wherein:
[0175] The second data transmission module 41 can be used to send data information to the first terminal by using an oblivious transfer protocol or a homomorphic encryption algorithm, so that the tree model in the first terminal calls a function implementing a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, wherein the function implementing the comparison function is used to generate two hash vectors based on the input data, and the hash vectors are used for hash calculation;
[0176] The data receiving module 42 may be used to receive node attribute value encryption information generated by the first terminal according to the hash value corresponding to the leaf node of the tree model;
[0177] The second prediction module 43 can be used to decrypt the encrypted information of the node attribute value to obtain a second prediction value share.
[0178] In the embodiments of this specification, the oblivious transfer protocol or homomorphic encryption algorithm is combined with the function that realizes the comparison function, and the oblivious transfer protocol or homomorphic encryption algorithm is used to transfer the data of the data holder to the model holder, so that the model holder can only obtain the data specified by the data holder. The function that realizes the comparison function is called at each layer of the tree model, and the path selection of the data in the tree model is ignored, ensuring that the model holder and the data holder do not disclose any other information to each other except the output results of the model, thereby ensuring the security and privacy of data interaction.
[0179] Figure 5 is a schematic diagram of the structure of a data processing device for a machine learning model in another embodiment of the present specification, such as Figure 5 As shown, based on the above embodiment, the device further includes a second model calculation module 51, which is used to:
[0180] After the data information is sent to the first terminal, the second comparison data is initialized and generated, and according to the first comparison data generated by the first terminal, the function implementing the comparison function is called to obtain a second hash vector;
[0181] receiving node encryption information generated by the first terminal according to the first hash vector, and decrypting the node encryption information according to the second hash vector to obtain media data;
[0182] The second comparison data is regenerated according to the media data and the first comparison data updated by the first terminal, and calculation of the next layer of the tree model is performed until the last layer of the tree model.
[0183] In the embodiments of this specification, a predefined function capable of implementing the comparison function is called at each layer of the tree model, and the path selection of the data in the tree model is ignored, ensuring that the model holder and the data holder do not disclose any other information to each other except the model output results, thereby ensuring the security and privacy of data interaction.
[0184] Based on the above embodiment, the second prediction module is further used for:
[0185] If the first terminal includes multiple tree models, receiving encrypted information of node attribute values generated by multiple tree models;
[0186] Generating a plurality of second prediction value shares according to the plurality of node attribute value encrypted information;
[0187] The multiple second prediction value shares are linearly superimposed to obtain model prediction information.
[0188] In the embodiment of this specification, if there are multiple tree models, linear superposition is performed based on the prediction results of the multiple tree models to generate final prediction information, thereby improving the accuracy of the model output.
[0189] It should be noted that the above-mentioned device may also include other implementations according to the description of the method embodiment. The specific implementation methods can refer to the description of the relevant method embodiment, and will not be described one by one here.
[0190] The embodiment of this specification also provides a data processing device of a machine learning model, including: at least one processor and a memory for storing processor executable instructions, wherein the processor implements the navigation method of the application of the above embodiment when executing the instructions, such as:
[0191] Using an oblivious transfer protocol or a homomorphic encryption algorithm, the data information is sent to a first terminal, so that a tree model in the first terminal calls a function implementing a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, wherein the function implementing the comparison function is used to generate two hash vectors based on the input data, and the hash vectors are used for hash calculation;
[0192] Receive node attribute value encryption information generated by the first terminal according to the hash value corresponding to the leaf node of the tree model;
[0193] The node attribute value encrypted information is decrypted to obtain a second predicted value share.
[0194] The storage medium may include a physical device for storing information, which is usually a medium that digitizes the information and then stores it in an electrical, magnetic or optical manner. The storage medium may include: a device that stores information in an electrical energy manner, such as various memories, such as RAM, ROM, etc.; a device that stores information in a magnetic energy manner, such as a hard disk, a floppy disk, a magnetic tape, a magnetic core memory, a magnetic bubble memory, a USB flash drive; a device that stores information in an optical manner, such as a CD or a DVD. Of course, there are other readable storage media, such as quantum memory, graphene memory, etc.
[0195] It should be noted that the processing device described above may also include other implementations according to the description of the method embodiment. The specific implementation methods may refer to the description of the relevant method embodiment, which will not be described one by one here.
[0196] Figure 6 is a schematic diagram of the structure of a data processing system of a machine learning model in one embodiment of this specification, such as Figure 6 As shown, the data processing system of the machine learning model in the embodiment of this specification may include a model client 61, a data client 62, a data transmission module 63, and a comparison function module 64, wherein the model client 61 includes one or more tree models, the data client 62 includes data information, and the data transmission module 63 includes an oblivious transfer protocol or a homomorphic encryption algorithm;
[0197] The model client 61 and the data client 62 transmit data by calling the data transmission module 63. The model client 61 and the data client 62 call the comparison function module 64 to process data at each layer of the tree model in the model client 61. The comparison function module 64 can implement the F in the above embodiment. cmp , The model client 61 is used to execute the method steps corresponding to the model holder in the above embodiment, and the data client 62 is used to execute the method steps corresponding to the data holder in the above embodiment.
[0198] The data processing system of the machine learning model provided in this specification can be a data processing system of a separate machine learning model, and can also be applied in a variety of data analysis and processing systems. The system may include a navigation device applied in any of the above embodiments. The system may be a separate server, or it may include a server cluster, system (including distributed system), software (application), actual operation device, logic gate circuit device, quantum computer, etc. using one or more of the methods or one or more embodiment devices of this specification and a terminal device combined with necessary implementation hardware. The detection system for checking difference data may include at least one processor and a memory storing computer executable instructions, and the processor implements the steps of the method described in any one or more of the above embodiments when executing the instructions.
[0199] The method embodiments provided in the embodiments of this specification can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Figure 7 is a hardware structure block diagram of the data processing server of the machine learning model in the embodiment of this specification. The server can execute the method corresponding to the data holder, and can also specify the method corresponding to the model holder. Figure 7 As shown, the server 10 may include one or more (only one is shown in the figure) processors 100 (the processor 100 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 200 for storing data, and a transmission module 300 for communication functions. A person skilled in the art can understand that Figure 7 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 7 More or fewer components shown in the figure may also include other processing hardware, such as a database or multi-level cache, GPU, or other hardware with Figure 7 Different configurations are shown.
[0200] The memory 200 can be used to store software programs and modules of application software, such as program instructions / modules corresponding to the navigation method of the application in the embodiment of this specification. The processor 100 executes various functional applications and data processing by running the software programs and modules stored in the memory 200. The memory 200 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 200 may further include a memory remotely arranged relative to the processor 100, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0201] The transmission module 300 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission module 300 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 300 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0202] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0203] The methods or devices described in the above embodiments provided in this specification can implement business logic through computer programs and record them on storage media, and the storage media can be read and executed by a computer to achieve the effects of the solutions described in the embodiments of this specification.
[0204] The navigation method or device of the above-mentioned application provided in the embodiments of this specification can be implemented by a processor in a computer executing corresponding program instructions, such as using the C++ language of the Windows operating system to implement it on a PC, on a Linux system, or other systems such as Android and iOS system programming languages to implement it on a smart terminal, as well as based on the processing logic of a quantum computer.
[0205] It should be noted that the device, computer storage medium, and system described in the specification may also include other implementation methods according to the description of the relevant method embodiments. The specific implementation methods can refer to the description of the corresponding method embodiments, which will not be described one by one here.
[0206] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the hardware + program embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0207] The embodiments of this specification are not limited to complying with industry communication standards, standard computer data processing and data storage rules, or the situations described in one or more embodiments of this specification. Certain industry standards or slightly modified implementation plans based on the implementation described in the custom method or embodiment can also achieve the same, equivalent or similar, or predictable implementation effects after deformation of the above-mentioned embodiments. The embodiments obtained by using these modified or deformed data acquisition, storage, judgment, processing methods, etc. can still fall within the scope of the optional implementation plans of the embodiments of this specification.
[0208] In the 1990s, it was very clear whether the improvement of a technology was a hardware improvement (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements in the method flow today can be regarded as direct improvements in the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs. The original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0209] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0210] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0211] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. The first, second, etc. words are used to represent the name, and do not represent any particular order.
[0212] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0213] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0214] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0215] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0216] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0217] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0218] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0219] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0220] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0221] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to in part of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples without contradiction.
[0222] The above description is only an example of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims.< / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x>
Claims
1. A data processing method for a machine learning model, characterized in that: include: Obtain data information of the second terminal using an oblivious transfer protocol or a homomorphic encryption algorithm; The data information is input into a tree model, each layer of the tree model calls a function that implements a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, wherein the function that implements a comparison function is used to generate two hash vectors based on the input data, and the hash vectors are used for hash calculation; the obtaining of the hash value corresponding to each node of the tree model includes: generating first comparison data according to the data information, and calling the function that implements a comparison function according to second comparison data generated by the second terminal to obtain a first hash vector; generating a hash value of a node of the tree model according to the first hash vector, and encrypting the attribute information of the corresponding node using the hash value of the node to obtain node encryption information of each node; sending the node encryption information to the second terminal, so that the second terminal decrypts the node encryption information according to the second hash vector returned by the function that implements a comparison function to obtain media data; regenerating the first comparison data according to the media data, and the second comparison data updated by the second terminal, and performing calculations on the next layer of the tree model until the last layer of the tree model; Generate node attribute value encryption information according to the hash value corresponding to the leaf node of the tree model, and send the node attribute value encryption information to the second terminal, so that the second terminal generates a second prediction value share corresponding to the second terminal according to the node attribute value encryption information; the generation of node attribute value encryption information includes: randomly generating a first prediction value share, and obtaining the attribute value of the leaf node of the tree model; calculating the XOR information of the attribute value of the leaf node and the first prediction value share; encrypt the XOR information of the corresponding leaf node using the hash value corresponding to the leaf node to obtain the node attribute value encryption information.
2. The method according to claim 1, characterized in that The step of encrypting the attribute information of the corresponding node by using the hash value of the node includes: The attribute information is encrypted using a symmetric encryption algorithm.
3. The method according to claim 1, characterized in that The method further comprises: If there are multiple tree models, multiple node attribute value encryption information is generated, and the multiple node attribute value encryption information is sent to the second terminal, so that the second terminal obtains multiple second prediction value shares according to the node attribute value encryption information.
4. A data processing method for a machine learning model, characterized in that: include: Using an oblivious transfer protocol or a homomorphic encryption algorithm, data information is sent to a first terminal, so that a tree model in the first terminal calls a function that implements a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, wherein the function that implements the comparison function is used to generate two hash vectors based on input data, and the hash vectors are used for hash calculation; the step of obtaining a hash value corresponding to each node of the tree model according to the data information includes: generating first comparison data according to the data information, and calling the function that implements the comparison function according to second comparison data generated by a second terminal to obtain a first hash vector; generating a hash value of a node of the tree model according to the first hash vector, and encrypting attribute information of the corresponding node using the hash value of the node to obtain node encryption information of each node; sending the node encryption information to the second terminal, so that the second terminal decrypts the node encryption information according to the second hash vector returned by the function that implements the comparison function to obtain media data; regenerating the first comparison data according to the media data, and the second comparison data updated by the second terminal, and performing calculations on the next layer of the tree model until the last layer of the tree model; Receive node attribute value encryption information generated by the first terminal according to the hash value corresponding to the leaf node of the tree model; the generation of the node attribute value encryption information includes: randomly generating a first prediction value share, and obtaining the attribute value of the leaf node of the tree model; calculating the XOR information of the attribute value of the leaf node and the first prediction value share; using the hash value corresponding to the leaf node to encrypt the XOR information of the corresponding leaf node, and obtain the node attribute value encryption information; The node attribute value encrypted information is decrypted to obtain a second predicted value share.
5. The method according to claim 4, characterized in that After sending the data information to the first terminal, the method further includes: Initialize and generate second comparison data, and call the function implementing the comparison function according to the first comparison data generated by the first terminal to obtain a second hash vector; receiving node encryption information generated by the first terminal according to the first hash vector, and decrypting the node encryption information according to the second hash vector to obtain media data; The second comparison data is regenerated according to the media data and the first comparison data updated by the first terminal, and calculation of the next layer of the tree model is performed until the last layer of the tree model.
6. The method according to claim 4, characterized in that The method further comprises: If the first terminal includes multiple tree models, receiving encrypted information of node attribute values generated by multiple tree models; Generating a plurality of second prediction value shares according to the plurality of node attribute value encrypted information; The multiple second prediction value shares are linearly superimposed to obtain model prediction information.
7. A data processing device for a machine learning model, characterized in that: include: A first data transmission module, used to obtain data information of the second terminal by using an oblivious transfer protocol or a homomorphic encryption algorithm; A first model calculation module is used to input the data information into a tree model, each layer of the tree model calls a function that implements a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, wherein the function that implements the comparison function is used to generate two hash vectors based on the input data, and the hash vectors are used for hash calculation; the obtaining of the hash value corresponding to each node of the tree model includes: generating first comparison data according to the data information, and calling the function that implements the comparison function according to second comparison data generated by the second terminal to obtain a first hash vector; generating hash values of nodes of the tree model according to the first hash vector, and encrypting attribute information of corresponding nodes using the hash values of the nodes to obtain node encryption information of each node; sending the node encryption information to the second terminal, so that the second terminal decrypts the node encryption information according to the second hash vector returned by the function that implements the comparison function to obtain media data; regenerating the first comparison data according to the media data, and the second comparison data updated by the second terminal, and performing calculations on the next layer of the tree model until the last layer of the tree model; The first prediction module is used to generate node attribute value encryption information according to the hash value corresponding to the leaf node of the tree model, and send the node attribute value encryption information to the second terminal, so that the second terminal generates a second prediction value share corresponding to the second terminal according to the node attribute value encryption information; the generation of node attribute value encryption information includes: randomly generating a first prediction value share, and obtaining the attribute value of the leaf node of the tree model; calculating the XOR information of the attribute value of the leaf node and the first prediction value share; using the hash value corresponding to the leaf node to encrypt the XOR information of the corresponding leaf node to obtain the node attribute value encryption information.
8. The device according to claim 7, characterized in that The first model calculation module is specifically used for: Generate first comparison data according to the data information, and call the function implementing the comparison function according to the second comparison data generated by the second terminal to obtain a first hash vector; Generate a hash value of a node of the tree model according to the first hash vector, and use the hash value of the node to encrypt attribute information of the corresponding node to obtain node encryption information of each node; Sending the node encryption information to the second terminal, so that the second terminal decrypts the node encryption information according to the second hash vector returned by the function implementing the comparison function to obtain the media data; The first comparison data is regenerated according to the media data, and the second comparison data updated by the second terminal, and calculation of the next layer of the tree model is performed until the last layer of the tree model.
9. The device according to claim 8, characterized in that The first model calculation module encrypts the attribute information using a symmetric encryption algorithm.
10. The device according to claim 7, characterized in that The first prediction module is specifically used for: Randomly generate a first prediction value share, and obtain the attribute value of the leaf node of the tree model; Calculating XOR information of the attribute value of the leaf node and the first predicted value share; The XOR information of the corresponding leaf node is encrypted using the hash value corresponding to the leaf node to obtain the node attribute value encrypted information.
11. The device according to claim 7, characterized in that The first prediction module is also used for: If there are multiple tree models, multiple node attribute value encryption information is generated, and the multiple node attribute value encryption information is sent to the second terminal, so that the second terminal obtains multiple second prediction value shares according to the node attribute value encryption information.
12. A data processing device for a machine learning model, characterized in that: include: At least one processor and a memory for storing processor-executable instructions, wherein when the processor executes the instructions, the method according to any one of claims 1 to 5 is implemented.
13. A data processing device for a machine learning model, characterized in that: include: A second data transmission module is used to send data information to the first terminal using an oblivious transfer protocol or a homomorphic encryption algorithm, so that the tree model in the first terminal calls a function that implements a comparison function, and obtains a hash value corresponding to each node of the tree model according to the data information, wherein the function that implements the comparison function is used to generate two hash vectors based on input data, and the hash vectors are used for hash calculation; the step of obtaining a hash value corresponding to each node of the tree model according to the data information includes: generating first comparison data according to the data information, and calling the function that implements the comparison function according to second comparison data generated by the second terminal to obtain a first hash vector; generating hash values of nodes of the tree model according to the first hash vector, and encrypting attribute information of corresponding nodes using the hash values of the nodes to obtain node encryption information of each node; sending the node encryption information to the second terminal, so that the second terminal decrypts the node encryption information according to the second hash vector returned by the function that implements the comparison function to obtain media data; regenerating the first comparison data according to the media data, and the second comparison data updated by the second terminal, and performing calculations on the next layer of the tree model until the last layer of the tree model; A data receiving module, used to receive node attribute value encryption information generated by the first terminal according to the hash value corresponding to the leaf node of the tree model; the generation of the node attribute value encryption information includes: randomly generating a first prediction value share, and obtaining the attribute value of the leaf node of the tree model; calculating the XOR information of the attribute value of the leaf node and the first prediction value share; using the hash value corresponding to the leaf node to encrypt the XOR information of the corresponding leaf node, and obtain the node attribute value encryption information; The second prediction module is used to decrypt the node attribute value encrypted information to obtain a second prediction value share.
14. The device according to claim 13, characterized in that The device also includes a second model calculation module, which is used to: After the data information is sent to the first terminal, the second comparison data is initialized and generated, and according to the first comparison data generated by the first terminal, the function implementing the comparison function is called to obtain a second hash vector; receiving node encryption information generated by the first terminal according to the first hash vector, and decrypting the node encryption information according to the second hash vector to obtain media data; The second comparison data is regenerated according to the media data, and the first comparison data updated by the first terminal, and calculation of the next layer of the tree model is performed until the last layer of the tree model.
15. The device according to claim 13, characterized in that The second prediction module is also used for: If the first terminal includes multiple tree models, receiving encrypted information of node attribute values generated by multiple tree models; Generating a plurality of second prediction value shares according to the plurality of node attribute value encrypted information; The multiple second prediction value shares are linearly superimposed to obtain model prediction information.
16. A data processing device for a machine learning model, characterized in that: include: At least one processor and a memory for storing processor-executable instructions, wherein when the processor executes the instructions, the method according to any one of claims 4 to 6 is implemented.
17. A data processing system for a machine learning model, characterized in that: include: A model client, a data client, a data transmission module, and a comparison function module. The model client includes one or more tree models, the data client includes data information, and the data transmission module includes an oblivious transfer protocol or a homomorphic encryption algorithm. The model client and the data client transmit data by calling the data transmission module, and the model client and the data client call the comparison function module to perform data processing on each layer of the tree model in the model client. The model client is used to execute the method described in any one of claims 1 to 3, and the data client is used to execute the method described in any one of claims 4 to 6.
Citation Information
Patent Citations
Method and apparatus for multicast group key management
KR1020040107698A
KR1018258380000B1