Data encryption method, federated modeling method, device and computer equipment
The random number set is generated through the blinding and signature operations of RSA public-private key pairs, which solves the problem of intersection ID and internal data leakage in vertical federated modeling, and achieves more efficient privacy protection and security modeling.
Patent Information
- Application Number
- CN202111507067.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-12-10
AI Technical Summary
During vertical federal modeling in the prior art, the problems of intersection ID and internal data leakage lead to high risks in enterprise information security.
Data is encrypted using RSA public and private keys, and random number collections are generated through blinding, signature and blind signature operations, and privacy interception and secret splitting are performed to reduce the risk of intersection ID and internal data leakage.
Effectively protect the privacy of both parties involved, reduce the possibility of intersection ID and internal data leakage, and improve computing efficiency and the security of modeling processes.
Smart Images

Figure CN114417364B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data encryption technology, and in particular to a data encryption method, a federated modeling method, an apparatus, and a computer device. Background Art
[0002] With the rapid development of machine learning, it is being applied to various fields. In particular, some specialized scenarios require the application of machine learning to protect the intersection IDs of both parties and to establish modeling based on this. For example, an insurance company possesses insurance product purchase data for a majority of users in the industry. Another insurance company hopes to use its internal customer data to build a precision marketing model to predict whether its customers will purchase a specific insurance product. However, due to a lack of sufficient data, a federated learning model is needed to be established with another company that possesses the majority of insurance product purchase data for the industry.
[0003] In existing technical solutions, when conducting vertical federated modeling, it is necessary to perform privacy-safe intersection calculations on both sides of the modeling to complete the samples, and then perform feature preprocessing operations and subsequent modeling. This method will cause the intersection ID and internal data of both parties to be leaked. For enterprises, the leakage of corporate information and corresponding internal data indicates that there are major security vulnerabilities within the enterprise. Summary of the Invention
[0004] Therefore, the technical problem to be solved by the present invention is to overcome the problem of leaking the intersection ID of both parties when performing privacy-safe intersection calculation in the prior art, thereby providing a data encryption method, a federal modeling method, an apparatus and a computer device.
[0005] According to a first aspect, an embodiment of the present invention provides a data encryption method, including: generating an RSA public-private key pair, and sending the RSA public key to a second client; obtaining second encrypted data obtained by the second client by blinding a second user ID based on the RSA public key; using the RSA private key to sign the first user ID to obtain first encrypted data, and blind signing the second encrypted data to obtain third encrypted data, and sending the first encrypted data and the third encrypted data to the second client; obtaining a random number set generated by the second client based on the first encrypted data and the third encrypted data; and mapping and associating the random number set with the first encrypted data.
[0006] Optionally, the process of generating a random number set by the second client based on the first encrypted data and the third encrypted data includes: performing a deblinding operation on the third encrypted data to obtain third decrypted data, performing an intersection operation on the third decrypted data and the first encrypted data to obtain a privacy intersection result; secretly splitting the privacy intersection result to generate a first random number subset corresponding to the privacy intersection result, and generating a second random number subset corresponding to data in the third encrypted data that is not in the privacy intersection result; generating a second intersection result based on the first encrypted data, the first random number subset and the second random number subset, and generating the random number set based on the first random number subset and the second random number subset.
[0007] According to the second aspect, an embodiment of the present invention provides a data encryption device, including: a communication unit, used to generate an RSA public-private key pair, and send the RSA public key to a second client; a first encryption unit, used to obtain second encrypted data obtained by the second client based on the RSA public key to blind the second user ID; a second encryption unit, used to use the RSA private key to sign the first user ID to obtain first encrypted data, and blindly sign the second encrypted data to obtain third encrypted data, and send the first encrypted data and the third encrypted data to the second client; a third encryption unit, used to obtain a random number set generated by the second client based on the first encrypted data and the third encrypted data; an association unit, used to map and associate the random number set with the first encrypted data.
[0008] According to the third aspect, an embodiment of the present invention provides a data encryption method, including: obtaining an RSA public key sent by a first client, performing a blind operation on a first user ID based on the RSA public key to obtain second encrypted data, and sending the second encrypted data to the first client; obtaining third encrypted data obtained by the first client based on a blind signature of the second encrypted data, and first encrypted data obtained by the first client signing the first user ID using an RSA private key; generating a random number set based on the first encrypted data and the third encrypted data, and sending the random number set to the first client, so that the first client maps and associates the random number set with the first encrypted data.
[0009] Optionally, generating a random number set based on the first encrypted data and the third encrypted data includes: performing a deblinding operation on the third encrypted data to obtain third decrypted data, performing an intersection operation on the third decrypted data and the first encrypted data to obtain a private intersection result; secretly splitting the private intersection result to generate a first random number subset corresponding to the private intersection result, and generating a second random number subset corresponding to data in the third encrypted data that is not in the private intersection result; generating a second intersection result based on the first encrypted data, the first random number subset and the second random number subset, and generating the random number set based on the first random number subset and the second random number subset.
[0010] Optionally, the first random number subset includes a first random number set generated by secretly splitting the privacy intersection result, and the complement of the first random number set; the second random number subset includes a second random number set corresponding to the number of data in the third encrypted data that is not in the privacy intersection result, and a negative set of random numbers in the second random number set; generating the random number set based on the first random number subset and the second random number subset includes: generating the random number set based on the complement of the first random number set and the negative set.
[0011] According to the fourth aspect, an embodiment of the present invention provides a data encryption device, including: a fourth encryption unit, used to obtain an RSA public key sent by a first client, perform a blind operation on a first user ID based on the RSA public key to obtain second encrypted data, and send the second encrypted data to the first client; a fifth encryption unit, used to obtain third encrypted data obtained by the first client based on a blind signature of the second encrypted data, and first encrypted data obtained by the first client signing the first user ID using an RSA private key; a second association unit, used to generate a random number set based on the first encrypted data and the third encrypted data, and send the random number set to the first client, so that the first client maps and associates the random number set with the first encrypted data.
[0012] According to the fifth aspect, an embodiment of the present invention provides a data federation modeling method, including: obtaining feature preprocessing data of a first client based on feature preprocessing of a random number set, wherein the random number set is generated using the data encryption method described in any one of the above embodiments; obtaining preset sample data, wherein the sample data is plain text; inputting the preset sample data into a preset federation model to obtain a prediction result; determining a deviation result based on the feature preprocessing data and the prediction result; adjusting parameters of the preset federation model based on the deviation result to construct a federation model.
[0013] Optionally, the feature preprocessing method includes: adding the corresponding random number sets to obtain feature preprocessing data.
[0014] According to the sixth aspect, an embodiment of the present invention provides a data federation modeling device, comprising: a data processing unit, which obtains feature preprocessing data of a first client based on feature preprocessing of a random number set, wherein the random number set is generated using the data encryption method described in any one of the above embodiments; a first communication unit, which is used to obtain preset sample data, wherein the sample data is plaintext data; a second communication unit, which is used to input the preset sample data into a preset federation model to obtain a prediction result; a calculation unit, which is used to determine a deviation result based on the feature preprocessing data and the prediction result; and a model construction unit, which is used to adjust parameters of the preset federation model based on the deviation result to construct a federation model.
[0015] According to the seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the data encryption method and federal modeling method described in the above embodiments.
[0016] The technical solution of the present invention has the following advantages:
[0017] Embodiments of the present invention provide a data encryption method, a federated modeling method, an apparatus, and a computer device. The method includes the following steps: a first client generates an RSA public-private key pair, sends the RSA public key to a second client, uses the RSA private key to sign and encrypt a first user ID, and sends the encrypted first encrypted data to the second client; the second client encrypts the second user ID using the RSA public key to obtain second encrypted data, and sends the second encrypted data to the first client; the first client re-encrypts the received second encrypted data to obtain third encrypted data, and sends the third encrypted data and the first encrypted data to the second client; the second client performs a deblinding operation on the third encrypted data to obtain third decrypted data, intersects the third decrypted data with the first encrypted data to obtain a private intersection result, and then secretly splits the private intersection result to generate a first random number set and a second random number set corresponding to the private intersection result; the second client generates a second intersection result based on the first random number set and the second random number set, and sends the random number set generated based on the first random number set and the second random number set to the first client, so that the client can map and associate the random number set with the first encrypted data. By encrypting the data of the two interacting parties multiple times and performing privacy intersection, and mapping and associating the privacy intersection result with the first encrypted data, the risk of leakage of the intersection ID and internal data of the two interacting parties is reduced.
[0018] An embodiment of the present invention provides a data federation modeling method, comprising the following steps: pre-setting sample data, performing feature pre-processing based on a first set of random numbers and a second set of random numbers sent by a first client; comparing the feature pre-processed data with the sample data; and training a model on the feature pre-processed data based on the comparison results to obtain a predicted value; and performing security modeling based on the feature pre-processed data and the predicted value. By comparing the feature pre-processed data with the preset sample data, deviations are obtained, thereby reducing computational steps and improving computational efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 This is a flowchart of a specific example of a data encryption method according to an embodiment of the present invention;
[0021] Figure 2 is a principle block diagram of a specific example of a data encryption device in an embodiment of the present invention;
[0022] Figure 3 This is a flowchart of another specific example of the data encryption method in an embodiment of the present invention;
[0023] Figure 4 is a principle block diagram of another specific example of a data encryption device according to an embodiment of the present invention;
[0024] Figure 5 This is a flowchart of a specific example of the federated modeling method according to an embodiment of the present invention;
[0025] Figure 6 is a principle block diagram of a specific example of a federated modeling device in an embodiment of the present invention;
[0026] Figure 7 This is a principle block diagram of a specific example of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0028] In addition, the technical features involved in different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0029] In an embodiment of the present invention, a first client and a second client encrypt and decrypt interaction data during data interaction, generate a set of random numbers from the interaction data through an unblinding operation after blind signing the interaction data, and finally enhance privacy protection of the first client and the second client during data interaction by processing the random numbers.
[0030] Figure 1 A flow chart of a data encryption method according to an embodiment of the present invention is shown, and the data encryption method includes the following steps:
[0031] S100: Generate an RSA public-private key pair, and send the RSA public key to the second client.
[0032] Specifically, in the embodiment of the present invention, the first client generates a key based on the RSA algorithm, namely an RSA public key and a private key. The RSA public key is public, and the first client sends the RSA public key to the second client.
[0033] S101: Obtain second encrypted data obtained by the second client performing a blinding operation on the second user ID based on the RSA public key.
[0034] S102: Use the RSA private key to sign the first user ID to obtain first encrypted data, and blind sign the second encrypted data to obtain third encrypted data, and send the first encrypted data and the third encrypted data to the second client.
[0035] Specifically, in an embodiment of the present invention, a first client receives second encrypted data obtained by blindly encrypting the second client using the RSA public key, performs a signature encryption operation on its own first user ID using the RSA private key to obtain first encrypted data. The first client then performs a blind signature encryption operation on the received second encrypted data to obtain third encrypted data, and then sends the blind signature-encrypted first and third encrypted data to the second client. In actual applications, the signature encryption operation may be that the first client uses a hash algorithm to obtain a digital digest of its own ID information, and then encrypts the digital digest using the RSA private key to obtain the first encrypted data, but the present invention is not limited to this.
[0036] S103: Obtain a set of random numbers generated by the second client based on the first encrypted data and the third encrypted data.
[0037] S104: Map and associate the random number set with the first encrypted data.
[0038] Specifically, in an embodiment of the present invention, the first client receives a random number set generated by the second client based on the first encrypted data and the third encrypted data, maps and associates the random number set with the first encrypted data, and saves the mapping and association result to the local storage of the first client.
[0039] An embodiment of the present invention provides a data encryption method, which encrypts the interactive information between a first client and a second client, the second client performs a blind signature operation on the second user ID based on the RSA public key generated by the first client, and the first client signs the first user ID owned by itself based on the RSA private key. After the above-mentioned encrypted data is sent to the second client, a random number set generated by the second client based on the above-mentioned encrypted data is received, and the random number set is mapped and associated with the encrypted data generated by the first client based on the RSA private key, thereby reducing the risk of leakage of the intersection ID and internal data of the first client and the second client during the interaction process.
[0040] In an optional embodiment of the present invention, the process of generating a set of random numbers based on the first encrypted data and the third encrypted data by the second client in step S104 specifically includes the following steps:
[0041] (1) performing a deblinding operation on the third encrypted data to obtain third decrypted data, and performing an intersection operation on the third decrypted data and the first encrypted data to obtain a privacy intersection result;
[0042] (2) secretly splitting the private intersection result to generate a first random number subset corresponding to the private intersection result, and generating a second random number subset corresponding to data in the third encrypted data that is not in the private intersection result;
[0043] (3) generating a second intersection result based on the first encrypted data, the first random number subset, and the second random number subset, and generating the random number set based on the first random number subset and the second random number subset.
[0044] In an embodiment of the present invention, the first client performs a deblinding operation on the third encrypted data that has undergone the blind signature encryption operation, decrypts the third encrypted data to obtain third decrypted data, and performs an intersection operation on the third decrypted data and the first encrypted data to obtain a private intersection result. The private intersection result is secretly split using a secret sharing algorithm to generate a first random number subset R corresponding to the private intersection result. I and a second random number subset R corresponding to the data in the third encrypted data that is not in the privacy intersection result NA second intersection result is generated based on the first encrypted data, the first random number subset, and the second random number subset, and the random number set is generated based on the first random number subset and the second random number subset. By further splitting the private intersection result, the privacy protection effect during the interaction between the first and second clients is enhanced, further reducing the possibility of user ID information leakage in special vertical federated modeling scenarios.
[0045] like Figure 2 As shown, this embodiment provides a data encryption device, including a communication unit 1, a first encryption unit 2, a second encryption unit 3, a third encryption unit 4 and an association unit 5, wherein:
[0046] Communication unit 1 is used to generate an RSA public-private key pair and send the RSA public key to the second client. For details, please refer to the description of step S100 in any of the above method embodiments;
[0047] A first encryption unit 2 is configured to obtain second encrypted data obtained by the second client through a blinding operation on the second user ID based on the RSA public key. For details, please refer to the description of step S101 in any of the above method embodiments;
[0048] The second encryption unit 3 is configured to use the RSA private key to sign the first user ID to obtain first encrypted data, blindly sign the second encrypted data to obtain third encrypted data, and send the first encrypted data and the third encrypted data to the second client. For details, please refer to the relevant description of step S102 in any of the above method embodiments;
[0049] The third encryption unit 4 is configured to obtain a set of random numbers generated by the second client based on the first encrypted data and the third encrypted data. For details, please refer to the description of step S103 in any of the above method embodiments.
[0050] The association unit 5 is used to map and associate the random number set with the first encrypted data. For details, please refer to the relevant description of step S104 in any of the above method embodiments.
[0051] An embodiment of the present invention provides a data encryption device, which encrypts the interactive information between a first client and a second client, and the second client performs a blind signature operation on the second user ID based on the RSA public key generated by the first client, and the first client signs the first user ID owned by itself based on the RSA private key. After sending the above-mentioned encrypted data to the second client, the device receives a random number set generated by the second client based on the above-mentioned encrypted data, and maps and associates the random number set with the encrypted data generated by the first client based on the RSA private key, thereby reducing the risk of leakage of the intersection ID and internal data of the first client and the second client during the interaction process.
[0052] like Figure 3 A flow chart of another data encryption method of the present invention is shown, and the data encryption method includes the following steps:
[0053] S200: Obtain an RSA public key sent by the first client, perform a blinding operation on the second user ID based on the RSA public key to obtain second encrypted data, and send the second encrypted data to the first client.
[0054] Specifically, in an embodiment of the present invention, the second client uses the received RSA public key to encrypt the second user ID information owned by the second client, blinds the second user ID information to obtain second encrypted data, and sends the second encrypted data to the first client. In practical applications, the blinding operation can, for example, involve randomly selecting a number, referred to as a blinding factor, digitizing the user's own ID information, and then multiplying it by the blinding factor to encrypt the user's own ID information, although the present invention is not limited to this.
[0055] S201: Obtain third encrypted data obtained by the first client through blind signing based on the second encrypted data, and first encrypted data obtained by the first client through signing the first user ID using an RSA private key.
[0056] S202: Generate a random number set based on the first encrypted data and the third encrypted data, and send the random number set to the first client, so that the first client maps and associates the random number set with the first encrypted data.
[0057] Specifically, in an embodiment of the present invention, the second client receives the third encrypted data obtained by the first client by blind signing the second encrypted data, and the first encrypted data obtained by the first client by encrypting and signing the first user ID it owns using the RSA private key, and generates a random number set based on the first encrypted data and the third encrypted data, and sends the random number set to the first client, so that the first client can use the random number set to map and associate with the first encrypted data.
[0058] An embodiment of the present invention provides a data encryption method, which obtains an RSA public key sent by a first client, and performs a blind encryption operation on a second user ID owned by the client based on the RSA public key to obtain second encrypted data, and sends the second encrypted data to the first client, obtains third encrypted data obtained by the first client using the second encrypted data for a blind signature encryption operation, and the first client uses the RSA private key to sign the first user ID owned by the client to obtain the first encrypted data, and finally generates a random number set based on the first encrypted data and the third encrypted data, and sends the random number set to the first client, so that the first client can map and associate it with the first encrypted data based on the random number set. This embodiment reduces the risk of leakage of the intersection ID and internal data of the first and second clients during the interaction process by performing a blind encryption operation on the interaction data sent by the first client through the second client.
[0059] In an optional embodiment of the present invention, the step of generating a set of random numbers based on the first encrypted data and the third encrypted data in step S202 specifically includes:
[0060] (1) performing a deblinding operation on the third encrypted data to obtain third decrypted data, and performing an intersection operation on the third decrypted data and the first encrypted data to obtain a privacy intersection result;
[0061] (2) secretly splitting the private intersection result to generate a first random number subset corresponding to the private intersection result, and generating a second random number subset corresponding to data in the third encrypted data that is not in the private intersection result;
[0062] (3) generating a second intersection result based on the first encrypted data, the first random number subset, and the second random number subset, and generating the random number set based on the first random number subset and the second random number subset.
[0063] In an embodiment of the present invention, the first client performs a deblinding operation on the third encrypted data that has undergone the blind signature encryption operation, decrypts the third encrypted data to obtain third decrypted data, and performs an intersection operation on the third decrypted data and the first encrypted data to obtain a private intersection result. The private intersection result is secretly split using a secret sharing algorithm to generate a first random number subset R corresponding to the private intersection result. I and a second random number subset R corresponding to the data in the third encrypted data that is not in the privacy intersection result N A second intersection result is generated based on the first encrypted data, the first random number subset, and the second random number subset, and the random number set is generated based on the first random number subset and the second random number subset. By further splitting the private intersection result, the privacy protection effect during the interaction between the first and second clients is enhanced, further reducing the possibility of user ID information leakage in special vertical federated modeling scenarios.
[0064] Specifically, the first random number subset includes a first random number set generated by secret splitting the privacy intersection result and a complement of the first random number set, wherein the secret splitting is performed based on a secret sharing algorithm to split the privacy intersection result into first random number sets R corresponding to the privacy intersection result. I , and the complement of the first random number set R′ I , which is R I +R′ I =1; the second random number subset includes a second random number set R corresponding to the number of data in the third encrypted data that is not in the privacy intersection result. N , and the negative number set R′ of the random numbers in the second random number set N , which is R′ N =-R N , based on the complement of the first random number set R I ', and the negative number set R' N Generate a random number set [(R′ I , R′ N )].
[0065] like Figure 4 As shown, this embodiment provides another data encryption device, including: a fourth encryption unit 6, a fifth encryption unit 7 and a second association unit 8, wherein:
[0066] a fourth encryption unit 6, configured to obtain an RSA public key sent by the first client, perform a blinding operation on the first user ID based on the RSA public key to obtain second encrypted data, and send the second encrypted data to the first client. For details, refer to the description of step S200 in any of the above method embodiments;
[0067] a fifth encryption unit 7, configured to obtain third encrypted data obtained by the first client blindly signing the second encrypted data, and first encrypted data obtained by the first client signing the first user ID using the RSA private key. For details, refer to the description of step S201 in any of the above method embodiments;
[0068] The second association unit 8 is used to generate a random number set based on the first encrypted data and the third encrypted data, and send the random number set to the first client so that the first client maps and associates the random number set with the first encrypted data. For details, please refer to the relevant description of step S202 of any of the above method embodiments.
[0069] An embodiment of the present invention provides a data encryption device, and an embodiment of the present invention provides a data encryption method, which obtains an RSA public key sent by a first client, and performs a blind encryption operation on a second user ID owned by itself based on the RSA public key to obtain second encrypted data, and sends the second encrypted data to the first client, obtains the third encrypted data obtained by the first client using the second encrypted data for a blind signature encryption operation, and the first client uses the RSA private key to sign the first user ID owned by it to obtain the first encrypted data, and finally generates a random number set based on the first encrypted data and the third encrypted data, and sends the random number set to the first client, so that the first client can map and associate it with the first encrypted data based on the random number set. This embodiment reduces the risk of leakage of the intersection ID and internal data of the first and second clients during the interaction process by performing a blind encryption operation on the interaction data sent by the first client through the second client.
[0070] like Figure 5 A flowchart of a data federation modeling method of the present invention is shown, and the data federation modeling method includes the following steps:
[0071] S300: Acquire feature preprocessed data after feature preprocessing based on a random number set by the first client, where the random number set is generated using the data encryption method described in any one of the above embodiments;
[0072] S301: Acquire preset sample data, where the sample data is plain text;
[0073] S302: Inputting a preset federated model based on preset sample data to obtain a prediction result;
[0074] S303: Determine a deviation result based on the feature preprocessing data and the prediction result;
[0075] S304: Adjust the parameters of the preset federation model based on the deviation result to construct a federation model.
[0076] Specifically, in an embodiment of the present invention, the second client obtains feature preprocessing data obtained by preprocessing the random number set generated by the first client based on the data encryption method described in the above embodiment, and presets sample data, which is plaintext Y. Based on the preset sample data, a preset federated model is input to obtain a prediction result Y′. By subtracting the feature preprocessing data from the prediction result Y′, the deviation result can be determined. Based on the deviation result, the preset federated model is adjusted to construct a federated model. In practical applications, the federated model can be an LR / Xgboost model, but the present invention is not limited to this.
[0077] Specifically, the first client's process of preprocessing the random number set features is to add the corresponding random number sets generated by the data encryption method described in the above embodiment and compare them with the preset sample data. When the preset sample data Y=1, the corresponding random number set feature preprocessing process is R I +R′ I =1, when the preset sample data Y=0, the corresponding random number set feature preprocessing process is R N +R′ N =0.
[0078] An embodiment of the present invention provides a federated modeling method, which obtains feature preprocessing data of a first client based on feature preprocessing of a random number set, wherein the random number set is generated using the data encryption method described in any one of the above embodiments, and inputs preset sample data into a preset federated model, and trains the federated model to obtain a prediction result, compares the feature preprocessing data with the preset sample data, determines a deviation result by comparing the feature preprocessing data corresponding to the sample data with the prediction result, adjusts the parameters of the preset federated model based on the deviation result, and constructs a federated model. By preprocessing the features of the random number set generated by the above data encryption method, a suitable federated model is constructed, which makes little change to the current federated learning system and algorithm, is simple to calculate, and improves the efficiency of the modeling process.
[0079] like Figure 6As shown, this embodiment provides a federated modeling device, including a data processing unit 9, a first communication unit 10, a second communication unit 11, a calculation unit 12 and a model building unit 13, wherein:
[0080] A data processing unit 9 is configured to obtain feature preprocessed data from the first client after feature preprocessing based on a random number set, wherein the random number set is generated using the data encryption method described in any of the above embodiments. For details, please refer to the description of step S300 in any of the above method embodiments.
[0081] The first communication unit 10 is used to obtain preset sample data, where the sample data is plain text data. For details, please refer to the description of step S301 in any of the above method embodiments;
[0082] The second communication unit 11 is configured to input the preset sample data into a preset federated model to obtain a prediction result. For details, please refer to the description of step S302 in any of the above method embodiments.
[0083] A calculation unit 12 is configured to determine a deviation result based on the feature preprocessing data and the prediction result. For details, please refer to the description of step S303 in any of the above method embodiments.
[0084] The model building unit 13 is used to adjust the parameters of the preset federated model based on the deviation result to build a federated model. For details, please refer to the relevant description of step S304 of any of the above method embodiments.
[0085] An embodiment of the present invention provides a federated modeling device, which obtains feature preprocessing data of a first client based on feature preprocessing of a random number set, wherein the random number set is generated using the data encryption method described in any one of the above embodiments, and inputs preset sample data into a preset federated model, and trains the federated model to obtain a prediction result, compares the feature preprocessing data with the preset sample data, determines a deviation result by comparing the feature preprocessing data corresponding to the sample data with the prediction result, adjusts the parameters of the preset federated model based on the deviation result, and constructs a federated model. By preprocessing the features of the random number set generated by the above data encryption method, a suitable federated model is constructed, which makes little change to the current federated learning system and algorithm, is simple to calculate, and improves the efficiency of the modeling process.
[0086] The specific limitations and beneficial effects of the data encryption device and federated modeling device can be found in the above-mentioned limitations on the data encryption method and federated modeling method, and will not be further elaborated here. The various units of the aforementioned data encryption device and federated modeling device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the aforementioned units can be embedded in or independent of a processor in an electronic device in hardware form, or can be stored in a memory in the electronic device in software form, so that the processor can call and execute the corresponding operations of each of the aforementioned units.
[0087] The embodiment of the present invention also provides a computer device, such as Figure 7 As shown, Figure 7 It is a structural diagram of a computer device provided by an optional embodiment of the present invention. The computer device may include at least one processor 41, at least one communication interface 42, at least one communication bus 43 and at least one memory 44, wherein the communication interface 42 may include a display screen (Display), a keyboard (Keyboard), and the optional communication interface 42 may also include a standard wired interface and a wireless interface. The memory 44 may be a high-speed RAM memory (Random Access Memory, volatile random access memory) or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 44 may optionally be at least one storage device located away from the aforementioned processor 41. The processor 41 may be combined with Figure 2 、 Figure 4 and Figure 6 In the described apparatus, the memory 44 stores an application program, and the processor 41 calls the program code stored in the memory 44 to execute the steps of the method in any of the above method embodiments.
[0088] The communication bus 43 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The communication bus 43 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0089] Among them, the memory 44 may include a volatile memory (English: volatile memory), such as a random-access memory (English: random-access memory, abbreviated: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated: HDD) or a solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 44 may also include a combination of the above types of memory.
[0090] The processor 41 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP.
[0091] The processor 41 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0092] Optionally, the memory 44 is also used to store program instructions. The processor 41 can call the program instructions to implement the present invention. Figure 1 The data encryption method shown in the embodiment.
[0093] An embodiment of the present invention further provides a non-transitory computer storage medium, wherein the computer storage medium stores computer-executable instructions, and the computer-executable instructions can execute the method in any of the above method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk drive (HDD) or a solid-state drive (SSD); the storage medium can also include a combination of the above types of memory.
[0094] Obviously, the above embodiments are merely examples for clarity of explanation and are not intended to limit the implementation methods. Those skilled in the art will readily appreciate that other variations or modifications based on the above descriptions are possible. It is not necessary and impossible to enumerate all implementation methods here. Obvious variations or modifications arising therefrom remain within the scope of protection of the present invention.
Claims
1. A data encryption method, characterized in that: include: Generate an RSA public-private key pair and send the RSA public key to the second client; Obtain second encrypted data obtained by the second client performing a blinding operation on the second user ID based on the RSA public key; Sign the first user ID using the RSA private key to obtain first encrypted data, blind-sign the second encrypted data to obtain third encrypted data, and send the first encrypted data and the third encrypted data to the second client; Obtain a set of random numbers generated by the second client based on the first encrypted data and the third encrypted data; Mapping and associating the random number set with the first encrypted data; The process of generating, by the second client, a set of random numbers based on the first encrypted data and the third encrypted data includes: performing a deblinding operation on the third encrypted data to obtain third decrypted data, and performing an intersection operation on the third decrypted data and the first encrypted data to obtain a privacy intersection result; Secretly splitting the private intersection result to generate a first random number subset corresponding to the private intersection result, and generating a second random number subset corresponding to data in the third encrypted data that is not in the private intersection result; A second intersection result is generated based on the first encrypted data, the first random number subset, and the second random number subset, and the random number set is generated based on the first random number subset and the second random number subset.
2. A data encryption device, characterized in that: include: a communication unit, configured to generate an RSA public-private key pair and send the RSA public key to the second client; A first encryption unit is configured to obtain second encrypted data obtained by the second client performing a blinding operation on the second user ID based on the RSA public key; a second encryption unit, configured to sign the first user ID using an RSA private key to obtain first encrypted data, blind-sign the second encrypted data to obtain third encrypted data, and send the first encrypted data and the third encrypted data to the second client; a third encryption unit, configured to obtain a random number set generated by the second client based on the first encrypted data and the third encrypted data; wherein the process of the second client generating the random number set based on the first encrypted data and the third encrypted data comprises: performing a deblinding operation on the third encrypted data to obtain third decrypted data, performing an intersection operation on the third decrypted data and the first encrypted data to obtain a private intersection result; secretly splitting the private intersection result to generate a first random number subset corresponding to the private intersection result, and generating a second random number subset corresponding to data in the third encrypted data that is not included in the private intersection result; generating a second intersection result based on the first encrypted data, the first random number subset, and the second random number subset, and generating the random number set based on the first random number subset and the second random number subset; An associating unit is used to map and associate the random number set with the first encrypted data.
3. A data encryption method, characterized in that: include: Obtaining the RSA public key sent by the first client, performing a blinding operation on the second user ID based on the RSA public key to obtain second encrypted data, and sending the second encrypted data to the first client; Obtain third encrypted data obtained by the first client blindly signing the second encrypted data, and first encrypted data obtained by the first client signing the first user ID using the RSA private key; generating a random number set based on the first encrypted data and the third encrypted data, and sending the random number set to the first client, so that the first client maps and associates the random number set with the first encrypted data; Generating a set of random numbers based on the first encrypted data and the third encrypted data includes: performing a deblinding operation on the third encrypted data to obtain third decrypted data, and performing an intersection operation on the third decrypted data and the first encrypted data to obtain a privacy intersection result; Secretly splitting the private intersection result to generate a first random number subset corresponding to the private intersection result, and generating a second random number subset corresponding to data in the third encrypted data that is not in the private intersection result; A second intersection result is generated based on the first encrypted data, the first random number subset, and the second random number subset, and the random number set is generated based on the first random number subset and the second random number subset.
4. The data encryption method according to claim 3, wherein: The first random number subset includes a first random number set generated by secretly splitting the private intersection result, and a complement of the first random number set; The second random number subset includes a second random number set corresponding to the number of data in the third encrypted data that is not in the private intersection result and a negative number set of random numbers in the second random number set; Generating the random number set based on the first random number subset and the second random number subset includes: The set of random numbers is generated based on the complement of the first set of random numbers and the negative set of numbers.
5. A data encryption device, characterized in that: include: a fourth encryption unit, configured to obtain an RSA public key sent by the first client, perform a blinding operation on the second user ID based on the RSA public key to obtain second encrypted data, and send the second encrypted data to the first client; a fifth encryption unit, configured to obtain third encrypted data obtained by the first client performing a blind signature based on the second encrypted data, and first encrypted data obtained by the first client signing the first user ID using the RSA private key; A second association unit is configured to generate a random number set based on the first encrypted data and the third encrypted data, and send the random number set to the first client so that the first client maps and associates the random number set with the first encrypted data; wherein, generating the random number set based on the first encrypted data and the third encrypted data includes: performing a deblinding operation on the third encrypted data to obtain third decrypted data, performing an intersection operation on the third decrypted data and the first encrypted data to obtain a privacy intersection result; secretly splitting the privacy intersection result to generate a first random number subset corresponding to the privacy intersection result, and generating a second random number subset corresponding to data in the third encrypted data that is not in the privacy intersection result; generating a second intersection result based on the first encrypted data, the first random number subset, and the second random number subset, and generating the random number set based on the first random number subset and the second random number subset.
6. A data federation modeling method, characterized in that: include: Obtaining feature preprocessed data of the first client after feature preprocessing based on a random number set, wherein the random number set is generated using the data encryption method according to any one of claims 3 to 4; Obtaining preset sample data, where the sample data is plain text; Inputting the preset sample data into a preset federated model to obtain a prediction result; Determining a deviation result based on the feature preprocessing data and the prediction result; Based on the deviation result, the preset federal model is adjusted to construct a federal model.
7. The data federation modeling method according to claim 6, characterized in that: The feature preprocessing method includes: Add the corresponding random number sets to obtain feature preprocessing data.
8. A data federation modeling device, characterized in that: include: A data processing unit, configured to obtain feature preprocessed data from the first client after feature preprocessing based on a random number set, wherein the random number set is generated using the data encryption method according to any one of claims 3 to 4; A first communication unit is used to obtain preset sample data, where the sample data is plain text data; A second communication unit is used to input the preset sample data into a preset federated model to obtain a prediction result; a calculation unit, configured to determine a deviation result based on the feature preprocessing data and the prediction result; A model building unit is used to adjust the parameters of the preset federal model based on the deviation result to build a federal model.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the data encryption method according to any one of claims 1, 3, and 4, and the federated modeling method according to any one of claims 6-7.
Citation Information
Patent Citations
Data processing methodand device, equipment and computer readable storage medium
CN113032840A