Secure intersection, federated learning model training method and system, device and medium

By fragmenting and densely sorting the data matrix in vertical federated learning, and aligning the fragmented intersection samples, the problem of sensitive information leakage in vertical federated learning is solved, and a high standard of protection for secure intersection is achieved.

CN115392480BActive Publication Date: 2026-05-12BEIJING FUCUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING FUCUN TECH CO LTD
Filing Date
2022-08-05
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In existing vertical federated learning, existing algorithms are prone to exposing users' sensitive information during the intersection stage, and cannot effectively protect information security and privacy.

Method used

By fragmenting the original data matrix of the participants, a random number fragment matrix is ​​generated and spliced ​​together. The intersection samples of the fragment states are generated by dense state sorting and alignment to ensure that the intersection results are not leaked.

Benefits of technology

It achieves secure intersection without exposing sensitive information during the intersection process, protects information outside the intersection, and meets high security standards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115392480B_ABST
    Figure CN115392480B_ABST
Patent Text Reader

Abstract

The application discloses a data security intersection, a federated learning model training method and system, equipment and a medium, wherein the security intersection method comprises the following steps: obtaining original data matrices of each participant; performing fragmentation processing on the original data matrices of each participant and then splicing; and generating intersection samples in a fragmented state through secret state sorting and secret state alignment. Since the intersection samples are in a fragmented state, the intersection result can be ensured not to be leaked, so that no sensitive information is exposed in the whole process of the security intersection, information outside the intersection is protected, the output result can also protect the intersection information, and high-standard security requirements can be executed and the goal of protecting sensitive data can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of secure multi-party computation, and in particular to a method, system, device, and medium for secure data intersection and training of federated learning models. Background Technology

[0002] With the development of artificial intelligence technology, the concept of "federated learning" has been proposed to address the problem of data silos. Federated learning is essentially a distributed machine learning framework that achieves data sharing and collaborative modeling while ensuring data privacy, security, and legal compliance. Its core idea is that when multiple data sources participate in model training, the original data does not need to be transferred; instead, the model is trained jointly only by exchanging intermediate parameters. The original data does not need to leave the local machine. This approach achieves a balance between data privacy protection and data sharing analysis, namely a "data usable but not visible" data application model. The initiators and participants in federated learning, as members, can obtain model parameters through model training without providing their own data, thus avoiding data privacy leaks. Since federated learning requires a large amount of data, which is mostly distributed among different data holders, it is necessary to collaborate among these data holders to build the model.

[0003] Vertical federated learning, in particular, involves extracting users and data from participants with similar data features but differing user data features to jointly train a machine learning model, especially when there is little overlap in participant data features but significant overlap in user data. However, current implementations of vertical federated learning generally focus only on the security of the model itself, such as protecting communication data during training through homomorphic encryption, while neglecting the security of the upstream Secure Intersection (PSI) phase. This can lead to the leakage of sensitive information. Furthermore, current industry implementations, such as the PSI protocols used in the alignment phase, include Diffie-Hellmann (key negotiation) based PSI schemes, RSA (an encryption algorithm) blind signature based PSI schemes, OPRF (unintentional pseudo-random function) based PSI schemes, and Bloom filter & OT based schemes. In vertical federated learning scenarios, these protocols all exhibit the phenomenon of mutually exposing sensitive information of overlapping users. Additionally, without intersection sharing, traditional algorithm design cannot effectively perform joint modeling in vertical federated learning. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art, which cannot avoid the exposure of users' sensitive information during the intersection stage, and thus cannot guarantee the security and privacy of information. The present invention provides a data-secure intersection method, system, device and medium for training federated learning models.

[0005] The present invention solves the above-mentioned technical problems through the following technical solution:

[0006] This invention provides a secure intersection method for data sharing, applicable to data sharing scenarios between at least two participants. The secure intersection method includes:

[0007] Obtain the original data matrix of each of the aforementioned participants;

[0008] The original data matrix includes at least one set of sample data, which includes a unique identifier for each object in the participating parties and attribute data corresponding to the unique identifier.

[0009] Based on the sample data, the original data matrix of each participant is fragmented to obtain their respective original fragment matrix, and a corresponding random number fragment matrix is ​​generated based on the original fragment matrix. The random number fragment matrix of each participant is then sent to the other participants.

[0010] The original fragment matrix of each participant is concatenated with the random number fragment matrix obtained from other participants to obtain their respective concatenated matrices.

[0011] The target intersection samples are determined based on the splicing matrix of each of the participating parties.

[0012] Preferably, determining the target intersection sample based on the splicing matrix of each participant includes:

[0013] The concatenation matrix of each participant is sorted to obtain a sorting matrix corresponding to the concatenation matrix;

[0014] Sample feature alignment is calculated based on the sorting matrix of each participant to determine the target intersection sample.

[0015] Preferably, after obtaining the corresponding original fragment matrices, the secure intersection method further includes:

[0016] Based on a preset dense-state scrambling algorithm, several columns in the original fragment matrix are densely scrambled to obtain a new original fragment matrix after sample order transformation;

[0017] The original fragment matrices corresponding to different participants are subjected to the same preset dense-state scrambling algorithm for dense-state scrambling.

[0018] Preferably, the original fragment matrix includes sample data fragments, and the sample data fragments include unique identifier fragments and attribute data fragments corresponding to the unique identifier fragments;

[0019] The step of sorting based on the concatenation matrix of each participant to obtain their respective sorting matrix includes:

[0020] Sample data fragments with the same unique identifier fragments in the splicing matrix of each participant are extracted based on preset sorting operators and sorted to obtain their respective sorting matrices.

[0021] Preferably, the step of calculating sample feature alignment based on the ranking matrix of each of the participating parties to determine the target intersection sample includes:

[0022] Based on the sorting matrix of each participant, the unique identifier fragments corresponding to adjacent sample data fragments are compared sequentially to determine whether they are the same. Based on the comparison results, sample feature alignment calculation is performed to obtain the target intersection sample.

[0023] Preferably, the step of calculating sample feature alignment based on the comparison results includes:

[0024] The fragmented comparison results are converted into the corresponding first comparison value or second comparison value according to the preset conversion operator;

[0025] The corresponding attribute data fragments in adjacent sample data fragments are summed in a dense state, and each summation value is multiplied sequentially by the first comparison value or the second comparison value to obtain the target intersection sample.

[0026] Preferably, the step of converting the fragmented comparison results into corresponding first or second comparison values ​​according to a preset conversion operator includes:

[0027] When the comparison results are the same, the fragmented comparison results are converted into a first comparison value of arithmetic type based on the B2A operator;

[0028] When the comparison results are different, the fragmented comparison results are transformed into a second comparison value of arithmetic type based on the B2A operator.

[0029] Preferably, the step of calculating sample feature alignment based on the comparison results includes:

[0030] When the comparison results are the same, the corresponding attribute data fragments in the adjacent sample data fragments are summed in a dense state; when the comparison results are different, the sample data with the higher sorting position is discarded to obtain a new target intersection sample.

[0031] Preferably, after performing sample feature alignment calculation based on the comparison results, the secure intersection method further includes:

[0032] The fragmented comparison results are then restored.

[0033] Preferably, after obtaining the original data matrices of each of the participants, the secure intersection method further includes:

[0034] Determine whether the number of columns corresponding to the attribute data in the original data matrix of each participant is the same. If they are not the same, generate virtual attribute data columns according to the preset completion rules to complete the original data matrix.

[0035] The number of columns in the original data matrix after completion is equal for each of the participating parties.

[0036] Preferably, the step of fragmenting the original data matrix of each participant based on the sample data to obtain their respective original fragment matrices, and generating a corresponding random number fragment matrix based on the original fragment matrices, includes:

[0037] Based on the sample data, a random number is subtracted from each original data in the original data matrix of each participant to obtain difference fragments and random number fragments. All difference fragments are used as the original fragment matrix, and all random number fragments are used as the random number fragment matrix.

[0038] Preferably, the preset sorting operator is implemented based on the quicksort algorithm or a sorting network algorithm;

[0039] And / or,

[0040] The sorting network algorithm is implemented based on the bitonic sorting algorithm.

[0041] Preferably, the secure intersection method further includes:

[0042] Determine the type of the unique identifier in the original data matrix;

[0043] If the unique identifier is a string, then the string unique identifier is digitized to obtain a digitized unique identifier;

[0044] If the unique identifier is numerical, no operation will be performed.

[0045] This invention also provides a method for training a federated learning model, the method comprising:

[0046] Obtain fragmented target intersection samples obtained by each participant using the secure intersection method described above;

[0047] Based on a preset partitioning strategy, the training set fragments and test set fragments are obtained after each participant performs partitioning on the target intersection sample;

[0048] The prediction fragments are obtained by each of the participating parties using their respective training set fragments and test set fragments to calculate feature and weight parameters through a secure multi-party computation operator.

[0049] Obtain gradient fragments obtained by each of the aforementioned participants using their respective predicted fragments through the secure multi-party computation operator;

[0050] Each participating party uses its own gradient fragment to perform weight coefficient update calculation through the secure multi-party computation operator to update the initial weight fragment to obtain a new weight fragment, and then uses the new weight fragment for iteration;

[0051] When the weight fragments meet the preset conditions, the target weight fragments are obtained, and the federated learning model is established using the target weight fragments.

[0052] Preferably, after obtaining the predicted fragments, the training method of the federated learning model further includes:

[0053] Each participant calculates its loss value fragment using the secure multi-party computation operator based on its respective predicted fragment.

[0054] Each of the aforementioned participants receives the loss value fragments sent by the other participants, restores all the loss value fragments to their corresponding plaintext, and then reports the results to the training log.

[0055] Preferably, after obtaining gradient fragments, the training method of the federated learning model further includes:

[0056] The gradient value of the gradient fragment corresponding to the feature of each participant is determined by the secure multi-party computation operator. If the gradient value is less than a preset threshold, any participant receives the comparison result fragment sent by the other participants and restores the comparison result fragment to the corresponding plaintext.

[0057] Preferably, the training method for the federated learning model further includes:

[0058] Determine whether the training status indicates that training has been terminated;

[0059] If so, output and save the model parameters as the corresponding plaintext model parameters or model parameter fragments according to the usage requirements;

[0060] If not, then the gradient update weight coefficients of the gradient fragments are calculated using the secure multi-party computation operator to obtain the new target weight fragments.

[0061] This invention also provides a secure intersection system for data sharing, applicable to data sharing scenarios between at least two participants, the secure intersection system comprising:

[0062] The acquisition module is used to acquire the original data matrix of each of the participating parties;

[0063] The original data matrix includes at least one set of sample data, which includes a unique identifier for each object in the participating parties and attribute data corresponding to the unique identifier.

[0064] The fragmentation module is used to fragment the original data matrix of each participant based on the sample data to obtain their respective original fragment matrix, generate a corresponding random number fragment matrix based on the original fragment matrix, and send the random number fragment matrix of each participant to other participants.

[0065] The splicing module is used to splice the original fragment matrix of each participant with the random number fragment matrix obtained from other participants to obtain their respective splicing matrices.

[0066] The intersection sample determination module is used to determine the target intersection sample based on the splicing matrix of each of the participating parties.

[0067] Preferably, the intersection sample determination module includes:

[0068] A sorting unit is used to sort the concatenation matrix of each participant to obtain a sorting matrix corresponding to the concatenation matrix.

[0069] Alignment unit, used to perform sample feature alignment calculation based on the sorting matrix of each participant, to determine the target intersection sample.

[0070] Preferably, the secure intersection system further includes:

[0071] The scrambling module is used to perform dense scrambling on several columns of the original fragment matrix based on a preset dense scrambling algorithm, so as to obtain a new original fragment matrix after sample order transformation.

[0072] The original fragment matrices corresponding to different participants are subjected to the same preset dense-state scrambling algorithm for dense-state scrambling.

[0073] Preferably, the original fragment matrix includes sample data fragments, and the sample data fragments include unique identifier fragments and attribute data fragments corresponding to the unique identifier fragments;

[0074] The sorting unit is further configured to extract sample data fragments with the same unique identifier fragment from the splicing matrix of each participant based on a preset sorting operator and sort them to obtain the sorting matrix corresponding to each participant.

[0075] Preferably, the alignment unit is further configured to compare whether the unique identifier fragments corresponding to adjacent sample data fragments are the same based on the sorting matrix of each participant, so as to perform sample feature alignment calculation based on the comparison results to obtain the target intersection sample.

[0076] Preferably, the alignment unit is further configured to convert the fragmented comparison result into a corresponding first comparison value or a second comparison value according to a preset conversion operator;

[0077] The corresponding attribute data fragments in adjacent sample data fragments are summed in a dense state, and each summation value is multiplied sequentially by the first comparison value or the second comparison value to obtain the target intersection sample.

[0078] Preferably, the alignment unit is further configured to, when the comparison results are the same, convert the fragmented comparison results into a first comparison value of arithmetic type based on the B2A operator;

[0079] When the comparison results are different, the fragmented comparison results are transformed into a second comparison value of arithmetic type based on the B2A operator.

[0080] Preferably, the alignment unit is further configured to perform a dense-state summation of the corresponding attribute data fragments in adjacent sample data fragments when the comparison results are the same; and to discard the sample data with the higher sorting position when the comparison results are different, so as to obtain a new target intersection sample.

[0081] Preferably, the secure intersection system further includes:

[0082] The recovery module is used to recover the fragmented comparison results.

[0083] Preferably, the secure intersection system further includes:

[0084] The completion module is used to determine whether the number of columns corresponding to the attribute data in the original data matrix of each participant is the same. If they are not the same, virtual attribute data columns are generated according to the preset completion rules to complete the original data matrix.

[0085] The number of columns in the original data matrix after completion is equal for each of the participating parties.

[0086] Preferably, the fragmentation module is further configured to subtract a random number from each original data in the original data matrix of each participant based on the sample data to obtain difference fragments and random number fragments, and to use all the difference fragments as the original fragment matrix and all the random number fragments as the random number fragment matrix.

[0087] Preferably, the preset sorting operator is implemented based on the quicksort algorithm or a sorting network algorithm;

[0088] And / or,

[0089] The sorting network algorithm is implemented based on the bitonic sorting algorithm.

[0090] Preferably, the secure intersection system further includes:

[0091] The type conversion module is used to determine the type of the unique identifier in the original data matrix;

[0092] If the unique identifier is a string, then the string unique identifier is digitized to obtain a digitized unique identifier;

[0093] If the unique identifier is numerical, no operation will be performed.

[0094] The present invention also provides a training system for a federated learning model, the training system comprising:

[0095] The intersection sample acquisition module is used to acquire fragmented target intersection samples obtained by each of the participating parties using the secure intersection method described above.

[0096] The partitioning module is used to obtain training set fragments and test set fragments after each participant performs partitioning on the target intersection sample based on a preset partitioning strategy.

[0097] The prediction fragment calculation module is used to obtain the prediction fragments obtained by each of the participants through feature and weight parameter calculation using their respective training set fragments and test set fragments via a secure multi-party computation operator.

[0098] The gradient fragment calculation module is used to obtain the gradient fragments obtained by each of the participating parties through gradient calculation using their respective predicted fragments via the secure multi-party computation operator.

[0099] The weight fragment update module is used to obtain the weight coefficient update calculation performed by each of the participants using their respective gradient fragments through the secure multi-party computation operator, so as to update the initial weight fragments to obtain new weight fragments, and to use the new weight fragments for iteration;

[0100] The model building module is used to obtain a target weight fragment when the weight fragment meets a preset condition, and to build the federated learning model using the target weight fragment.

[0101] Preferably, the training system further includes:

[0102] The loss value fragment calculation module is used to obtain the loss value fragments obtained by each of the participating parties through the secure multi-party computation operator based on their respective predicted fragments.

[0103] Each of the aforementioned participants receives the loss value fragments sent by the other participants, restores all the loss value fragments to their corresponding plaintext, and then reports the results to the training log.

[0104] Preferably, the training system further includes:

[0105] The gradient fragment comparison module is used to determine whether the gradient value of the gradient fragment corresponding to the feature of each participant is less than a preset threshold by using the secure multi-party computation operator. If so, any participant receives the comparison result fragment sent by the other participants and restores the comparison result fragment to the corresponding plaintext.

[0106] Preferably, the training system further includes:

[0107] The training status determination module is used to determine whether the training status is terminated.

[0108] If so, output and save the model parameters as the corresponding plaintext model parameters or model parameter fragments according to the usage requirements;

[0109] If not, then the gradient update weight coefficients of the gradient fragments are calculated using the secure multi-party computation operator to obtain the new target weight fragments.

[0110] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the secure intersection method in data sharing as described above and / or the training method of the federated learning model as described above.

[0111] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the secure intersection method in data sharing as described above and / or implements the training method of the federated learning model as described above.

[0112] The positive and progressive effects of this invention are as follows: by obtaining the original data matrices of each participant, performing local fragmentation processing on the original data matrices of each participant and then splicing them together, and then generating fragmented intersection samples through dense state sorting and dense state alignment, since the intersection samples are fragmented, the intersection results can be guaranteed not to be leaked. Thus, no sensitive information is exposed in the entire process of secure intersection, which protects information other than the intersection, and at the same time, the output results can also protect the intersection information, thereby enabling the execution of high-standard security requirements and achieving the goal of protecting sensitive data. Attached Figure Description

[0113] Figure 1 This is a schematic diagram of the first process provided in Embodiment 1 of the present invention.

[0114] Figure 2 This is a schematic diagram of the second process provided in Embodiment 1 of the present invention.

[0115] Figure 3 This is a schematic diagram of the third process provided in Embodiment 1 of the present invention.

[0116] Figure 4 This is a flowchart of a secure intersection method provided in Embodiment 1 of the present invention.

[0117] Figure 5 This is another safe intersection flowchart provided in Embodiment 1 of the present invention.

[0118] Figure 6 This is a schematic diagram of the system structure provided in Embodiment 2 of the present invention.

[0119] Figure 7 This is a schematic diagram of the first process provided in Embodiment 3 of the present invention.

[0120] Figure 8 This is a flowchart of a training method for a federated learning model provided in Embodiment 3 of the present invention.

[0121] Figure 9 This is a schematic diagram of the system structure provided in Embodiment 4 of the present invention.

[0122] Figure 10 This is a schematic diagram of the structure of the electronic device provided in Embodiment 5 of the present invention. Detailed Implementation

[0123] The present invention will be further illustrated by way of embodiments below, but the present invention is not limited to the scope of the embodiments described herein.

[0124] To more clearly illustrate the technical solutions of the embodiments in this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some examples or embodiments of this specification. For those skilled in the art, these drawings can be applied to other similar scenarios without creative effort. Unless obvious from the context or otherwise specified, the same reference numerals in the drawings represent the same structures or operations.

[0125] It should be understood that the terms “system,” “device,” “unit,” and / or “module” used herein are one way to distinguish different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.

[0126] As indicated in this specification, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0127] Flowcharts are used in this specification to illustrate the operations performed by the system according to embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0128] Secure Intersection (PSI), also known as the Privacy-Preserving Set Intersection Protocol, is an indispensable part of vertical federated learning. The PSI protocol allows two parties holding their respective sets to jointly compute the intersection of their sets. At the end of the protocol interaction, both parties should obtain the correct intersection without gaining any information from the other party's set outside the intersection. From the definition of PSI, although the protocol only provides the participants with the user sample intersection information of the intersection portion, this information is unacceptable for many sensitive scenarios or institutions with high security requirements. For example, institution A has dataset Da, and institution B has dataset Db. After secure intersection, institutions A and B simultaneously obtain the intersection Dc of Da and Db. In this case, institution A knows that the users in Dc belong to institution B, and because they are intersection users, institution A knows sensitive information such as user IDs, mobile phone numbers, and ID cards. Similarly, institution B can also know that Dc belongs to institution A, gaining access to a great deal of information. Currently, in industry implementations, secure intersection commonly suffers from this phenomenon of mutually exposing the sensitive information of the intersection users. Therefore, major banks, operators and other institutions have a strong demand for fully anonymous vertical federated learning. They hope that the fully anonymous vertical federated learning framework can protect information other than the intersection from being leaked in the secure intersection part, while also protecting the intersection itself, so that the participants cannot know the real intersection information.

[0129] For the reasons mentioned above, such as Figure 1 As shown, this embodiment provides a secure intersection method for data sharing, applied to data sharing scenarios between at least two participants. In this embodiment, two participants are used as an example, such as one party being P0 (i.e., GUEST) and the other party being P1 (i.e., HOST). The secure intersection method of this embodiment includes:

[0130] S101. Obtain the original data matrix of each participant.

[0131] The original data matrix includes at least one set of sample data, which includes a unique identifier for each object among the participants and attribute data corresponding to the unique identifier.

[0132] As an optional implementation, the secure intersection method of this embodiment further includes:

[0133] S101a, Determine the type of the unique identifier in the original data matrix.

[0134] If the unique identifier is a string, proceed to step S101a1; if the unique identifier is a numeric type, proceed to step S101a2.

[0135] Step S101a1: Convert the unique identifier of the string into a numerical identifier to obtain a numerical unique identifier. Step S101a2: Do not perform any operation.

[0136] It's important to note that during the intersection phase, a specific column needs to be designated as the target column for intersection, such as an ID number or mobile phone number, to determine if users belong to the same user. Therefore, the target column must be unique. For example, the table below uses an `id` column, where the value is a string. Therefore, it first needs to be converted to a numerical value. This implementation can use hash-based numerical conversion to transform the string `id` value into a numerical value, facilitating subsequent steps. The numerical conversion must meet the uniqueness requirement after mapping; that is, the same string `id` must also be a unique numerical value after mapping, without any overlap or duplication.

[0137] In one implementation, the participating parties can determine the composition specifications of the original data matrix through discussion, so that they can proceed directly to the next step after obtaining the original data matrix. For example, each party has the same number of features, such as having a unique identifier, two feature data and a label data. This embodiment does not limit this.

[0138] In another implementation, when the participants do not specify the composition of the original data matrix, the following two tables show the original feature data of P0 and P1, respectively.

[0139] P0 (GUEST) original feature data D0:

[0140]

[0141] P1 (HOST) original feature data D1:

[0142] id <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> 858329 0.77 1.45 428493 2.6 3.9 1030916 -2.2 -1.1

[0143] Therefore, after step S101, the secure intersection method of this embodiment further includes:

[0144] S101b: Determine whether the number of columns corresponding to the attribute data in the original data matrix of each participant is the same. If they are not the same, generate virtual attribute data columns according to the preset completion rules to complete the original data matrix.

[0145] In this case, the number of columns in the original data matrix after completion is equal for each participating party.

[0146] That is, the non-id fields of the original data matrix are padded. Each participant needs to perform padding operations on their respective sample data. During this stage, each party will synchronize the number of features and then generate virtual label columns according to the preset padding rules. The preset padding rules may include filling the virtual label columns with the value 0, or values ​​generated by a certain rule, such as adding 1 to P0 and subtracting 1 from P1. It is only necessary to ensure that this information can be removed in subsequent operations. This implementation does not limit this. This implementation uses 0 padding. After augmenting and padding the original data of P0 and P1, a matrix of the same column size is obtained, as shown in D0′ and D1′ in the table below.

[0147] The feature matrix of P0 is padded with the feature number of P1 and the label to obtain D0′:

[0148] id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> 224361 0 2.3 5.5 4 0 0 428493 1 3.6 3.5 -3 0 0 672684 0 -1.2 0.5 1.2 0 0 1030916 1 0.8 0.13 3 0 0

[0149] Similarly, the eigenma matrix of P1 is completed by padding with the eigenvalues ​​of P0 to obtain D1′:

[0150]

[0151]

[0152] S102. Based on the sample data, the original data matrix of each participant is fragmented to obtain the original fragment matrix of each participant, and a corresponding random number fragment matrix is ​​generated based on the original fragment matrix. The random number fragment matrix of each participant is then sent to the other participants.

[0153] It should be noted that participants can also secretly share their random number fragment matrix with other participants.

[0154] Optionally, step S102 in this embodiment includes:

[0155] S1021. Based on the sample data, subtract a random number from each original data in the original data matrix of each participant to obtain difference fragments and random number fragments. Use all the difference fragments as the original fragment matrix and all the random number fragments as the random number fragment matrix.

[0156] The fragmentation formula is as follows:

[0157] Fragmenting x

[0158] P i choose make And send r to P 1-i ,make

[0159] Where r is a random number.

[0160] In this embodiment, P0 and P1 are fragmented separately, as shown in the table below:

[0161] P0 fragments D′0 locally and shares it secretly (the ID also needs to be fragmented).

[0162] id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> <224361> <0> <2.3> <5.5> <4> <0> <0> <428493> <1> <3.6> <3.5> <-3> <0> <0> <672684> <0> <-1.2> <0.5> <1.2> <0> <0> <1030916> <1> <0.8> <0.13> <3> <0> <0>

[0163] Similarly, P1 locally fragments D1′ and secretly shares it.

[0164]

[0165]

[0166] Note: <x>This represents the fragmented state of x.

[0167] S103. Concatenate the original fragment matrix of each participant with the random number fragment matrix obtained from other participants to obtain their respective concatenated matrices. See Table D below. f :

[0168] The MPC Concat execution yields the concatenated matrix D. f

[0169] id Y <![CDATA[Z a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> <224361> <0> <2.3> <5.5> <4> <0> <0> <428493> <1> <3.6> <3.5> <-3> <0> <0> <672684> <0> <-1.2> <0.5> <1.2> <0> <0> <1030916> <1> <0.8> <0.13> <3> <0> <0> <858329> <0> <0> <0> <0> <0.77> <1.45> <428493> <0> <0> <0> <0> <2.6> <3.9> <1030916> <0> <0> <0> <0> <-2.2> <-1.1>

[0170] S104. Determine the target intersection sample based on the splicing matrix of each participant.

[0171] It should be noted that sample data with the same unique identifier can be selected from the splicing matrix using mathematical methods, thereby determining the target intersection samples.

[0172] In one alternative implementation, such as Figure 2 As shown, step S104 of this embodiment includes:

[0173] S1041. Sort the splicing matrices of each participant to obtain the sorting matrix corresponding to the splicing matrix.

[0174] S1042. Perform sample feature alignment calculations based on the sorting matrix of each participant to determine the target intersection samples.

[0175] It should be noted that for the intersection samples of this target, since the plaintext state is not recovered and the state is kept in a fully fragmented state, neither party knows the specific intersection, thus providing strong security and eliminating the problem of differential attacks.

[0176] The secure intersection process in this embodiment is summarized below. Both P0 and P1 first perform ID numeration, sample matrix completion, and matrix fragmentation locally. Then, through encrypted ID sorting and encrypted alignment, they generate a purely fragmented aligned sample result. P0 holds fragment S0, and P1 holds fragment S1. Only when S0 + S1 can the plaintext intersection result be recovered. Therefore, being in a fragmented state ensures that the intersection result is not leaked, and neither party knows which user group the intersection belongs to.

[0177] This implementation provides a fully anonymous secure intersection method that not only protects information other than the intersection from being leaked, but also protects the intersection itself, preventing any participating party from knowing the true intersection information. Furthermore, the fully anonymous intersection result can still support vertical federated learning.

[0178] As an optional implementation manner of this embodiment, the original fragment matrix includes sample data fragments, and the sample data fragments include unique identifier fragments and attribute data fragments corresponding to the unique identifier fragments.

[0179] Step S1041 of this embodiment includes:

[0180] S1041a. Respectively extract the sample data fragments with the same unique identifier fragments in the splicing matrices of each party based on a preset sorting operator and perform sorting to obtain their respective corresponding sorting matrices.

[0181] After encrypted sorting, a new sorted sorting matrix D' is obtained f :

[0182] Sorted-id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> <224361> <0> <2.3> <5.5> <4> <0> <0> <428493> <1> <3.6> <3.5> <-3> <0> <0> <428493> <0> <0> <0> <0> <2.6> <3.9> <672684> <0> <-1.2> <0.5> <1.2> <0> <0> <858329> <0> <0> <0> <0> <0.77> <1.45> <1030916> <1> <0.8> <0.13> <3> <0> <0> <1030916> <0> <0> <0> <0> <-2.2> <-1.1>

[0183] It should be noted that the preset sorting operator of this embodiment is implemented based on a quicksort algorithm or a sorting network algorithm.

[0184] The implementation logic of the preset sorting operator of this embodiment can be implemented based on the quicksort algorithm. Quicksort is a mature comparison scheme with a computational complexity of O(n). Here, encrypted sorting is implemented using a multi-party secure computing (MPC) sorting operator, that is, sorting the fragmented id column to obtain a sorted fragmented sample matrix. The comparison operator involved here is also a commonly used comparison operator in MPC, which will not be introduced here.

[0185] In an optional implementation manner, the sorting network algorithm is implemented based on the bitonic sorting algorithm. Specifically, bitonic sorting belongs to a type of sorting network. Compared with traditional sorting algorithms, the value of the sorting network operator lies in that it can process multiple comparators simultaneously, and the sorting speed will be greatly improved. Simply put, it is a sorting algorithm that can perform parallel computing.

[0186] The bitonic sorting network operator is constructed based on the Batcher theorem. The Batcher theorem states that any bitonic sequence A with a length of 2 n is divided into two equal-length halves X and Y. The elements in X are compared with the elements in Y one by one in the original order, that is, a[i] is compared with a[i + n] (i < n), and the larger one is placed in the MAX sequence, and the smaller one is placed in the MIN sequence. Then the obtained MAX and MIN sequences are still bitonic sequences, and any element in the MAX sequence is not less than any element in the MIN sequence.

[0187] A bitonic sequence is a sequence consisting of a non-strictly increasing sequence X and a non-strictly decreasing sequence Y, such as the sequence (23,10,8,3,5,7,11,78).

[0188] This scheme is further improved to allow input of bitonic sequences of arbitrary length, without requiring the total length of the bitonic sequence to be 2. n The limitations of traditional sorting methods are addressed by improving the bitonic sorting operator using a multi-party secure computation operator, resulting in a parallelizable privacy-preserving sorting algorithm that significantly enhances sorting performance under fully dense data computation, achieving a speed increase of 500 times compared to traditional sorting methods.

[0189] As another optional implementation of this embodiment, step S1042 of this embodiment includes:

[0190] S1042a. Based on the sorting matrix of each participant, compare the unique identifier fragments corresponding to adjacent sample data fragments to see if they are the same, and calculate the sample feature alignment based on the comparison results to obtain the target intersection sample.

[0191] Optionally, such as Figure 3 As shown, step S1042a of this embodiment includes:

[0192] S1042a1: Convert the fragmented comparison result into the corresponding first comparison value or second comparison value according to the preset conversion operator;

[0193] S1042a2. Perform dense summation on the corresponding attribute data fragments in adjacent sample data fragments, and multiply each summation value by the first comparison value or the second comparison value in turn to obtain the target intersection sample.

[0194] Specifically, an item-by-item comparison operation is performed based on the sorted fragment ID column.

[0195] Since the same ID can only appear once at most, and the original value of the IDs being compared is unknown during the comparison process, the Sorted-id column is compared item by item, and the comparison results are B2A. The non-id parts are then summed in a secret state, and the B2A result is multiplied by the secret state sum. The execution complexity is O(n).

[0196] Based on this assumption, with the above D′ f For example, perform a dense-state alignment operation:

[0197] Tag section:

[0198] Feature section:

[0199] Where i represents the feature index and j represents the sample index.

[0200] After execution, the final fully dense-state aligned sample is obtained, as shown in the table below:

[0201] Sorted-id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> <224361> <0> <0> <0> <0> <0> <0> <428493> <1> <3.6> <3.5> <-3> <2.6> <3.9> <0> <0> <0> <0> <0> <0> <672684> <0> <0> <0> <0> <0> <0> <858329> <0> <0> <0> <0> <0> <0> <1030916> <1> <0.8> <0.13> <3> <-2.2> <-1.1>

[0202] It should be noted that, due to the second point <428493> Article 3 <428493> The samples have the same ID, therefore the first one <428493> Dense-state alignment was performed. And the third... <428493> Article 4 <672684> The sample IDs are different, therefore the third one... <428493> The value will become all 0s. To avoid misunderstanding, the third sample ID will be changed from... <428493> Changing it to a placeholder will not change the actual intersection result, because the intersection... <428493> The actual data for the sample appears only once. Additionally, <1030916> Since there are duplicate IDs, this is also an intersection. Because the last sample has already been used in the calculation with the last sample, it can be discarded directly.

[0203] In this embodiment, step S1042a1 includes:

[0204] When the comparison results are the same, the fragmented comparison results are transformed into the first comparison value of the arithmetic type based on the B2A operator; when the comparison results are different, the fragmented comparison results are transformed into the second comparison value of the arithmetic type based on the B2A operator.

[0205] It should also be noted that the B2A operator here is an MPC (Multi-Party Computation) operator that can convert fragmented Boolean results into arithmetic results. For example, a fragmented Boolean result might be... <false>After being transformed by the B2A operator, it becomes a fragmented result. <0> Similarly, the fragmented Boolean result is... <true>After being transformed by the B2A operator, it becomes a fragmented result. <1> Therefore when <1> Multiplying by the result of the subsequent addition means preserving the result of the addition itself. If you use... <0> Multiplying by the product, the whole becomes <0> The first comparison value can be the fragmented state result. <1> The second comparison value can be the fragmented state result. <0> .

[0206] In an optional implementation, after step S101, the secure intersection method of this embodiment further includes:

[0207] S101c: Based on a preset dense-state scrambling algorithm, several columns in the original fragment matrix are densely scrambled to obtain a new original fragment matrix after sample order transformation;

[0208] The original fragment matrices corresponding to different participants are subjected to the same pre-set dense state scrambling algorithm for dense state scrambling.

[0209] It should also be noted that this embodiment can not only perform dense-state scrambling on the original fragment matrix, but also perform dense-state scrambling on the completed fragment matrix.

[0210] By shuffling the dense state of the sample data, none of the participants can deduce the true sample order, and therefore cannot predict the objects to be compared in subsequent comparisons, thus further ensuring the security of user information.

[0211] The logic of the pre-defined dense-state shuffling algorithm is as follows: If the original padded fragmented sample matrix is ​​M, P0 generates transformation matrix 1 and shuffles it, and P1 generates transformation matrix 2 and shuffles it. The transformation matrix refers to the adjustment of the identity matrix. Since P0 cannot know the transformation matrix 2 generated by P1, and P1 cannot deduce the transformation matrix 1 generated by P0, the fragmented transformation sample matrix can be obtained by multiplying the fragmented matrix. That is, the sample order is densely shuffled, so that the participants cannot perceive the true arrangement order of the samples.

[0212] Alternatively, the formula can be shuffled as follows:

[0213] ShuffleMatrix = matrix M @ transformation matrix 1 @ transformation matrix 2

[0214] Therefore, we only need to generate transformation matrices for P0 and P1 respectively, fragment them, and then perform matrix multiplication with the fragmented augmented matrices to obtain the scrambled dense state transformation matrix. The generation of the transformation matrix is ​​based on adjusting the identity matrix; for example, if columns 2 and 3 need to be swapped, simply swap the order of columns 2 and 3 in the identity matrix. An example is shown below:

[0215]

[0216] This embodiment adopts the sorted nearest neighbor comparison approach to control the computational complexity of the privacy intersection algorithm to O(n), improving computational performance while ensuring security. Furthermore, we propose two different fully anonymous secure intersection approaches: one based on dense-state alignment and the other through a dense-state shuffling mechanism, enriching the technical implementation and meeting the needs of more application scenarios.

[0217] Optionally, after the fragment matrix is ​​scrambled in dense state and after step S1042, the secure intersection method of this embodiment further includes:

[0218] The fragmented comparison results are then restored.

[0219] Optionally, as another implementation of step S1042a, S1042a further includes:

[0220] When the comparison results are the same, the corresponding attribute data fragments in adjacent sample data fragments are summed in a dense state; when the comparison results are different, the sample data with the higher sorting position is discarded to obtain a new target intersection sample.

[0221] Specifically, an item-by-item comparison operation is performed based on the sorted fragmented ID column.

[0222] Since the same ID can only appear once at most, and the original value of the IDs being compared is unknown during the comparison process, the Sorted-id column is compared item by item, and the comparison result is used to determine whether they are the same, without revealing any information. The execution complexity is O(n).

[0223] Based on this assumption, with the above D′ f For example, perform a dense-state alignment operation:

[0224] <124360> and <328492> The close-state comparison returned a false result, so the state was discarded. <124360> This sample.

[0225] <328492> and <328492> The dense state comparison is performed, and the recovery result is True. The dense state addition is then performed on the two sample non-id fragment values.

[0226] Jump directly to the sample at index 3 and perform a comparison of the fragment IDs at indices 3 and 4:

[0227] <572683> and <748329> The close-state comparison returned a false result, so the state was discarded. <572683> This sample.

[0228] <748329> and <930913>The close-state comparison returned a false result, so the state was discarded. <748329> This sample.

[0229] <930913> and <930913> The dense state comparison is performed, and the recovery result is True. The dense state addition is then performed on the two sample non-id fragment values.

[0230] After execution, the new target intersection samples are obtained, as shown in the table below:

[0231] Sorted-id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> <428493> <1> <3.6> <3.5> <-3> <2.6> <3.9> <1030916> <1> <0.8> <0.13> <3> <-2.2> <-1.1>

[0232] In a specific example, this embodiment combines the above steps to provide two different secure intersection procedures, such as... Figure 4 and Figure 5 As shown.

[0233] This embodiment obtains the original data matrices of each participant, performs local fragmentation processing on the original data matrices of each participant, and then concatenates them. Then, through dense-state sorting and dense-state alignment, fragmented intersection samples are generated. Because the intersection samples are fragmented, the intersection results are guaranteed not to be leaked. Therefore, no sensitive information is exposed throughout the entire secure intersection process. This protects information outside the intersection, and the output results also protect the intersection information, thus enabling the execution of high-standard security requirements and achieving the goal of protecting sensitive data. Furthermore, the secure intersection scheme of this embodiment has low computational complexity, ensuring both security and computational performance to meet the needs of real-world scenarios.

[0234] Example 2

[0235] This invention also provides a secure intersection system for data sharing, applicable to data sharing scenarios between at least two participants, such as... Figure 6 As shown, the secure intersection system of this embodiment includes:

[0236] Module 1 is used to obtain the original data matrix of each participant.

[0237] The original data matrix includes at least one set of sample data, which includes a unique identifier for each object among the participants and attribute data corresponding to the unique identifier.

[0238] As an optional implementation, the secure intersection system of this embodiment further includes:

[0239] Type conversion module 5 is used to determine the type of the unique identifier in the original data matrix.

[0240] If the unique identifier is a string, then the string unique identifier will be converted into a numerical unique identifier; if the unique identifier is a number, then no operation will be performed.

[0241] It's important to note that during the intersection phase, a specific column needs to be designated as the target column for intersection, such as an ID number or mobile phone number, to determine if users belong to the same user. Therefore, the target column must be unique. For example, the table below uses an `id` column, where the value is a string. Therefore, it first needs to be converted to a numerical value. This implementation can use hash-based numerical conversion to transform the string `id` value into a numerical value, facilitating subsequent steps. The numerical conversion must meet the uniqueness requirement after mapping; that is, the same string `id` must also be a unique numerical value after mapping, without any overlap or duplication.

[0242] In one implementation, the participating parties can determine the composition specifications of the original data matrix through discussion, so that they can proceed directly to the next step after obtaining the original data matrix. For example, each party has the same number of features, such as having a unique identifier, two feature data and a label data. This embodiment does not limit this.

[0243] In another implementation, when the participants do not specify the composition of the original data matrix, the following two tables show the original feature data of P0 and P1, respectively.

[0244] P0 (GUEST) original feature data D0:

[0245] id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> 224361 0 2.3 5.5 4 428493 1 3.6 3.5 -3 672684 0 -1.2 0.5 1.2 1030916 1 0.8 0.13 3

[0246] P1 (HOST) original feature data D1:

[0247]

[0248]

[0249] Optionally, the secure intersection system of this embodiment further includes:

[0250] The completion module 6 is used to determine whether the number of columns corresponding to the attribute data in the original data matrix of each participant is the same. If they are not the same, virtual attribute data columns are generated according to the preset completion rules to complete the original data matrix.

[0251] In this case, the number of columns in the original data matrix after completion is equal for each participating party.

[0252] That is, the non-id fields of the original data matrix are padded. Each participant needs to perform padding operations on their respective sample data. During this stage, each party will synchronize the number of features and then generate virtual label columns according to the preset padding rules. The preset padding rules may include filling the virtual label columns with the value 0, or values ​​generated by a certain rule, such as adding 1 to P0 and subtracting 1 from P1. It is only necessary to ensure that this information can be removed in subsequent operations. This implementation does not limit this. This implementation uses 0 padding. After augmenting and padding the original data of P0 and P1, a matrix of the same column size is obtained, as shown in D0′ and D1′ in the table below.

[0253] The feature matrix of P0 is padded with the feature number of P1 and the label to obtain D0′:

[0254] id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> 224361 0 2.3 5.5 4 0 0 428493 1 3.6 3.5 -3 0 0 672684 0 -1.2 0.5 1.2 0 0 1030916 1 0.8 0.13 3 0 0

[0255] Similarly, the eigenma matrix of P1 is completed by padding with the eigenvalues ​​of P0 to obtain D1′:

[0256] id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> 858329 0 0 0 0 0.77 1.45 428493 0 0 0 0 2.6 3.9 1030916 0 0 0 0 -2.2 -1.1

[0257] Fragmentation module 2 is used to fragment the original data matrix of each participant based on the sample data to obtain the corresponding original fragment matrix, and generate the corresponding random number fragment matrix based on the original fragment matrix, and send the random number fragment matrix of each participant to other participants.

[0258] It should be noted that participants can also secretly share their random number fragment matrix with other participants.

[0259] Optionally, the fragmentation module 2 is also used to subtract a random number from each original data in the original data matrix of each participant based on the sample data to obtain difference fragments and random number fragments, and to use all the difference fragments as the original fragment matrix and all the random number fragments as the random number fragment matrix.

[0260] The fragmentation formula is as follows:

[0261] Fragmenting x

[0262] P i choose make And send r to P 1-i ,make

[0263] Where r is a random number.

[0264] In this embodiment, P0 and P1 are fragmented separately, as shown in the table below:

[0265] P0 fragments P0′ locally and shares it secretly (the ID also needs to be fragmented).

[0266] od Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> <224361> <0> <2.3> <5.5> <4> <0> <0> <428493> <1> <3.6> <3.5> <-3> <0> <0> <672684> <0> <-1.2> <0.5> <1.2> <0> <0> <1030916> <1> <0.8> <0.13> <3> <0> <0>

[0267] Similarly, P1 locally fragments D1′ and secretly shares it.

[0268] id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> <858329> <0> <0> <0> <0> <0.77> <1.45> <428493> <0> <0> <0> <0> <2.6> <3.9> <1030916> <0> <0> <0> <0> <-2.2> <-1.1>

[0269] Note: <x>This represents the fragmented state of x.

[0270] The splicing module 3 is used to splice the original fragment matrices of each participant with the random number fragment matrices obtained from other participants to obtain their respective spliced ​​matrices. See Table D below. f :

[0271] The MPC Concat execution yields the concatenated matrix D. f

[0272] id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> <224361> <0> <2.3> <5.5> <4> <0> <0> <428493> <1> <3.6> <3.5> <-3> <0> <0> <672684> <0> <-1.2> <0.5> <1.2> <0> <0> <1030916> <1> <0.8> <0.13> <3> <0> <0> <858329> <0> <0> <0> <0> <0.77> <1.45> <428493> <0> <0> <0> <0> <2.6> <3.9> <1030916> <0> <0> <0> <0> <-2.2> <-1.1>

[0273] The intersection sample determination module 4 is used to determine the target intersection samples based on the splicing matrix of each participant.

[0274] It should be noted that sample data with the same unique identifier can be selected from the splicing matrix using mathematical methods, thereby determining the target intersection samples.

[0275] In an optional implementation, the intersection sample determination module 4 of this embodiment includes:

[0276] The sorting unit 41 is used to sort the concatenation matrix of each participant to obtain the sorting matrix corresponding to the concatenation matrix.

[0277] Alignment unit 42 is used to perform sample feature alignment calculation based on the sorting matrix of each participant to determine the target intersection sample.

[0278] It should be noted that for the intersection samples of this target, since the plaintext state is not recovered and the state is kept in a fully fragmented state, neither party knows the specific intersection, thus providing strong security and eliminating the problem of differential attacks.

[0279] The secure intersection process in this embodiment is summarized below. Both P0 and P1 first perform ID numeration, sample matrix completion, and matrix fragmentation locally. Then, through encrypted ID sorting and encrypted alignment, they generate a purely fragmented aligned sample result. P0 holds fragment S0, and P1 holds fragment S1. Only when S0 + S1 can the plaintext intersection result be recovered. Therefore, being in a fragmented state ensures that the intersection result is not leaked, and neither party knows which user group the intersection belongs to.

[0280] This implementation provides a fully anonymous secure intersection method that not only protects information other than the intersection from being leaked, but also protects the intersection itself, preventing any participating party from knowing the true intersection information. Furthermore, the fully anonymous intersection result can still support vertical federated learning.

[0281] As an optional implementation manner of this embodiment, the original fragment matrix includes sample data fragments, and the sample data fragments include unique identifier fragments and attribute data fragments corresponding to the unique identifier fragments.

[0282] The sorting unit 41 of this embodiment is further configured to extract, respectively based on a preset sorting operator, the sample data fragments with the same unique identifier fragments in the splicing matrices of each party and perform sorting to obtain their respective corresponding sorting matrices.

[0283] After the encrypted state sorting, a new sorted sorting matrix D' is obtained f :

[0284] Sorted-id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> <224361> <0> <2.3> <5.5> <4> <0> <0> <428493> <1> <3.6> <3.5> <-3> <0> <0> <428493> <0> <0> <0> <0> <2.6> <3.9> <672684> <0> <-1.2> <0.5> <1.2> <0> <0> <858329> <0> <0> <0> <0> <0.77> <1.45> <1030916> <1> <0.8> <0.13> <3> <0> <0> <1030916> <0> <0> <0> <0> <-2.2> <-1.1>

[0285] It should be noted that the preset sorting operator of this embodiment is implemented based on a quicksort algorithm or a sorting network algorithm.

[0286] The implementation logic of the preset sorting operator of this embodiment can be implemented based on a quicksort algorithm. Quicksort is a mature comparison scheme with a computational complexity of O(n). Here, a sorting in the encrypted state is implemented by using a sorting operator based on multi-party secure computation (MPC), that is, sorting the fragmented id columns to obtain a sorted fragmented sample matrix. The comparison operators involved also use the commonly used comparison operators in MPC and will not be introduced here.

[0287] In an optional implementation manner, the sorting network algorithm is implemented based on a bitonic sorting algorithm. Specifically, bitonic sorting belongs to a kind of sorting network. Compared with traditional sorting algorithms, the value of the sorting network operator lies in that it can process multiple comparators simultaneously, and the sorting speed will be greatly improved. Simply put, it is a sorting algorithm that can perform parallel computing.

[0288] The bitonic sorting network operator is constructed based on the Batcher theorem. The Batcher theorem states that an arbitrary bitonic sequence A with a length of 2 n is divided into two equal-length halves X and Y. The elements in X are compared with the elements in Y one by one in the original order, that is, a[i] is compared with a[i + n] (i < n), and the larger one is placed in the MAX sequence, and the smaller one is placed in the MIN sequence. Then the obtained MAX and MIN sequences are still bitonic sequences, and any element in the MAX sequence is not less than any element in the MIN sequence.

[0289] A so-called bitonic sequence is a sequence composed of a non-strictly increasing sequence X and a non-strictly decreasing sequence Y, such as the sequence (23, 10, 8, 3, 5, 7, 11, 78)

[0290] This scheme is further improved to accept bitone sequences of arbitrary length without adhering to the restriction that the total length of bitone sequences must be 2^n. Furthermore, the bitone sorting operator is improved using a multi-party secure computation operator, realizing a parallelizable privacy-preserving sorting algorithm. This significantly improves sorting performance under fully dense data computation, achieving a speed increase of 500 times compared to traditional sorting methods.

[0291] As another optional implementation of this embodiment, the alignment unit 42 of this embodiment is also used to compare whether the unique identifier fragments corresponding to adjacent sample data fragments are the same based on the sorting matrix of each participant, so as to perform sample feature alignment calculation based on the comparison result and obtain the target intersection sample.

[0292] Optionally, the alignment unit 42 is also used to convert the fragmented comparison result into the corresponding first comparison value or second comparison value according to the preset conversion operator.

[0293] The corresponding attribute data fragments in adjacent sample data fragments are summed in a dense state, and each summation value is multiplied by the first comparison value or the second comparison value in turn to obtain the target intersection sample.

[0294] Specifically, an item-by-item comparison operation is performed based on the sorted fragment ID column.

[0295] Since the same ID can only appear once at most, and the original value of the IDs being compared is unknown during the comparison process, the Sorted-id column is compared item by item, and the comparison results are B2A. The non-id parts are then summed in a secret state, and the B2A result is multiplied by the secret state sum. The execution complexity is O(n).

[0296] Based on this assumption, with the above D′ f For example, perform a dense-state alignment operation:

[0297] Tag section:

[0298] Feature section:

[0299] Where i represents the feature index and j represents the sample index.

[0300] After execution, the final fully dense-state aligned sample is obtained, as shown in the table below:

[0301] Sorted-id Y <![CDATA[Z a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> <224361> <0> <0> <0> <0> <0> <0> <428493> <1> <3.6> <3.5> <-3> <2.6> <3.9> <0> <0> <0> <0> <0> <0> <672684> <0> <0> <0> <0> <0> <0> <858329> <0> <0> <0> <0> <0> <0> <1030916> <1> <0.8> <0.13> <3> <-2.2> <-1.1>

[0302] It should be noted that, due to the second point <428493> Article 3 <428493> The samples have the same ID, therefore the first one <428493>Dense-state alignment was performed. And the third... <428493> Article 4 <672684> The sample IDs are different, therefore the third one... <428493> The value will become all 0s. To avoid misunderstanding, the third sample ID will be changed from... <428493> Changing it to a placeholder will not change the actual intersection result, because the intersection... <428493> The actual data for the sample appears only once. Additionally, <1030916> Since there are duplicate IDs, this is also an intersection. Because the last sample has already been used in the calculation with the last sample, it can be discarded directly.

[0303] In this embodiment, the alignment unit 42 is also used to convert the fragmented comparison result into an arithmetic type first comparison value based on the B2A operator when the comparison results are the same.

[0304] When the comparison results are different, the fragmented comparison results are transformed into a second comparison value of arithmetic type based on the B2A operator.

[0305] It should also be noted that the B2A operator here is an MPC (Multi-Party Computation) operator that can convert fragmented Boolean results into arithmetic results. For example, a fragmented Boolean result might be... <false>After being transformed by the B2A operator, it becomes a fragmented result. <0> Similarly, the fragmented Boolean result is... <true>After being transformed by the B2A operator, it becomes a fragmented result. <1> Therefore when <1> Multiplying by the result of the subsequent addition means preserving the result of the addition itself. If you use... <0> Multiplying by the product, the whole becomes <0> The first comparison value can be the fragmented state result. <1> The second comparison value can be the fragmented state result. <0> .

[0306] In an optional implementation, the secure intersection system of this embodiment further includes:

[0307] The scrambling module 7 is used to perform dense scrambling on several columns of the original fragment matrix based on a preset dense scrambling algorithm, so as to obtain a new original fragment matrix after sample order transformation.

[0308] The original fragment matrices corresponding to different participants are subjected to the same pre-set dense state scrambling algorithm for dense state scrambling.

[0309] It should also be noted that this embodiment can not only perform dense-state scrambling on the original fragment matrix, but also perform dense-state scrambling on the completed fragment matrix.

[0310] By shuffling the dense state of the sample data, none of the participants can deduce the true sample order, and therefore cannot predict the objects to be compared in subsequent comparisons, thus further ensuring the security of user information.

[0311] The logic of the pre-defined dense-state shuffling algorithm is as follows: If the original padded fragmented sample matrix is ​​M, P0 generates transformation matrix 1 and shuffles it, and P1 generates transformation matrix 2 and shuffles it. The transformation matrix refers to the adjustment of the identity matrix. Since P0 cannot know the transformation matrix 2 generated by P1, and P1 cannot deduce the transformation matrix 1 generated by P0, the fragmented transformation sample matrix can be obtained by multiplying the fragmented matrix. That is, the sample order is densely shuffled, so that the participants cannot perceive the true arrangement order of the samples.

[0312] Alternatively, the formula can be shuffled as follows:

[0313] ShuffleMatrix = matrix M @ transformation matrix 1 @ transformation matrix 2

[0314] Therefore, we only need to generate transformation matrices for P0 and P1 respectively, fragment them, and then perform matrix multiplication with the fragmented augmented matrices to obtain the scrambled dense state transformation matrix. The generation of the transformation matrix is ​​based on adjusting the identity matrix; for example, if columns 2 and 3 need to be swapped, simply swap the order of columns 2 and 3 in the identity matrix. An example is shown below:

[0315]

[0316] This embodiment adopts the sorted nearest neighbor comparison approach to control the computational complexity of the privacy intersection algorithm to O(n), improving computational performance while ensuring security. Furthermore, we propose two different fully anonymous secure intersection approaches: one based on dense-state alignment and the other through a dense-state shuffling mechanism, enriching the technical implementation and meeting the needs of more application scenarios.

[0317] Optionally, after the fragment matrix is ​​scrambled in dense state, the secure intersection system of this embodiment further includes:

[0318] Recovery module 8 is used to recover fragmented comparison results.

[0319] Optionally, the alignment unit 42 is also used to perform dense-state summation of the corresponding attribute data fragments in adjacent sample data fragments when the comparison results are the same; and to discard the sample data with the higher sorting position when the comparison results are different, so as to obtain a new target intersection sample.

[0320] Preferably, the secure intersection system also includes:

[0321] Specifically, an item-by-item comparison operation is performed based on the sorted fragmented ID column.

[0322] Since the same ID can only appear once at most, and the original value of the IDs being compared is unknown during the comparison process, the Sorted-id column is compared item by item, and the comparison result is used to determine whether they are the same, without revealing any information. The execution complexity is O(n).

[0323] Based on this assumption, with the above D′ f For example, perform a dense-state alignment operation:

[0324] <124360> and <328492> The close-state comparison returned a false result, so the state was discarded. <124360> This sample.

[0325] <328492> and <328492> The dense state comparison is performed, and the recovery result is True. The dense state addition is then performed on the two sample non-id fragment values.

[0326] Jump directly to the sample at index 3 and perform a comparison of the fragment IDs at indices 3 and 4:

[0327] <572683> and <748329> The close-state comparison returned a false result, so the state was discarded. <572683> This sample.

[0328] <748329> and <930913> The close-state comparison returned a false result, so the state was discarded.<748329> This sample.

[0329] <930913> and <930913> The dense state comparison is performed, and the recovery result is True. The dense state addition is then performed on the two sample non-id fragment values.

[0330] After execution, the new target intersection samples are obtained, as shown in the table below:

[0331] Sorted-id Y <![CDATA[X a1 ]]> <![CDATA[X a2 ]]> <![CDATA[X a3 ]]> <![CDATA[X b1 ]]> <![CDATA[X b2 ]]> <428493> <1> <3.6> <3.5> <-3> <2.6> <3.9> <1030916> <1> <0.8> <0.13> <3> <-2.2> <-1.1>

[0332] This embodiment obtains the original data matrices of each participant, performs local fragmentation processing on the original data matrices of each participant, and then concatenates them. Then, through dense-state sorting and dense-state alignment, fragmented intersection samples are generated. Because the intersection samples are fragmented, the intersection results are guaranteed not to be leaked. Therefore, no sensitive information is exposed throughout the entire secure intersection process. This protects information outside the intersection, and the output results also protect the intersection information, thus enabling the execution of high-standard security requirements and achieving the goal of protecting sensitive data. Furthermore, the secure intersection scheme of this embodiment has low computational complexity, ensuring both security and computational performance to meet the needs of real-world scenarios.

[0333] Example 3

[0334] It should be noted that federated learning models can be various models, such as linear models like Support Vector Machine (SVM) and Logistic Regression (LR), as well as Deep Neural Network (DNN) models, without any restrictions.

[0335] The federated learning algorithm in this embodiment is implemented based on multi-party secure computation secret sharing technology. Based on the multi-party secure computation protocol, various operators for fragmented data computation can be implemented, such as addition, subtraction, multiplication, division, comparison, maximum and minimum values, median, and polynomial expressions of various nonlinear functions. Through dense-state operators, the modeling algorithm can be federated.

[0336] This embodiment uses the federated learning logistic regression algorithm as an example to illustrate the implementation logic of the training method of the federated learning model.

[0337] This embodiment provides a training method for a federated learning model, such as... Figure 7 As shown, the training method in this embodiment includes:

[0338] S1. Obtain fragmented target intersection samples obtained by each participant using the secure intersection method of Example 1.

[0339] This step is used to acquire model training data. After loading, the data type is in a fragmented state, with each party holding a fragment. The complete plaintext data result cannot be deduced, thus ensuring information security.

[0340] S2. Based on the preset partitioning strategy, obtain the training set fragments and test set fragments obtained after each participant performs partitioning on the target intersection sample.

[0341] In this step, each party executes the dataset partitioning according to the agreed-upon training and test set partitioning strategy. The preset partitioning strategy can be either proportional or a random number generation strategy.

[0342] S3. Obtain the prediction fragments obtained by each participant through the calculation of features and weight parameters using their respective training set fragments and test set fragments via a secure multi-party computation operator.

[0343] In this step, feature and weight parameters are calculated based on the MPC operator to obtain the predicted fragment Y0′. Here, the sigmoid function is simulated using a polynomial piecewise function form, Y0′=h w (x i ), where h is the sigmoid function.

[0344] S4. Obtain the gradient fragments obtained by each participant using their respective prediction fragments through the secure multi-party computation operator.

[0345] Specifically, the fragmented state gradient g0 is calculated based on the MPC operator.

[0346]

[0347] In this step, within the federated logistic regression model, gradient calculation requires averaging, and the batch size corresponds to 'm' in the formula. Here, 'm' needs to be calculated by performing a dense summation on the B2A of the comparison results in the fully anonymous PSI, obtaining a fragmented result of the aggregated true intersection count, and then calculating the dense mean. For example, in a batch of fully anonymous PSI output results, due to the simultaneous existence of intersection and non-intersection parts, the batch size is larger than the actual intersection size. Assuming a batch size of 500 samples and the actual intersection size of 300, gradient calculation needs to be based on 300, not 500. This is a difference compared to non-fully anonymous schemes. In fully anonymous schemes, the order of magnitude of the non-zero parts needs to be calculated first, i.e., performing B2A on the comparison results, calculating a dense summation, and obtaining the fragmented result 'm' of the dense intersection size, which is... <300> Then, dense-state division is performed to obtain the dense-state mean. Throughout the process, the magnitude and result of the intersection are not exposed, achieving the goal of full anonymity without affecting model training.

[0348] S5. Each participant uses its own gradient fragment to update the weight coefficients using a secure multi-party computation operator, thereby updating the initial weight fragments to obtain new weight fragments, and then iterates using the new weight fragments.

[0349] Optionally, the weight coefficients w are updated based on the fragmented state gradient g calculated using the MPC operator, resulting in new weight fragments w0.

[0350]

[0351] In this step, the final learning weight fragments are generated. Each party can save the model parameter fragments or restore and save the private weights corresponding to the features they hold, thus completing the parameter saving of the model.

[0352] It should also be noted that the specific computation functions in the main training process will differ for different models. By using a general multi-party secure computation operator, any computation function can be implemented. For nonlinear functions, Taylor expansion or other approximate polynomial expressions can generally be used to solve the problem. This proves that the federated learning model in this embodiment can be used for various models, thus improving its applicability.

[0353] S6. When the weight fragments meet the preset conditions, the target weight fragments are obtained, and the federated learning model is built using the target weight fragments.

[0354] In an optional implementation, after step S3, the training method of the federated learning model in this embodiment further includes:

[0355] S301a. Obtain the loss value fragment by calculating the loss value of each participant based on their respective prediction fragment using a secure multi-party computation operator.

[0356] Optionally, the loss value is calculated based on the MPC operator to obtain the LogLoss fragmentation value J0′.

[0357]

[0358] S301b: Any participant receives loss value fragments sent by other participants, restores all loss value fragments to their corresponding plaintext, and then reports the results to the training log.

[0359] Optionally, the LogLoss value recovered from the loss value fragment J1′ is reported in plaintext to the training log.

[0360] In an optional implementation, prior to step S1, the training method for the federated learning model in this embodiment further includes:

[0361] S0. Load hyperparameter configuration information, including the preset number of iterations;

[0362] Following step S3, the training method for the federated learning model in this embodiment further includes:

[0363] S302a. Determine whether the actual number of iterations has reached the preset number of iterations;

[0364] If so, proceed to step S302a1;

[0365] If not, proceed to step S4.

[0366] If S302a1 is selected, then training will be terminated.

[0367] In an optional implementation, after step S5, the training method of this embodiment further includes:

[0368] S501. Each participant uses a secure multi-party computation operator to determine whether the gradient value of the gradient fragment corresponding to the feature of each participant is less than a preset threshold. If so, any participant receives the comparison result fragment sent by other participants and restores the comparison result fragment to the corresponding plaintext.

[0369] In an optional implementation, the training method of this embodiment further includes:

[0370] S6. Determine whether the training status is terminated.

[0371] If so, proceed to step S61;

[0372] If not, proceed to step S62.

[0373] S61 then outputs and saves the model parameters as the corresponding plaintext model parameters or model parameter fragments according to the usage requirements.

[0374] S62, then execute the gradient update weight coefficient calculation on the gradient fragments using the safe multi-party computation operator to obtain the new target weight fragments.

[0375] It should also be noted that multiplication triples can be used to generate triples when there are only two participants.

[0376] like Figure 8 The diagram shows a flowchart of a training method for a federated learning model.

[0377] The training method of the federated learning model proposed in this embodiment can be extended to various machine learning algorithms. By having each participant load their own local fragmented sample intersection data and using a general multi-party secure computation operator, end-to-end model training can be achieved. It is fully compatible with fully anonymous secure intersection. Through the organic combination of fully anonymous secure intersection and fully anonymous federated learning algorithm, a complete end-to-end fully anonymous vertical federated learning framework is formed. It can support joint modeling scenarios with high security and high performance requirements, without exposing sensitive information, and meet the requirements of high-standard customers.

[0378] Example 4

[0379] This invention also provides a training system for a federated learning model, such as... Figure 9 As shown, the training system in this embodiment includes:

[0380] The intersection sample acquisition module 101 is used to acquire fragmented target intersection samples obtained by each participant using the secure intersection system of Embodiment 2.

[0381] This step is used to acquire model training data. After loading, the data type is in a fragmented state, with each party holding a fragment. The complete plaintext data result cannot be deduced, thus ensuring information security.

[0382] The partitioning module 102 is used to obtain the training set fragments and test set fragments obtained by each participant after performing partitioning on the target intersection sample based on a preset partitioning strategy.

[0383] In this step, each party executes the dataset partitioning according to the agreed-upon training and test set partitioning strategy. The preset partitioning strategy can be either proportional or a random number generation strategy.

[0384] The prediction fragment calculation module 103 is used to obtain the prediction fragments obtained by each participant through feature and weight parameter calculation using their respective training set fragments and test set fragments via a secure multi-party computation operator.

[0385] In this step, feature and weight parameters are calculated based on the MPC operator to obtain the predicted fragment Y0′. Here, the sigmoid function is simulated using a polynomial piecewise function form, Y0′=h w (x i ), where h is the sigmoid function.

[0386] The gradient fragment calculation module 104 is used to obtain the gradient fragments obtained by each participant using their respective predicted fragments through a secure multi-party computation operator.

[0387] Specifically, the fragmented state gradient g0 is calculated based on the MPC operator.

[0388]

[0389] In this step, within the federated logistic regression model, gradient calculation requires averaging, and the batch size corresponds to 'm' in the formula. Here, 'm' needs to be calculated by performing a dense summation on the B2A of the comparison results in the fully anonymous PSI, obtaining a fragmented result of the aggregated true intersection count, and then calculating the dense mean. For example, in a batch of fully anonymous PSI output results, due to the simultaneous existence of intersection and non-intersection parts, the batch size is larger than the actual intersection size. Assuming a batch size of 500 samples and the actual intersection size of 300, gradient calculation needs to be based on 300, not 500. This is a difference compared to non-fully anonymous schemes. In fully anonymous schemes, the order of magnitude of the non-zero parts needs to be calculated first, i.e., performing B2A on the comparison results, calculating a dense summation, and obtaining the fragmented result 'm' of the dense intersection size, which is... <300> Then, dense-state division is performed to obtain the dense-state mean. Throughout the process, the magnitude and result of the intersection are not exposed, achieving the goal of full anonymity without affecting model training.

[0390] The weight fragment update module 105 is used to obtain the weight coefficient update calculation of each participant using their own gradient fragments through the secure multi-party computation operator, so as to update the initial weight fragments to obtain new weight fragments, and use the new weight fragments for iteration.

[0391] Optionally, the weight coefficients w are updated based on the fragmented state gradient g calculated using the MPC operator, resulting in new weight fragments W0.

[0392]

[0393] In this step, the final learning weight fragments are generated. Each party can save the model parameter fragments or restore and save the private weights corresponding to the features they hold, thus completing the parameter saving of the model.

[0394] It should also be noted that the specific computation functions in the main training process will differ for different models. By using a general multi-party secure computation operator, any computation function can be implemented. For nonlinear functions, Taylor expansion or other approximate polynomial expressions can generally be used to solve the problem. This proves that the federated learning model in this embodiment can be used for various models, thus improving its applicability.

[0395] The model building module 106 is used to obtain the target weight fragment when the weight fragment meets the preset conditions, and to build a federated learning model using the target weight fragment.

[0396] In one optional implementation, the training system of this embodiment further includes:

[0397] The loss value fragment calculation module 107 is used to obtain the loss value fragments by each participant through a secure multi-party computation operator based on their respective predicted fragments.

[0398] Optionally, the loss value is calculated based on the MPC operator to obtain the LogLoss fragmentation value J0′.

[0399]

[0400] Each participant receives loss value fragments sent by other participants, restores all loss value fragments to their corresponding plaintext, and then reports them to the training log.

[0401] Optionally, the LogLoss value recovered from the loss value fragment J1′ is reported in plaintext to the training log.

[0402] In one optional implementation, the training system of this embodiment further includes:

[0403] The gradient fragment comparison module 108 is used to determine whether the gradient value of the gradient fragment corresponding to the feature of each participant is less than a preset threshold by using a secure multi-party computation operator. If so, any participant receives the comparison result fragment sent by other participants and restores the comparison result fragment to the corresponding plaintext.

[0404] In one optional implementation, the training system of this embodiment further includes:

[0405] The training status judgment module 109 is used to determine whether the training status is terminated.

[0406] If so, output and save the model parameters as the corresponding plaintext model parameters or model parameter fragments according to the usage requirements;

[0407] If not, then perform gradient update weight coefficient calculation on the gradient fragments using the secure multi-party computation operator to obtain the new target weight fragments.

[0408] It should also be noted that multiplication triples can be used to generate triples when there are only two participants.

[0409] The training method of the federated learning model proposed in this embodiment can be extended to various machine learning algorithms. By having each participant load their own local fragmented sample intersection data and using a general multi-party secure computation operator, end-to-end model training can be achieved. It is fully compatible with fully anonymous secure intersection. Through the organic combination of fully anonymous secure intersection and fully anonymous federated learning algorithm, a complete end-to-end fully anonymous vertical federated learning framework is formed. It can support joint modeling scenarios with high security and high performance requirements, without exposing sensitive information, and meet the requirements of high-standard customers.

[0410] Example 5

[0411] Figure 10 This is a schematic diagram of an electronic device according to Embodiment 3 of the present invention. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method of the above embodiment. Figure 10 The electronic device 30 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0412] like Figure 10 As shown, the electronic device 30 can be manifested as a general-purpose computing device, such as a server device. The components of the electronic device 30 may include, but are not limited to: at least one processor 31, at least one memory 32, and a bus 33 connecting different system components (including memory 32 and processor 31).

[0413] Bus 33 includes a data bus, an address bus, and a control bus.

[0414] The memory 32 may include volatile memory, such as random access memory (RAM) 321 and / or cache memory 322, and may further include read-only memory (ROM) 323.

[0415] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0416] The processor 31 executes various functional applications and data processing by running computer programs stored in the memory 32, such as the playback control method of Embodiment 1 of the present invention.

[0417] Electronic device 30 can also communicate with one or more external devices 34 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 35. Furthermore, the model-generating device 30 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 36. Figure 10 As shown, network adapter 36 communicates with other modules of the model-generated device 30 via bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the model-generated device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.

[0418] It should be noted that although several units / modules or sub-units / modules of the electronic device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.

[0419] Example 6

[0420] This embodiment provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method of the above embodiment.

[0421] The readable storage medium may be more specifically adopted, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.

[0422] In a possible implementation, the present invention can also be implemented as a program product comprising program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps of the above embodiments.

[0423] The program code for executing the present invention can be written in any combination of one or more programming languages. The program code can be executed entirely on the user device, partially on the user device, as a standalone software package, partially on the user device and partially on a remote device, or entirely on a remote device.

[0424] While specific embodiments of the present invention have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of the present invention is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but all such changes and modifications fall within the scope of protection of the present invention.< / true> < / false> < / x> < / true> < / false> < / x>

Claims

1. A secure intersection method for data sharing, characterized in that, The secure intersection method, applied in data sharing scenarios between at least two parties, includes: Obtain the original data matrix of each of the aforementioned participants; The original data matrix includes at least one set of sample data, which includes a unique identifier for identifying each object in the participating parties and attribute data corresponding to the unique identifier. Based on the sample data, the original data matrix of each participant is fragmented to obtain their respective original fragment matrix, and a corresponding random number fragment matrix is ​​generated based on the original fragment matrix. The random number fragment matrix of each participant is then sent to the other participants. The original fragment matrix of each participant is concatenated with the random number fragment matrix obtained from other participants to obtain their respective concatenated matrices. The target intersection samples are determined based on the splicing matrix of each of the participating parties.

2. The secure intersection method in data sharing as described in claim 1, characterized in that, The determination of the target intersection sample based on the splicing matrix of each participant includes: The concatenation matrix of each participant is sorted to obtain a sorting matrix corresponding to the concatenation matrix; Sample feature alignment is calculated based on the sorting matrix of each participant to determine the target intersection sample.

3. The secure intersection method in data sharing as described in claim 2, characterized in that, After obtaining the corresponding original fragment matrices, the secure intersection method further includes: Based on a preset dense-state scrambling algorithm, several columns in the original fragment matrix are densely scrambled to obtain a new original fragment matrix after sample order transformation; The original fragment matrices corresponding to different participants are subjected to the same preset dense state scrambling algorithm for dense state scrambling.

4. The secure intersection method in data sharing as described in claim 2, characterized in that, The original fragment matrix includes sample data fragments, and the sample data fragments include unique identifier fragments and attribute data fragments corresponding to the unique identifier fragments. The process of sorting based on the concatenation matrix of each participant to obtain their respective sorting matrices includes: Sample data fragments with the same unique identifier fragments in the splicing matrix of each participant are extracted based on preset sorting operators and sorted to obtain their respective sorting matrices.

5. The secure intersection method in data sharing as described in claim 4, characterized in that, The step of performing sample feature alignment calculations based on the ranking matrices of each of the participating parties to determine the target intersection sample includes: Based on the sorting matrix of each participant, the unique identifier fragments corresponding to adjacent sample data fragments are compared sequentially to determine whether they are the same. Based on the comparison results, sample feature alignment calculation is performed to obtain the target intersection sample.

6. The secure intersection method in data sharing as described in claim 5, characterized in that, The step of calculating the sample feature alignment based on the comparison results to obtain the target intersection sample includes: The fragmented comparison results are converted into the corresponding first comparison value or second comparison value according to the preset conversion operator; The corresponding attribute data fragments in adjacent sample data fragments are summed in a dense state, and each summation value is multiplied sequentially by the first comparison value or the second comparison value to obtain the target intersection sample.

7. The secure intersection method in data sharing as described in claim 6, characterized in that, The step of converting the fragmented comparison result into a corresponding first comparison value or a second comparison value according to a preset conversion operator includes: When the comparison results are the same, the fragmented comparison results are converted into a first comparison value of arithmetic type based on the B2A operator; When the comparison results are different, the fragmented comparison results are transformed into a second comparison value of arithmetic type based on the B2A operator.

8. The secure intersection method in data sharing as described in claim 6, characterized in that, The step of performing sample feature alignment calculation based on the comparison results also includes: When the comparison results are the same, the corresponding attribute data fragments in the adjacent sample data fragments are summed in a dense state; when the comparison results are different, the sample data with the higher sorting position is discarded to obtain a new target intersection sample.

9. The secure intersection method in data sharing as described in claim 5, characterized in that, After performing sample feature alignment calculation based on the comparison results, the secure intersection method further includes: The fragmented comparison results are then restored.

10. The secure intersection method in data sharing as described in claim 1, characterized in that, After obtaining the original data matrices of each of the participating parties, the secure intersection method further includes: Determine whether the number of columns corresponding to the attribute data in the original data matrix of each participant is the same. If they are not the same, generate virtual attribute data columns according to the preset completion rules to complete the original data matrix. The number of columns in the original data matrix after completion is equal for each of the participating parties.

11. The secure intersection method in data sharing as described in claim 1, characterized in that, The step of fragmenting the original data matrix of each participant based on the sample data to obtain their respective original fragment matrices, and generating corresponding random number fragment matrices based on the original fragment matrices, includes: Based on the sample data, a random number is subtracted from each original data in the original data matrix of each participant to obtain difference fragments and random number fragments. All difference fragments are used as the original fragment matrix, and all random number fragments are used as the random number fragment matrix.

12. The secure intersection method in data sharing as described in claim 4, characterized in that, The preset sorting operator is implemented based on the quicksort algorithm or the sorting network algorithm; And / or, The sorting network algorithm is implemented based on the bitonic sorting algorithm.

13. The secure intersection method in data sharing as described in any one of claims 1-11, characterized in that, The secure intersection method also includes: Determine the type of the unique identifier in the original data matrix; If the unique identifier is a string, then the string-type unique identifier is digitized to obtain a digitized unique identifier; If the unique identifier is numerical, no operation will be performed.

14. A training method for a federated learning model, characterized in that, The training method includes: Obtain fragmented target intersection samples obtained by each participant using the secure intersection method as described in any one of claims 1-13; Based on a preset partitioning strategy, the training set fragments and test set fragments are obtained after each participant performs partitioning on the target intersection sample; The prediction fragments are obtained by each of the participating parties using their respective training set fragments and test set fragments to calculate feature and weight parameters through a secure multi-party computation operator. Obtain gradient fragments obtained by each of the aforementioned participants using their respective predicted fragments through the secure multi-party computation operator; Each of the aforementioned participants uses its own gradient fragment to perform weight coefficient update calculation through the secure multi-party computation operator to update the initial weight fragment to obtain a new weight fragment, and then uses the new weight fragment for iteration; When the weight fragments meet the preset conditions, the target weight fragments are obtained, and the federated learning model is established using the target weight fragments.

15. The training method for the federated learning model as described in claim 14, characterized in that, After obtaining the predicted fragments, the training method further includes: Each participant calculates its loss value fragment using the secure multi-party computation operator based on its respective predicted fragment. Each of the aforementioned participants receives the loss value fragments sent by the other participants, restores all the loss value fragments to their corresponding plaintext, and then reports the results to the training log.

16. The training method for the federated learning model as described in claim 14 or 15, characterized in that, After obtaining gradient fragments, the training method further includes: The gradient value of the gradient fragment corresponding to the feature of each participant is determined by the secure multi-party computation operator. If the gradient value is less than a preset threshold, any participant receives the comparison result fragment sent by the other participants and restores the comparison result fragment to the corresponding plaintext.

17. The training method for the federated learning model as described in claim 14, characterized in that, The training method also includes: Determine whether the training status indicates that training has been terminated; If so, output and save the model parameters as the corresponding plaintext model parameters or model parameter fragments according to the usage requirements; If not, then the gradient update weight coefficients of the gradient fragments are calculated using the secure multi-party computation operator to obtain the new target weight fragments.

18. A secure intersection system for data sharing, characterized in that, The secure intersection system, applicable to data sharing scenarios between at least two parties, includes: The acquisition module is used to acquire the original data matrix of each of the participating parties; The original data matrix includes at least one set of sample data, which includes a unique identifier for identifying each object in the participating parties and attribute data corresponding to the unique identifier. The fragmentation module is used to fragment the original data matrix of each participant based on the sample data to obtain their respective original fragment matrix, generate a corresponding random number fragment matrix based on the original fragment matrix, and send the random number fragment matrix of each participant to other participants. The splicing module is used to splice the original fragment matrix of each participant with the random number fragment matrix obtained from other participants to obtain their respective splicing matrices. The intersection sample determination module is used to determine the target intersection sample based on the splicing matrix of each of the participating parties.

19. A training system for a federated learning model, characterized in that, The training system for the federated learning model includes: The intersection sample acquisition module is used to acquire fragmented target intersection samples obtained by each of the participating parties using the secure intersection system as described in claim 18. The partitioning module is used to obtain training set fragments and test set fragments after each participant performs partitioning on the target intersection sample based on a preset partitioning strategy. The prediction fragment calculation module is used to obtain the prediction fragments obtained by each of the participants through feature and weight parameter calculation using their respective training set fragments and test set fragments via a secure multi-party computation operator. The gradient fragment calculation module is used to obtain the gradient fragments obtained by each of the participating parties through gradient calculation using their respective predicted fragments via the secure multi-party computation operator. The weight fragment update module is used to obtain the weight coefficient update calculation performed by each of the participants using their respective gradient fragments through the secure multi-party computation operator, so as to update the initial weight fragments to obtain new weight fragments, and to use the new weight fragments for iteration; The model building module is used to obtain a target weight fragment when the weight fragment meets a preset condition, and to build the federated learning model using the target weight fragment.

20. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes a computer program, it implements the secure intersection method in data sharing as described in any one of claims 1-13; or, it implements the training method of the federated learning model as described in any one of claims 14-17.

21. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the secure intersection method in data sharing as described in any one of claims 1-13; or, implements the training method of the federated learning model as described in any one of claims 14-17.