A secure query method, system, electronic device, and storage medium

By protecting bucket information and tags through secret sharing and function encryption, and combining symmetric homomorphic encryption to achieve secure queries, this approach solves the problems of data privacy leakage and high overhead in Federated XGBoost, and provides efficient and high-precision model training and query services.

CN116226876BActive Publication Date: 2026-03-24XIDIAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-20
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing federated XGBoost privacy protection schemes have insufficient security, cannot effectively protect bucket information, and user query data and query results are easily leaked. At the same time, model training requires all data owners to participate online continuously, resulting in high communication and computing overhead and insufficient model accuracy.

Method used

We employ secret sharing and function encryption techniques to protect bucket information and tags, design an efficient XGBoost training and query algorithm, achieve a high-precision boosting tree model through bucket sharing and optimal split search algorithm, and use symmetric homomorphic encryption to provide secure query services during the query process.

Benefits of technology

In federated learning scenarios, this ensures that data does not leave the local machine, protects intermediate gradients, enables efficient and high-precision model generation and secure query results, reduces the need for participants to be online, and lowers computational and communication overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116226876B_ABST
    Figure CN116226876B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of information security, and discloses a kind of safe query method, comprising: active party generates first encryption parameter using encryption key, and sends the first encryption parameter to client and server, and generates query key, and sends the query key to the client;The client encrypts query information based on the query key, obtains encrypted information, and sends the encrypted information to the server;The server processes the encrypted information based on a secure query model, obtains a response ciphertext value, and sends the response ciphertext value to the client;The client decrypts the response ciphertext value based on the query key to obtain the query result corresponding to the new information.In the above process, since the information is encrypted, the information will not be leaked, and the security of the data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of information security, and particularly relates to a secure query method and system, an electronic device, and a storage medium. BACKGROUND

[0002] At present, with the rapid growth of Internet data and the continuous development of information technology, machine learning has attracted widespread attention. As a typical machine learning algorithm, XGBoost (regression prediction model) can provide accurate and efficient data classification services through learning modeling and has been widely used in finance, medical treatment, transportation and many other fields. In the traditional XGBoost training service, the model generates a gradient through a label and divides data into buckets, finds the best split point based on the bucket information and the gradient, obtains a tree model, and then provides prediction services for user data. In the above process, the sensitive data (such as label information, data center training data, and user prediction data) of each data center is not protected, and there is a risk of sensitive information leakage. SUMMARY

[0003] In view of the problems in the prior art, the present application provides a secure query method, system, electronic device and storage medium, which can improve the security of data.

[0004] In a first aspect, the present application provides a secure query method, which comprises: a proactive party generating a first encryption parameter using an encryption key and sending the first encryption parameter to a client and a server, and generating a query key and sending the query key to the client; the client encrypts query information based on the query key to obtain encrypted information, and sends the encrypted information to the server; the server processes the encrypted information based on a secure query model to obtain a response ciphertext value, and sends the response ciphertext value to the client; and the client decrypts the response ciphertext value based on the query key to obtain a query result corresponding to the query information.

[0005] The method further comprises: the active party generating a bucket information encryption key and a weight encryption key, and sending the bucket information encryption key and the weight encryption key to the passive party, the server and the client respectively; the passive party performing bucketing on local data to obtain a Boolean matrix, dividing the Boolean matrix into a first Boolean matrix and a second Boolean matrix, and sending the first Boolean matrix to the active party and the second Boolean matrix to the server; the active party encrypting the first Boolean matrix by using a first encryption function to obtain a key, and sending the key to the server; the active party encrypting gradient information by using the first encryption function to obtain first ciphertext, and sending the first ciphertext to the server; the server decrypting the first ciphertext based on the first encryption function to obtain the gradient information, determining a maximum gain based on the gradient information, and sending point information on the maximum gain and bucketing bits to the active party; the active party updating a tree model by using the point information and updating bucketing information for the next round of training by using the bucketing bits; and the passive party encrypting an optimal split point by using a second encryption function to obtain second ciphertext, and sending the second ciphertext to the server.

[0006] The step of the active party generating a bucket information encryption key and a weight encryption key, and sending the bucket information encryption key and the weight encryption key to the passive party, the server and the client respectively, comprises: the active party executing a first encryption function to generate a master key pair, and executing a second encryption function to generate a symmetric key; encrypting a preset value twice by using the symmetric key, and calculating an encryption parameter for each passive party; and sending a master key in the master key pair and the encryption parameter to each passive party, the server and the client; wherein the master key is the bucket information encryption key, and the encryption parameter is the weight encryption key.

[0007] The step of the active party encrypting gradient information by using the first encryption function to obtain first ciphertext, and sending the first ciphertext to the server, comprises: the active party determining a first gradient and a second gradient; calculating a first gradient sum of the first gradient and a second gradient sum of the second gradient; encrypting the first gradient sum and the second gradient sum by using the first encryption function, and sending first ciphertext to the server, the first ciphertext comprising: the first gradient sum, the second gradient sum, encrypted information of the first gradient sum and encrypted information of the second gradient sum.

[0008] The server decrypts the first ciphertext based on the first encryption function to obtain the gradient information and the maximum gain corresponding to the gradient value, and the step includes: the active party calculates a first shared parameter based on the first Boolean matrix for the dth data feature of any one passive party, and sends the first shared parameter to the server; the server calculates a second shared parameter based on the second Boolean matrix; the server decrypts the first ciphertext based on the first encryption function to obtain a first gradient sum and a second gradient sum; and the server determines the maximum gain based on the first shared parameter, the second shared parameter, the first gradient sum and the second gradient sum.

[0009] The server processes the encrypted information based on a secure query model to obtain a response ciphertext value, and sends the response ciphertext value to the client, and the step includes: the server compares the encrypted information with an optimal split threshold to determine a query symbol, generates a first random number and a second random number for each query symbol, processes the query symbol based on the first random number and the second random number to obtain obfuscated information, and sends the obfuscated information to the active party; the active party decrypts the obfuscated information using the encryption key to obtain first decrypted information, encodes the first decrypted information to obtain encoded information, and sends the encoded information to the server; the server processes the encoded information using the first random number to obtain original information corresponding to the encoded information; the original information represents the direction of splitting; and the server determines the response ciphertext value based on the direction of splitting.

[0010] The server determines the response ciphertext value based on the direction of splitting, and the step includes: calculating a ciphertext for each node, multiplying the ciphertexts of the nodes on each branch to obtain a first calculation result, multiplying the first calculation result by a weight to obtain a second calculation result, and adding all the second calculation results to obtain the response ciphertext value.

[0011] In a second aspect, the application provides a secure query system, which includes: an active party configured to generate a first encryption parameter using an encryption key, send the first encryption parameter to a client and a server, generate a query key, and send the query key to the client; a client configured to encrypt query information based on the query key to obtain encrypted information, send the encrypted information to the server, and decrypt the response ciphertext value based on the query key to obtain a query result corresponding to the novelty information; and a server configured to process the encrypted information based on a secure query model to obtain a response ciphertext value, and send the response ciphertext value to the client.

[0012] In a third aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory is configured to store program instructions for implementing the construction method of the security query method according to any one of the preceding aspects; and the processor is configured to execute the program instructions stored in the memory.

[0013] In a fourth aspect, the present application provides a storage medium storing a program file, wherein the program file can be executed to implement the security query method according to any one of the preceding aspects.

[0014] The security query method of the present application can encrypt the query information, greatly improve the security, and avoid the user query data and the query result from being leaked. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 is a flowchart of a first embodiment of the security query method of the present application;

[0016] Figure 2 is a flowchart of an embodiment of the training method of the security query model of the present application.

[0017] Figure 3 is Figure 1 is a flowchart of an embodiment of step S13 in the method of the present application;

[0018] Figure 4 is a structural diagram of an embodiment of the security query system of the present application;

[0019] Figure 5 is a structural diagram of an embodiment of the electronic device of the present application;

[0020] Figure 6 is a structural diagram of an embodiment of the storage medium of the present application;

[0021] Figure 7 is the cooperation relationship of each module of the active party, the client, the server and the passive party. DETAILED DESCRIPTION

[0022] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.

[0023] In the traditional federated learning XGBoost scheme, the active party (the owner of the data label) uses homomorphic encryption to protect the gradient and sends it to each participant to calculate the split maximum gain. In this process, the original data of the participants does not flow out from the local, but the exchanged parameters still leak the data information (including the numerical value and distribution of the data), which seriously threatens the data privacy security of the participants. And the traditional federated learning XGBoost model requires users to remain online during the training process, and needs to consume a large amount of computing resources for model training, increasing the difficulty of practicality.

[0024] Specifically, the patent "a vertical xgboost decision tree federated learning method and system" applied by Shenzhou Rongan Technology (Beijing) Co., Ltd. discloses a vertical xgboost decision tree joint training and joint inference model method based on a threshold homomorphic encryption scheme, which can guarantee the privacy of the feature data of the samples held by each party and enhance the security of the feature data of each party. The disadvantages of the invention are: based on the threshold homomorphic encryption scheme, part of the users need to remain online, which greatly increases the communication and computing overhead of the model, and is not suitable for low-overhead actual scenarios, and the model training is improved on the basis of the existing model, which also increases the risk of gradient label information leakage.

[0025] In summary, the existing method has the following problems: the existing federated XGBoost privacy protection scheme has insufficient security, cannot support the protection of the bucket information in the training process, and the user query data and query results are leaked, etc. At the same time, the model training needs all data owners to participate continuously online, and the communication and computing overhead is large, or the training model accuracy does not meet the expected effect.

[0026] The significance of solving the above technical problems: for the XGBoost privacy protection problem in the federated learning scene, an efficient and lossless XGBoost training and query algorithm is designed, which can ensure the safe and effective use of sensitive data and promote the rapid development of data mining technology and machine learning algorithm. Therefore, the present application provides a high-security query method, which will be described in detail below in conjunction with the accompanying drawings.

[0027] In view of this, the present application provides a secure query method, which belongs to the technical field of information security and is mainly based on federated XGBoost and includes two stages of training and query service. In the training process, a high-precision boosting tree model is realized based on bucket sharing and optimal split finding algorithm, wherein the bucket information and labels of the model are protected by secret sharing and function encryption (FE), and the optimal split threshold can be calculated to select the best split point for splitting; in the model query process, a careless query algorithm is proposed based on a new symmetric homomorphic encryption (SHE) algorithm to realize secure model query service. The present application can be used for training and query service of XGBoost model in the federated learning scene, can ensure that the data does not leave the local and protect the intermediate gradient, and can ensure that the model generation party efficiently obtains a high-precision XGBoost model under the premise of ensuring that the query result is only known by the query user, thereby ensuring the privacy of the user.

[0028] For details, please refer to Figure 1 , Figure 1 is a flowchart of the first embodiment of the secure query method of the present application, and the secure query method of the present application involves an active party, a passive party, a cloud service provider such as a server CSP, and a client such as a query user terminal U.

[0029] The active party is the owner of the data and data labels, processes the generation of model parameters and key parameters, dominates the whole process of model training, and can obtain the trained model locally, and at the same time provides secure query service for the query user.

[0030] The passive party is the owner of the data (without labels), assists the active party to complete the training of the model, only sends the encrypted local bucket information, does not obtain the model, and does not participate in the query service process.

[0031] The cloud service provider (CSP) is a server responsible for assisting the training of the model and providing the query service of the model.

[0032] The query user U (Query User) is a client, which is a user who wants to safely obtain the query result from the trained model, and only U knows the query result, and the active party and the CSP do not know the query result.

[0033] Figure 1 Specifically, it includes:

[0034] Step S11: The active party generates a first encryption parameter using an encryption key, and sends the first encryption parameter to the client and the server, and generates a query key and sends the query key to the client.

[0035] In this step, for the registered user U, the active party PK First, the first encryption parameter σ' = ([0]0, [1]1, [-1]) is generated by using the encryption key ssk, and the first encryption parameter is sent to the client U and the server CSP. At the same time, the active party generates the SHE key ssk' as a query key, and sends it to U.

[0036] Step S12: The client encrypts the query information based on the query key, obtains encrypted information, and sends the encrypted information to the server.

[0037] When U receives the first encryption parameter σ', U encrypts the query information Q = (q1, q2,..., qn) according to formula (4), and sends [Q] to CSP. For specific formula (4), please refer to the following discussion. D ),

[0038] Step S13: The server processes the encrypted information based on the secure query model, obtains a response ciphertext value, and sends the response ciphertext value to the client.

[0039] Specifically, in step S13, the secure query model needs to be used, so the secure query model needs to be trained. For details, please refer to Figure 2 , Figure 2 The training process of the secure query model is shown in the following figure, which specifically includes:

[0040] Step S21: The active party generates a bucket information encryption key and a weight encryption key, and sends the bucket information encryption key and the weight encryption key to the passive party, the server and the client respectively.

[0041] First, all parameters need to be initialized so that all parameters are consistent. Specifically, all K participants (i.e. passive parties) first agree to execute the specified protocol and are willing to collaboratively train a global enhanced tree model on their local training data. Then, using the entity alignment protocol, the participants delete irrelevant data samples and arrange the corresponding public data samples, wherein the number of remaining data samples is set to N. After that, the active party PK randomly initializes the model weight Finally, the participants agree on the hyperparameters, including the FE security parameter κ, the SHE security parameter (k0, k1, k2), the loss function l, the maximum tree depth T, the maximum tree number R, the regularization parameters λ and γ, the security parameter ∈ and the learning rate η.

[0042] In this step, the active party PK will execute the first encryption function, such as FE.Gen(κ, N), to generate the master key pair (mpk, msk), and the second encryption function, SHE.Gen(k0, k1, k2), to generate the SHE symmetric key ssk. Then, a preset value, such as 0, is encrypted twice using the stacked key ssk, and PK calculates the SHE encryption parameter σ for each passive party. k = ([0]0, [1]1). Finally, PK will combine the master key msk and encryption parameter σ from the master key pair. k The information is sent to each of the passive parties, the server, and the client through a secure channel; wherein the master key msk is the encryption key for the bucket information, and the encryption parameter is the encryption key for the weight.

[0043] It should be noted that FE represents the first encryption function, and Gen represents the relevant parameters of the first encryption function. SHE represents the second encryption function, and Gen represents the relevant parameters of the second encryption function.

[0044] Furthermore, after data alignment, P K Local data It can be considered

[0045]

[0046] D k It is D (k) Number of features It is an N-dimensional eigenvector that contains D k Data points. In addition, the active party P... K With label vector Y = (y1, y2, ... y N We can use D = {D} (1) D (K) , where Y} represents the training data of all participants.

[0047] Step S22: The passive party buckets the local data to obtain a Boolean matrix, divides the Boolean matrix into a first Boolean matrix and a second Boolean matrix, sends the first Boolean matrix to the active party, and sends the second Boolean matrix to the server; the active party uses a first encryption function to encrypt the first Boolean matrix to obtain a key, and sends the key to the server.

[0048] In this step, the passive party buckets the local data to obtain a Boolean matrix. Specifically, each passive party first determines the number of buckets Sk and an independent bucketing strategy. Then, Pk can obtain the splitting threshold for the d-th feature. For the d-th feature, Pk generates a Boolean matrix.

[0049] Each It can be considered as:

[0050]

[0051] Here d = 1, ..., D k s = 1, ..., S k And n = 1, ..., N.

[0052] For each Boolean matrix M (k,d) The passive party (Pk) will first generate a shared Boolean matrix. here

[0053]

[0054] Then, P k Calculate the sharing matrix Here, ⊕ represents the XOR operation. The Boolean matrix is ​​then divided into the first Boolean matrix. Second Boolean matrix And they were sent to P respectively K And CSP. Specifically, the first Boolean matrix is ​​sent to the initiating party, and the second Boolean matrix is ​​sent to the server. Finally, P k By executing the first encryption function Shared for each row in the first Boolean matrix Encrypt and generate a key. and the key Send to CSP.

[0055] Step S23: The active party uses the first encryption function to encrypt the gradient information to obtain the first ciphertext, and sends the first ciphertext to the server.

[0056] When training the r-th tree, P K Initialize the N-dimensional bit vector β (r,1) = (1, ..., 1), and β n (r,t) =1 indicates that the nth data sample is in the bucket during the tth split of the r-th tree. Based on weights (w (0) w (1) ,…,w (r-1) ) and label Y, active party P K Calculate and determine the first gradient Second gradient

[0057] Calculate the first gradient of the first gradient and ag (r,t) =G (r) ·β(r,t) , and the second gradient of the second gradient and ah (r,t) =H (r) ·β (r,t) Specifically, P K First, calculate ag (r,t) =G (r) ·β (r,t) and ah (r,t) =H (r) ·β (r,t) Then, the first gradient sum and the second gradient sum are encrypted using the first encryption function, and the first ciphertext is sent to the server. The first ciphertext includes: the first gradient sum, the second gradient sum, the encryption information of the first gradient sum, and the encryption information of the second gradient sum. Specifically, P K Encryption gradients G and H are calculated through... and ( (This indicates multiplication at corresponding positions). Finally, the first gradient and ag (r,t) The second gradient and ah (r,t) The first gradient and the encrypted information The second gradient and the encrypted information It was sent to the CSP.

[0058] Step S24: The server decrypts the first ciphertext based on the first encryption function to obtain the gradient information, determines the maximum gain based on the gradient information, and sends the point information and bucket bits corresponding to the maximum gain to the active party.

[0059] Specifically, the active party calculates a first shared parameter for the d-th data feature of any passive party based on the first Boolean matrix, and sends the first shared parameter to the server. For example, for the d-th data feature of any participant, the active party will calculate the first shared parameter for that participant. and And send the first shared parameter to the CSP, which satisfies... and

[0060]

[0061] Simultaneously, the server calculates the second shared parameter based on the second Boolean matrix, for example, CSP calculates the shared parameter. and

[0062]

[0063] Here, k = 1, ..., K-1, d = 1, ..., D k s = 1, ..., S k .

[0064] Furthermore, the server decrypts the first ciphertext based on the first encryption function to obtain a first gradient sum and a second gradient sum. The server determines the maximum gain based on the first shared parameter, the second shared parameter, the first gradient sum, and the second gradient sum.

[0065] Specifically, CSP calculations use the following formula to calculate the gain of each node and find the maximum gain, denoted as .

[0066]

[0067] Step S25: The active party updates the tree model using the point information and updates the bucket information for the next round of training using the bucket bit.

[0068] After obtaining the maximum gain, CSP calculates the shared vector. Then CSP returns the best splitting information to the active party, which includes r, t, and k. opt d opt s opt and The active party will update the bit vector β (r,2t) and β (r,2t+1)

[0069]

[0070] Finally, if the maximum depth is reached, P K Calculate weight w *(r,2t) and w *(r,2t+1)

[0071]

[0072] Then P K Update w (r) =w (r) +β (r,2t) *w *(r,2t) +β (r,2t+1) *w *(r,2t+1) To complete the creation of a tree.

[0073] Step S26: The passive party uses the second encryption function to encrypt the optimal split point to obtain the second ciphertext, and sends the second ciphertext to the server.

[0074] Once R trees have been built, iterative training stops. In this step, all participants send their optimal split ciphertext values ​​to the CSP for query services. The active party sends each optimal split message (r, t, k) opt d opt s opt This information is then given to the relevant passive party. The corresponding passive party will then encrypt the feature threshold based on this information.

[0075]

[0076] Here, r0 and r1 refer to two random numbers. When the optimal split point falls on the active side, like the passive side, the characteristic threshold is encrypted using ssk and sent to the passive side. When CSP collects all encrypted optimal split thresholds [τ]... (r,t) After that, we will work with the proactive party to provide query services for users.

[0077] Specifically, through the above Figure 2 After training the secure query model as shown, the encrypted information is processed using the secure query model to obtain the ciphertext response value, which is then sent to the client. Please refer to [the documentation / reference] for details. Figure 3 ,include:

[0078] Step S31: The server compares the encrypted information with the optimal splitting threshold to determine the query symbol, and generates a first random number and a second random number for each query symbol. Based on the first random number and the second random number, the server processes the query symbol to obtain obfuscated information and sends the obfuscated information to the initiator.

[0079] Specifically, once the server receives the encrypted message [Q], the CSP will compare the query weights and the optimal split threshold in the ciphertext, and the CSP will obtain the query symbol.

[0080] For each query symbol [as (r,t) CSP first generates two signed first random numbers. Second random number And satisfy CSP in order to protect [as (r,t) The query symbol is processed based on the first random number and the second random number to obtain obfuscation information, which is then sent to the initiating party. The specific operation is as follows:

[0081]

[0082] The CSP then sends it to the initiating party.

[0083] Step S32: The active party uses the encryption key to decrypt the obfuscated information to obtain first decrypted information, encodes the first decrypted information to obtain encoded information, and sends the encoded information to the server.

[0084] The active party uses SSK to decrypt the obfuscated information and obtains the first decrypted information, ps. (r,t) s. Then, the active party will encode the first decrypted information into 1 or 0 based on its positive or negative value, obtaining the encoded information. This will determine the direction of the tree query (10 indicates a right query, 01 indicates a left query), as follows:

[0085]

[0086] Here, [0] and [1] are both ciphertext encrypted using ssk'. Finally, the initiator sends them to the CSP.

[0087] Step S33: The server processes the encoded information using the first random number to obtain the original information corresponding to the encoded information; the original information represents the direction of the split.

[0088] CSP will restore each [pi] (r,t) The CSP restores the query direction based on the following formula: [pi] (r,t) This indicates the true [ai] (r,t) ]result.

[0089]

[0090] Reverse means swapping the positions of 1 and 0.

[0091] Step S34: The server determines the ciphertext value of the response based on the direction of the split.

[0092] Specifically, the ciphertext is calculated for each node, and the ciphertexts of the nodes on each branch are multiplied together to obtain the first calculation result; the first calculation result is multiplied by the weight to obtain the second calculation result; all the second calculation results are added together to obtain the response ciphertext value.

[0093] Specifically, CSP will calculate the ciphertext value [π] of the response:

[0094]

[0095] Step S14: The client decrypts the ciphertext value of the response based on the query key to obtain the query result corresponding to the new information.

[0096] CSP will return the query result [π] to user U, who will then use ssk' to decrypt and obtain the query result π.

[0097] In summary, the secure query method of this application actually includes the following steps:

[0098] Step 1: Query request. The initiator uses the SHE key ssk to encrypt relevant information and sends it to the user (U) and CSP. At the same time, it sends another pair of SHE keys ssk′ as the query key to U. U uses the query key to encrypt the data and sends it to CSP.

[0099] Step 2: Inadvertently querying, CSP calculates the ciphertext features and optimal split ciphertext features of U, obfuscates them, and sends them to the initiator. The initiator uses ssk′ to encrypt the query direction and sends it to CSP. CSP restores the true encrypted direction. CSP multiplies each ciphertext direction and finally multiplies it by the weight of each node to obtain the response ciphertext value.

[0100] Step 3: Query response. The CSP sends the encrypted value to the user, who then uses ssk' to decrypt and obtain the query result.

[0101] Furthermore, the secure query method of this application is based on a secure query model, therefore, it is necessary to train the secure query model. The specific process includes:

[0102] Step S1: System initialization. Participants reach a consensus on the model parameters. At the same time, the active party (participant with labels) selects secure parameters, generates a bucket information encryption key and a weight encryption key, and sends the relevant keys to other participants (passive parties), the cloud server (CSP), and the query user.

[0103] Step S2: Data bucketing and sharing. The passive party buckets its local data to obtain a Boolean matrix. At the same time, it uses the idea of ​​secret sharing to divide the matrix into two parts. One part is sent to the active party, and the other part is encrypted using function encryption (FE) to obtain the key. The key and bucketing information are then sent to the CSP.

[0104] Step S3: Find the optimal split point. The active party uses FE to encrypt gradient information and sends the relevant information to CSP. CSP decrypts the information through FE to obtain the summed gradient value and calculates the maximum gain.

[0105] Step S4: Model update. The CSP sends the point information with the maximum gain and the bucket bit to the active party. The active party uses the point information to update the tree model and uses the bucket bit to update the bucket information for the next round of training.

[0106] Step S5: Training complete. Determine if model training is complete. If not, repeat steps three and four. If complete, stop iterative training. The participants encrypt all optimal split points using SHE and send the ciphertext value to the CSP for query service.

[0107] The advantages and positive effects of this invention are as follows: This invention achieves high-precision boosting trees on vertically partitioned data. Considering that the training process of the tree model is only related to a fixed data order, a bucket-sharing algorithm is first designed to share data buckets containing partial features of participants. This algorithm eliminates the need for each participant to remain active throughout the entire model training process. Then, based on the shared bucket information, an optimal split-find algorithm is proposed to achieve a high-precision global model training process.

[0108] This invention protects privacy during both model training and querying. By applying function encryption to the optimal split-find algorithm, this invention effectively protects the privacy of training data, bucket information, and split information. Furthermore, this invention designs an inadvertent query algorithm that performs model queries on SHE ciphertext, achieving privacy protection for both the model query data and the query results.

[0109] This invention is highly efficient. In this invention, participants do not need to engage in multiple rounds of interaction, and most time-consuming computational operations are handled by a high-performance cloud service provider (CSP), which significantly improves training efficiency.

[0110] This invention is applicable to collaborative training and processing scenarios with multiple data sources distributed over a wide area. By utilizing the ideas of function encryption, partial homomorphic schemes, and secret sharing, it proposes an XGBoost model training and service process suitable for vertical federation scenarios. It can achieve low computational and communication overhead during both model training and querying, and can solve the data security problem in vertical federation scenarios.

[0111] Furthermore, this application also provides a secure query system; please refer to [link / reference]. Figure 4 The secure query system comprises: an initiating party, a client, and a server. The initiating party owns the data and data tags, handles the generation of model parameters and key parameters, leads the entire model training process, and can obtain the trained model locally, while providing secure query services to users. The server (CSP) is responsible for assisting in model training and providing query services for the model. The client (U, QueryUser) is a user who wants to securely obtain query results from the trained model, and only U is aware of the query results; neither the initiating party nor the CSP knows the results.

[0112] Furthermore, the secure query system also includes a passive party. The passive party is the owner of the data (without labels), assists the active party in training the model, only encrypts and sends the local bucket information, does not obtain the model, and does not participate in the query service process.

[0113] In one embodiment, the active party includes:

[0114] The model parameter initialization module is used to select model parameters (including the maximum depth of the tree, number of trees, learning rate, regularization parameters, etc.). Different model parameters will result in different model accuracy and will also affect the model's computational cost.

[0115] The security parameter selection module is used to select secure key parameters (including function encryption parameters and partial homomorphic encryption parameters). The security coefficient is selected according to different needs. The larger the security coefficient, the better the security performance of the system, but the greater the computational overhead of the system.

[0116] The key generation module is used to complete the system key initialization and generate the FE key for encrypting passive party bucket information and the SHE key for encrypting feature information.

[0117] The key distribution module discloses the system security parameters and sends the generated key to all passive parties and querying users.

[0118] The model training module, in conjunction with CSP, completes the model training process and generates a high-precision XGBoost model locally.

[0119] The Unintentional Query module provides a safe prediction function for query users through a local XGBoost model.

[0120] The passive party includes:

[0121] The data bucketing module is used to sort and bucket local data to obtain a Boolean bucketing matrix.

[0122] The bucket sharing module securely divides the Boolean bucket matrix into two parts, ensuring that neither part can directly derive the actual bucket information. At the same time, it uses function encryption to generate a key for one bucket matrix and send it to the CSP, while the other part is sent directly to the initiator.

[0123] CSP includes:

[0124] The model training module accepts the FE keys and bucket information from all passive parties, while assisting the active party in completing the secure training of the XGBoost model.

[0125] The Unintentional Query module assists the initiating party in providing a safe predictive function for query users.

[0126] The users being queried include:

[0127] The encryption module is used to encrypt the predicted data and protect user data privacy.

[0128] The unintentional query module requests services from the initiating party, obtains the encryption key, and simultaneously performs secure data prediction to obtain encrypted prediction results, thus protecting the privacy of the query results.

[0129] The decryption module decrypts the query results to obtain accurate prediction results.

[0130] For the collaborative relationships among the active party, client, server, and passive party modules, please refer to [link / reference needed]. Figure 7 .

[0131] Please see Figure 5 This application also provides a schematic diagram of an electronic device, including a memory 52 and a processor 51 connected to each other.

[0132] The memory 52 is used to store program instructions for implementing any of the above methods.

[0133] Processor 51 is used to execute program instructions stored in memory 52.

[0134] The processor 51 can also be referred to as a CPU (Central Processing Unit). The processor 51 may be an integrated circuit chip with signal processing capabilities. The processor 51 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor.

[0135] The memory 52 can be a memory module, TF card, etc., and can store all information in the smart terminal, including raw input data, computer programs, intermediate running results, and final running results. It stores and retrieves information according to the location specified by the controller. With memory, the smart terminal has a memory function and can ensure normal operation. Memory in a smart terminal can be classified according to its purpose into main memory (RAM) and auxiliary memory (external storage), or it can be classified into external memory and internal memory. External storage is usually magnetic media or optical discs, which can store information for a long time. RAM refers to the storage components on the motherboard, used to store currently executing data and programs, but it is only used for temporary storage; the data will be lost when the power is turned off.

[0136] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0137] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0138] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0139] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, system server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application.

[0140] Please see Figure 6This is a schematic diagram of the structure of the storage medium of the present invention. The storage medium of this application stores a program file 61 capable of implementing all the above methods. The program file 61 can be stored in the storage medium in the form of a software product, including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of each embodiment of this application. The aforementioned storage device includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.

[0141] The above are merely embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A secure query method, characterized in that, The method includes: The initiating party uses the encryption key to generate a first encryption parameter and sends the first encryption parameter to the client and the server, and generates a query key and sends the query key to the client; The client encrypts the query information based on the query key, obtains encrypted information, and sends the encrypted information to the server; The server processes the encrypted information based on a secure query model to obtain a ciphertext response value, and then sends the ciphertext response value to the client. The client decrypts the ciphertext value of the response based on the query key to obtain the query result corresponding to the novelty information; The active party generates a bucket information encryption key and a weight encryption key, and sends the bucket information encryption key and the weight encryption key to the passive party, the server and the client respectively; The passive party buckets the local data to obtain a Boolean matrix, divides the Boolean matrix into a first Boolean matrix and a second Boolean matrix, and sends the first Boolean matrix to the active party and the second Boolean matrix to the server; the active party uses a first encryption function to encrypt the first Boolean matrix to obtain a key, and sends the key to the server; The active party uses the first encryption function to encrypt the gradient information to obtain the first ciphertext, and sends the first ciphertext to the server; The server decrypts the first ciphertext based on the first encryption function to obtain the gradient information, determines the maximum gain based on the gradient information, and sends the point information and bucket bits corresponding to the maximum gain to the active party. The active party uses the point information to update the tree model and updates the bucket information for the next round of training through the bucket bits; The passive party uses the second encryption function to encrypt the optimal split point to obtain the second ciphertext, and sends the second ciphertext to the server; The steps of the server processing the encrypted information based on a secure query model to obtain a ciphertext response value and sending the ciphertext response value to the client include: The server compares the encrypted information with the optimal splitting threshold to determine the query symbol, and generates a first random number and a second random number for each query symbol. Based on the first random number and the second random number, the server processes the query symbol to obtain obfuscated information, and sends the obfuscated information to the initiating party. The active party uses the encryption key to decrypt the obfuscated information to obtain first decrypted information, encodes the first decrypted information to obtain encoded information, and sends the encoded information to the server. The server processes the encoded information using the first random number to obtain the original information corresponding to the encoded information; the original information represents the direction of the split. The server determines the ciphertext value of the response based on the direction of the split.

2. The secure query method according to claim 1, characterized in that, The step of the active party generating a bucket information encryption key and a weight encryption key, and sending the bucket information encryption key and the weight encryption key to the passive party, the server, and the client respectively, includes: The active party executes a first encryption function to generate a master key pair and executes a second encryption function to generate a symmetric key; it uses the symmetric key to encrypt a preset value twice and calculates encryption parameters for each passive party; and it sends the master key and the encryption parameters in the master key pair to each passive party, the server, and the client; wherein the master key is the bucket information encryption key and the encryption parameters are the weight encryption key.

3. The secure query method according to claim 1, characterized in that, The step of the active party encrypting gradient information using the first encryption function to obtain first ciphertext and sending the first ciphertext to the server includes: The active party determines a first gradient and a second gradient; Calculate the first gradient sum of the first gradient and the second gradient sum of the second gradient; The first gradient sum and the second gradient sum are encrypted using the first encryption function, and the first ciphertext is sent to the server. The first ciphertext includes: the first gradient sum, the second gradient sum, the encryption information of the first gradient sum, and the encryption information of the second gradient sum.

4. The secure query method according to claim 1, characterized in that, The step of the server decrypting the first ciphertext based on the first encryption function to obtain the gradient information and the maximum gain corresponding to the gradient value includes: The active party calculates a first shared parameter for the d-th data feature of any of the passive parties based on the first Boolean matrix, and sends the first shared parameter to the server; The server calculates the second shared parameter based on the second Boolean matrix; The server decrypts the first ciphertext based on the first encryption function to obtain a first gradient sum and a second gradient sum; The server determines the maximum gain based on the first shared parameter, the second shared parameter, the first gradient, and the second gradient.

5. The secure query method according to claim 1, characterized in that, The step of the server determining the ciphertext value of the response based on the direction of the split includes: Calculate the ciphertext for each node, and multiply the ciphertexts of the nodes on each branch to obtain the first calculation result; Multiply the first calculation result by the weight to obtain the second calculation result; Add all the second calculation results together to obtain the ciphertext value of the response.

6. A secure query system, characterized in that, include: The active party is used to generate a first encryption parameter using an encryption key and send the first encryption parameter to the client and the server, and to generate a query key and send the query key to the client; The client encrypts the query information based on the query key, obtains encrypted information, and sends the encrypted information to the server; And based on the query key, the ciphertext value of the response is decrypted to obtain the query result corresponding to the novelty information; The server processes the encrypted information based on a secure query model to obtain a ciphertext response value, and then sends the ciphertext response value to the client. The active party generates a bucket information encryption key and a weight encryption key, and sends the bucket information encryption key and the weight encryption key to the passive party, the server and the client respectively; The passive party buckets its local data to obtain a Boolean matrix, divides the Boolean matrix into a first Boolean matrix and a second Boolean matrix, and sends the first Boolean matrix to the active party and the second Boolean matrix to the server. The active party uses a first encryption function to encrypt the first Boolean matrix to obtain a key, and then sends the key to the server; The active party uses the first encryption function to encrypt the gradient information to obtain the first ciphertext, and sends the first ciphertext to the server. The server decrypts the first ciphertext based on the first encryption function to obtain the gradient information, determines the maximum gain based on the gradient information, and sends the point information and bucket bits corresponding to the maximum gain to the active party. The active party uses the point information to update the tree model and updates the bucket information for the next round of training through the bucket bits; The passive party uses a second encryption function to encrypt the optimal split point to obtain a second ciphertext, and then sends the second ciphertext to the server. The steps of the server processing the encrypted information based on a secure query model to obtain a ciphertext response value and sending the ciphertext response value to the client include: The server compares the encrypted information with the optimal splitting threshold to determine the query symbol, and generates a first random number and a second random number for each query symbol. Based on the first random number and the second random number, the server processes the query symbol to obtain obfuscated information, and sends the obfuscated information to the initiating party. The active party uses the encryption key to decrypt the obfuscated information to obtain first decrypted information, encodes the first decrypted information to obtain encoded information, and sends the encoded information to the server. The server processes the encoded information using the first random number to obtain the original information corresponding to the encoded information; the original information represents the direction of the split. The server determines the ciphertext value of the response based on the direction of the split.

7. An electronic device, characterized in that, The electronic device includes a processor and a memory, wherein, The memory is used to store program instructions for constructing a method that implements the secure query method as described in any one of claims 1 to 5; The processor is used to execute the program instructions stored in the memory.

8. A storage medium, characterized in that, The system contains a program file that can be executed to implement the secure query method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for optimizing tree model training and longitudinal federated learning system

    CN113537333A

  • Data query method and device

    CN115065457A