A federated data sampling method, system and computer storage medium

By using sample-aligned cross-tabulation and federated clustering methods, the problem of data not being transmitted in plaintext in federated learning is solved, which achieves the goal of maintaining the joint distribution probability while reducing the number of samples and improving the accuracy of the learning model.

CN116226261BActive Publication Date: 2026-05-01LINGSHU TECH CO LTD
View PDF -1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In federated learning, data is held by different data sources, and for data security reasons, data cannot be transmitted in plaintext. This means that a single data source cannot obtain all the data for sampling, and the joint distribution probability of the samples cannot be guaranteed to remain unchanged, which in turn affects the accuracy of the learning model.

Method used

We employ a sample alignment-based cross-clustering and federated clustering method. By obtaining the user IDs and feature values ​​of the participants and initiators, we perform encryption processing and then cross-clustering to obtain a common set of user IDs. We then sample these IDs proportionally to ensure that the joint distribution probability remains unchanged.

Benefits of technology

While reducing the number of samples, the joint probability distribution of the samples remained unchanged, thus improving the accuracy of the learning model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116226261B_ABST
    Figure CN116226261B_ABST
Patent Text Reader

Abstract

The application discloses a federal data sampling method, system and computer storage medium. The method comprises the following steps: acquiring a first user ID and a first feature of a participant, the first feature corresponding to a plurality of first feature values; acquiring a second user ID and a second feature of an initiator, the second feature corresponding to a plurality of second feature values; when it is determined that the number of the two kinds of feature values is less than or equal to a first preset threshold value, or the product of the two is less than or equal to a second preset threshold value, performing cross based on sample alignment to obtain a plurality of first sampling user ID sets; when it is determined that the number of the two kinds of feature values is greater than the first preset threshold value, or the product of the two is greater than the second preset threshold value, performing federal clustering based on sample alignment to obtain a plurality of second sampling user ID sets; adjusting the plurality of first sampling user ID sets or the plurality of second sampling user ID sets within a preset range according to the feature label of the initiator to obtain a target user ID set; and sending the target user ID set to the participant. The method guarantees the accuracy of a learning model.
Need to check novelty before this filing date? Find Prior Art

Description

A federal data sampling method, system, and computer storage medium Technical Field

[0001] This invention relates to the field of federated learning technology, and more specifically, to a federated data sampling method, system, and computer storage medium. Background Technology

[0002] Big data is characterized by massive amounts of data and low value density. When used in machine learning, incorporating all sample data often leads to long computation times and high software and hardware costs. Therefore, machine learning sometimes employs "data sampling" algorithms. Through appropriate sampling algorithms, the entire sample set is reduced to a subset of samples while maintaining the joint probability distribution of the subset. This reduces the number of samples, computation time, and software and hardware consumption while ensuring the accuracy of the machine learning model.

[0003] Traditional machine learning sampling commonly uses:

[0004] (1) Equal probability sampling: random sampling, equidistant sampling, stratified sampling, cluster sampling;

[0005] (2) Non-equal probability sampling: convenience sampling, quota sampling, judgment sampling, snowball sampling;

[0006] However, in federated learning, data is held by different data sources, and for data security reasons, data cannot be transmitted in plaintext to other data sources. This means that a single data source cannot obtain all the data for sampling, and therefore cannot guarantee that the joint probability distribution of the samples remains unchanged.

[0007] There is currently no effective solution to the problem that federated learning technology cannot obtain all the data for sampling from a single data source, thus failing to guarantee the joint distribution probability of the samples and consequently the accuracy. Summary of the Invention

[0008] This invention provides a federated data sampling method, system, and computer storage medium to solve the problem in the prior art where a single data source cannot obtain all the data for sampling during federated learning, thus failing to guarantee the joint distribution probability of the samples and consequently failing to guarantee accuracy.

[0009] To achieve the above objectives, on one hand, the present invention provides a federated data sampling method, the method comprising: S101, obtaining a first user ID and a first feature of a participant, wherein the first feature corresponds to multiple first feature values; and obtaining a second user ID and a second feature of an initiator, wherein the second feature corresponds to multiple second feature values; S102, when it is determined that the number of both the first feature values ​​and the second feature values ​​is less than or equal to a first preset threshold, or the product of the two is less than or equal to a second preset threshold, performing a cross-validation based on sample alignment on the first user ID and the first feature value and the second user ID and the second feature value to obtain multiple first common user ID sets between the first user ID and the second user ID; and sampling each first common user ID set to obtain... Multiple first sampled user ID sets; S103, when it is determined that the number of the first feature value and the second feature value are both greater than the first preset threshold or the product of the two is greater than the second preset threshold, the first user ID, the first feature value and the second user ID, the second feature value are subjected to sample-aligned federated clustering to obtain multiple second common user ID sets between the first user ID and the second user ID; each second common user ID set is sampled to obtain multiple second sampled user ID sets; S104, the multiple first sampled user ID sets or the multiple second sampled user ID sets are adjusted within a preset range according to the feature label of the initiator to obtain a target user ID set; S105, the target user ID set is sent to the participating party.

[0010] Optionally, S102 includes: when it is determined that the number of the first feature value and the second feature value are both less than or equal to a first preset threshold, or the product of the two is less than or equal to a second preset threshold, dividing the first user ID of the participant into multiple first user ID subsets according to the multiple first feature values, and dividing the second user ID of the initiator into multiple second user ID subsets according to the multiple second feature values; performing a cross-validation based on sample alignment on the multiple first user ID subsets and the multiple second user ID subsets to obtain multiple first common user ID sets; and sampling each of the first common user ID sets to obtain multiple first sampled user ID sets.

[0011] Optionally, the step of performing a sample-aligned cross-validation on the plurality of first user ID subsets and the plurality of second user ID subsets to obtain a plurality of first common user ID sets includes: performing a first encryption on the plurality of second user ID subsets to obtain a plurality of first encrypted subsets of second user IDs and sending them to the participating party; performing a second encryption on the plurality of first user ID subsets and the plurality of first encrypted subsets of second user IDs respectively to obtain a plurality of second encrypted subsets of first user IDs and a plurality of double encrypted subsets of second user IDs and sending them to the initiating party; decrypting the plurality of double encrypted subsets of second user IDs to obtain a plurality of second encrypted subsets of second user IDs; and calculating the intersection of the plurality of second encrypted subsets of first user IDs and the plurality of second encrypted subsets of second user IDs to obtain a plurality of first common user ID sets.

[0012] Optionally, the clustering includes: K-means clustering, DBSCAN clustering, hierarchical clustering, and GMM clustering.

[0013] Optionally, sampling each of the first common user ID sets to obtain multiple first sampled user ID sets includes: sampling each of the first common user ID sets proportionally to obtain the multiple first sampled user ID sets; sampling each of the second common user ID sets to obtain multiple second sampled user ID sets includes: sampling each of the second common user ID sets proportionally to obtain the multiple second sampled user ID sets.

[0014] Optionally, after S105, the following is included: decryption of the target user ID set after a second encryption.

[0015] On the other hand, the present invention provides a federated data sampling system, which includes: an acquisition module, configured to acquire a first user ID and a first feature of a participant, wherein the first feature corresponds to a plurality of first feature values; and to acquire a second user ID and a second feature of an initiator, wherein the second feature corresponds to a plurality of second feature values; and a cross-validation module, configured to, when it is determined that the number of both the first feature values ​​and the second feature values ​​is less than or equal to a first preset threshold, or the product of the two is less than or equal to a second preset threshold, perform a cross-validation based on sample alignment between the first user ID and the first feature value and the second user ID and the second feature value to obtain a plurality of first common user ID sets between the first user ID and the second user ID; and to sample each of the first common user ID sets to obtain a plurality of first... The system includes: a sampled user ID set; a clustering module, configured to perform sample-aligned federated clustering of the first user ID and first feature value with the second user ID and second feature value when the number of both the first feature value and the second feature value is greater than the first preset threshold or their product is greater than the second preset threshold, to obtain multiple second common user ID sets between the first user ID and the second user ID; sampling each second common user ID set to obtain multiple second sampled user ID sets; an adjustment module, configured to adjust the multiple first sampled user ID sets or the multiple second sampled user ID sets within a preset range according to the feature tags of the initiator, to obtain a target user ID set; and a sending module, configured to send the target user ID set to the participating party.

[0016] Optionally, the cross-module includes: a partitioning submodule, configured to partition the first user ID of the participant into multiple first user ID subsets based on the multiple first feature values, and partition the second user ID of the initiator into multiple second user ID subsets based on the multiple second feature values, when the number of the first feature values ​​and the second feature values ​​are both less than or equal to a first preset threshold, or the product of the two is less than or equal to a second preset threshold; a cross-module, configured to perform sample alignment-based cross-multiplication on the multiple first user ID subsets and the multiple second user ID subsets to obtain multiple first common user ID sets; and a sampling submodule, configured to sample each first common user ID set to obtain multiple first sampled user ID sets.

[0017] Optionally, the cross-submodule includes: a first encryption unit, configured to perform a first encryption on the plurality of second user ID subsets to obtain a plurality of first encrypted subsets of second user IDs and send them to the participating party; a second encryption unit, configured to perform a second encryption on the plurality of first user ID subsets and the plurality of first encrypted subsets of second user IDs respectively to obtain a plurality of second encrypted subsets of first user IDs and a plurality of double encrypted subsets of second user IDs and send them to the initiator; a first decryption unit, configured to decrypt the plurality of double encrypted subsets of second user IDs to obtain a plurality of second encrypted subsets of second user IDs; and a calculation unit, configured to calculate the intersection of the plurality of second encrypted subsets of first user IDs and the plurality of second encrypted subsets of second user IDs to obtain a plurality of first common user ID sets.

[0018] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the federated data sampling method as described above.

[0019] The beneficial effects of this invention are:

[0020] This invention provides a federated data sampling method, system, and computer storage medium. The method employs sample alignment-based cross-validation, sample alignment-based federated clustering, and proportional sampling of each first common user ID set or each second common user ID set. This ensures that while reducing the number of samples, the joint distribution probability of the samples remains unchanged, thereby guaranteeing the accuracy of the learning model. Attached Figure Description

[0021] Figure 1 is a flowchart of a federal data sampling method provided in an embodiment of the present invention;

[0022] Figure 2 is a flowchart of obtaining multiple first sampled user ID sets provided in an embodiment of the present invention;

[0023] Figure 3 is a flowchart of cross-reference based on sample alignment provided in an embodiment of the present invention;

[0024] Figure 4 is a schematic diagram of a federal data sampling system provided in an embodiment of the present invention;

[0025] Figure 5 is a schematic diagram of the cross module provided in an embodiment of the present invention;

[0026] Figure 6 is a schematic diagram of the cross submodule provided in an embodiment of the present invention. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0028] In federated learning, data is held by different data sources, and for data security reasons, data cannot be transmitted in plaintext to other data sources. This means that a single data source cannot obtain all the data for sampling, and therefore the joint probability distribution of the samples cannot be guaranteed to remain constant.

[0029] Therefore, the present invention provides a federated data sampling method. Figure 1 is a flowchart of a federated data sampling method provided by an embodiment of the present invention. As shown in Figure 1, the method includes:

[0030] S101, obtain the first user ID and first feature of the participant, the first feature corresponding to multiple first feature values; and obtain the second user ID and second feature of the initiator, the second feature corresponding to multiple second feature values;

[0031] Specifically, obtain the first user ID of the participant (assuming the ID is numbered from 0 to 100,000), perform feature selection on the participant, and select the first feature with high representativeness; the first feature corresponds to multiple first feature values ​​(0, 1, 2, 3);

[0032] Obtain the second user ID of the initiator (assuming the ID is a number between 50,000 and 150,000), perform feature selection on the initiator, and select the second feature with high representativeness; the second feature corresponds to multiple second feature values ​​(0, 1, 2, 3, 4, 5).

[0033] There can be multiple participants, but only one initiator.

[0034] S102, when it is determined that the number of the first feature value and the second feature value are both less than or equal to the first preset threshold, or the product of the two is less than or equal to the second preset threshold, the first user ID and the first feature value are cross-referenced with the second user ID and the second feature value based on sample alignment to obtain multiple first common user ID sets between the first user ID and the second user ID; each first common user ID set is sampled to obtain multiple first sampled user ID sets;

[0035] Figure 2 is a flowchart of obtaining multiple first sampled user ID sets provided by an embodiment of the present invention. As shown in Figure 2, step S102 includes:

[0036] S1021, when it is determined that the number of the first feature value and the second feature value are both less than or equal to the first preset threshold, or the product of the two is less than or equal to the second preset threshold, the first user ID of the participant is divided into multiple first user ID subsets according to the multiple first feature values, and the second user ID of the initiator is divided into multiple second user ID subsets according to the multiple second feature values.

[0037] Specifically, if the first feature is gender, the first feature corresponds to two first feature values ​​(0, 1), that is, 0 represents male and 1 represents female; if the second feature is age, the second feature corresponds to three second feature values ​​(0, 1, 2), that is, 0 represents youth, 1 represents middle age and 2 represents old age.

[0038] Based on the two first feature values, the first user IDs of the participants are divided into two subsets of first user IDs (assuming male IDs are 0-75,000 and female IDs are 75,000-100,000); and based on the three second feature values, the second user IDs of the initiator are divided into three subsets of second user IDs (assuming youth IDs are 50,000-60,000 and 80,000-90,000; middle-aged IDs are 60,000-70,000 and 90,000-100,000; and elderly IDs are 70,000-80,000 and 100,000-150,000).

[0039] S1022, perform sample alignment-based cross-interaction on the plurality of first user ID subsets and the plurality of second user ID subsets to obtain a plurality of first common user ID sets;

[0040] Figure 3 is a flowchart of the cross-connection based on sample alignment provided in an embodiment of the present invention. As shown in Figure 3, step S1022 includes:

[0041] S10221, Perform a first encryption on the plurality of subsets of second user IDs to obtain a plurality of first encrypted subsets of second user IDs corresponding to them and send them to the participating party;

[0042] The initiator performs a first encryption on the three subsets of second user IDs (i.e., youth, middle-aged, and elderly) to obtain the corresponding three first encrypted subsets of second user IDs, and sends them to the participating parties.

[0043] S10222, perform second encryption on the plurality of first user ID subsets and the plurality of second user ID first encrypted subsets respectively to obtain a plurality of first user ID second encrypted subsets and a plurality of second user ID double encrypted subsets and send them to the initiator;

[0044] The participating party performs a second encryption on the two first user ID subsets and the three second user ID first encrypted subsets to obtain the two first user ID second encrypted subsets and the three second user ID double encrypted subsets, and sends them to the initiating party.

[0045] S10223, decrypt the first encryption of the plurality of second user ID double-encrypted subsets to obtain the plurality of second user ID second-encrypted subsets;

[0046] The initiator decrypts the first encryption of the three double-encrypted subsets of the second user IDs to obtain the three second-encrypted subsets of the second user IDs.

[0047] S10224, calculate the intersection of the multiple first user ID second encrypted subsets and the multiple second user ID second encrypted subsets to obtain multiple first common user ID sets.

[0048] Calculate the intersection of the two second encrypted subsets of the first user IDs and the three second encrypted subsets of the second user IDs to obtain six sets of the first common user IDs (i.e., young men: 50,000-60,000, middle-aged men: 60,000-70,000, elderly men: 70,000-75,000, young women: 80,000-90,000, middle-aged women: 90,000-100,000, elderly women: 75,000-80,000).

[0049] In this method, the participants do not know the specific feature values ​​of the initiator, and the initiator does not know the specific feature values ​​of the participants, thus ensuring data privacy.

[0050] S1023, each of the first common user ID sets is sampled to obtain multiple first sampled user ID sets.

[0051] S1023 includes:

[0052] Each of the first common user ID sets is sampled proportionally to obtain the plurality of first sampled user ID sets;

[0053] That is, the initiator samples each of the six first common user ID sets at an equal proportion (e.g., 1%) to obtain six first sampled user ID sets; this ensures that the joint distribution probability remains unchanged.

[0054] Furthermore, sample alignment can also involve the participants performing two encryptions and the initiator performing two encryptions, with the participants and initiators finding their common intersection after the two encryptions; this invention does not limit the method of sample alignment.

[0055] S103, when it is determined that the number of the first feature value and the second feature value are both greater than the first preset threshold or the product of the two is greater than the second preset threshold, the first user ID and the first feature value are subjected to sample-aligned federated clustering with the second user ID and the second feature value to obtain multiple second common user ID sets between the first user ID and the second user ID; each second common user ID set is sampled to obtain multiple second sampled user ID sets;

[0056] Specifically, if the first feature corresponds to 100 first feature values ​​(0, 1, 2...99); and the second feature corresponds to 1000 second feature values ​​(0, 0.1, 0.2, 0.3...99), then perform sample-aligned federated clustering on the first user ID and first feature values, and on the second user ID and second feature values.

[0057] Specifically, the 1000 second feature values ​​are first encrypted to obtain a first encrypted subset of 1000 second feature values, which is then sent to the participants.

[0058] The participants perform a second encryption on a first encrypted subset of 100 first feature values ​​and 1000 second feature values, resulting in a second encrypted subset of 100 first feature values ​​and a double encrypted subset of 1000 second feature values, which are then sent concurrently to the initiator.

[0059] The initiator decrypts the first encryption of a double-encrypted subset of 1000 second feature values, obtaining a second-encrypted subset of 1000 second feature values.

[0060] Clustering the 100 first-feature-value second-encryption subsets and the 1000 second-feature-value second-encryption subsets yields multiple clusters. Specifically, participants' 0-10 and initiators' 0-5.7 form the first cluster, participants' 10-20 and initiators' 5.7-10.4 form the second cluster, and so on, resulting in multiple clusters. Assuming that IDs corresponding to 0-10 in the first cluster are numbers from 0 to 20,000, and IDs corresponding to 0-5.7 in the first cluster are numbers from 0 to 10,000, then the first second common user ID set for participants and initiators is numbers from 0 to 10,000; the second cluster corresponds to the second second common user ID set, and similarly, multiple second common user ID sets are obtained.

[0061] In this method, the participants do not know the specific feature values ​​of the initiator, and the initiator does not know the specific feature values ​​of the participants, thus ensuring data privacy.

[0062] Each of the second common user ID sets is sampled to obtain multiple second sampled user ID sets;

[0063] Specifically, the initiator samples each of the second common user ID sets at an equal proportion (e.g., 1%) to obtain multiple second sampled user ID sets; this ensures that the joint distribution probability remains unchanged.

[0064] Furthermore, sample alignment can also involve the participants performing two encryptions and the initiator performing two encryptions, with the participants and initiators finding their common intersection after the two encryptions; this invention does not limit the method of sample alignment.

[0065] Furthermore, the clustering includes: K-means clustering, DBSCAN clustering, hierarchical clustering, and GMM clustering.

[0066] The first and second preset thresholds can be set based on practical experience and can also be adjusted according to actual needs. This application does not impose any restrictions on this.

[0067] S104, Adjust the multiple first sampled user ID sets or the multiple second sampled user ID sets within a preset range according to the feature tags of the initiator to obtain the target user ID set;

[0068] Specifically, assuming the initiator's feature label is weight, and the proportion of heavy-weight individuals in the original initiator is 30%, after dividing the user into multiple first-sample user ID sets or multiple second-sample user ID sets, the proportion of heavy-weight individuals in each first-sample user ID set or each second-sample user ID set will be different. For example, in six first-sample user ID sets: the proportion of heavy-weight individuals in the first first-sample user ID set is 2%, the proportion in the second first-sample user ID set is 50%, the proportion in the third first-sample user ID set is 15%, the proportion in the fourth first-sample user ID set is 10%, the proportion in the fifth first-sample user ID set is 20%, and the proportion in the sixth first-sample user ID set is 30%. Assuming that the final proportion of heavy-weight individuals in all first-sample user ID sets is 20%, it is necessary to sample more users in the second first-sample user ID set, for example, the sampling ratio can be adjusted from 1% to 2%. However, it should be noted that this ratio should not be adjusted too high, as this will change the joint distribution probability. Therefore, the sampling ratios for the six first-sample user ID sets are 1%, 2%, 1%, 1%, 1%, and 1%, respectively.

[0069] The first or second sampled user ID set obtained after all adjustments is used as the target user ID set.

[0070] S105, the target user ID set is sent to the participating parties.

[0071] Specifically, following S105:

[0072] Decryption of the target user ID set using a second encryption.

[0073] Figure 4 is a schematic diagram of a federal data sampling system provided in an embodiment of the present invention. As shown in Figure 4, the system includes:

[0074] The acquisition module 201 is used to acquire the first user ID and first feature of the participant, wherein the first feature corresponds to multiple first feature values; and to acquire the second user ID and second feature of the initiator, wherein the second feature corresponds to multiple second feature values.

[0075] The cross-validation module 202 is used to perform sample-aligned cross-validation on the first user ID and the first feature value and the second user ID and the second feature value when the number of the first feature value and the second feature value are both less than or equal to a first preset threshold, or the product of the two is less than or equal to a second preset threshold, to obtain multiple first common user ID sets between the first user ID and the second user ID; and to sample each first common user ID set to obtain multiple first sampled user ID sets.

[0076] Figure 5 is a structural schematic diagram of the cross module provided in an embodiment of the present invention. As shown in Figure 5, the cross module includes:

[0077] The partitioning submodule 2021 is used to partition the first user ID of the participant into multiple subsets of first user IDs based on the multiple first feature values ​​when the number of the first feature value and the second feature value are both less than or equal to a first preset threshold, or the product of the two is less than or equal to a second preset threshold, and to partition the second user ID of the initiator into multiple subsets of second user IDs based on the multiple second feature values.

[0078] Cross submodule 2022 is used to perform sample alignment-based cross-interaction on the plurality of first user ID subsets and the plurality of second user ID subsets to obtain a plurality of first common user ID sets;

[0079] Figure 6 is a schematic diagram of the cross submodule provided in an embodiment of the present invention. As shown in Figure 6, the cross submodule includes:

[0080] The first encryption unit 20221 is used to perform a first encryption on the plurality of second user ID subsets to obtain a corresponding plurality of second user ID first encrypted subsets and send them to the participating party;

[0081] The second encryption unit 20222 is used to perform second encryption on the plurality of first user ID subsets and the plurality of second user ID first encrypted subsets respectively, to obtain a plurality of first user ID second encrypted subsets and a plurality of second user ID double encrypted subsets and send them to the initiator;

[0082] The first decryption unit 20223 is used to decrypt the first encryption of the plurality of second user ID double encryption subsets to obtain the plurality of second user ID second encryption subsets;

[0083] The calculation unit 20224 is used to calculate the intersection of the plurality of first user ID second encrypted subsets and the plurality of second user ID second encrypted subsets to obtain a plurality of first common user ID sets.

[0084] Referring again to Figure 5, the cross module further includes a sampling submodule 2023, which is used to sample each of the first common user ID sets to obtain multiple first sampled user ID sets.

[0085] Referring again to Figure 4, the system further includes: a clustering module 203, used to perform sample-aligned federated clustering on the first user ID and the first feature value and the second user ID and the second feature value when it is determined that the number of the first feature value and the second feature value are both greater than the first preset threshold or the product of the two is greater than the second preset threshold, to obtain multiple sets of second common user IDs between the first user ID and the second user ID; and to sample each set of second common user IDs to obtain multiple sets of second sampled user IDs;

[0086] The adjustment module 204 is used to adjust the plurality of first sampled user ID sets or the plurality of second sampled user ID sets within a preset range according to the feature tags of the initiator, so as to obtain the target user ID set;

[0087] The sending module 205 is used to send the target user ID set to the participating parties.

[0088] The data acquisition system of this application can execute any of the data acquisition methods in the foregoing embodiments, which will not be described in detail here.

[0089] The beneficial effects of this invention are:

[0090] This invention provides a federated data sampling method, system, and computer storage medium. The method employs sample alignment-based cross-validation, sample alignment-based federated clustering, and proportional sampling of each first common user ID set or each second common user ID set. This ensures that while reducing the number of samples, the joint distribution probability of the samples remains unchanged, thereby guaranteeing the accuracy of the learning model.

[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A federal data sampling method, characterized in that, include: S101, Obtain the first user ID and first feature of the participant, wherein the first feature corresponds to multiple first feature values; The process involves obtaining the initiator's second user ID and second feature, where the second feature corresponds to multiple second feature values; S102, when it is determined that the number of both the first feature value and the second feature value is less than or equal to a first preset threshold, or their product is less than or equal to a second preset threshold, the participant's first user ID is divided into multiple first user ID subsets based on the multiple first feature values, and the initiator's second user ID is divided into multiple second user ID subsets based on the multiple second feature values; the multiple second user ID subsets are first encrypted to obtain multiple first encrypted subsets of second user IDs and sent to the participant; the multiple first user ID subsets and the multiple first encrypted subsets of second user IDs are second encrypted to obtain multiple second encrypted subsets of first user IDs and multiple double encrypted subsets of second user IDs and sent to the initiator; Decrypting the first encryption of the plurality of double-encrypted subsets of second user IDs yields a plurality of second-encrypted subsets of second user IDs; Calculate the intersection of the plurality of first user ID second encrypted subsets and the plurality of second user ID second encrypted subsets to obtain a plurality of first common user ID sets; sample each of the first common user ID sets to obtain a plurality of first sampled user ID sets; S103, when it is determined that the number of the first feature value and the second feature value are both greater than the first preset threshold or the product of the two is greater than the second preset threshold, perform first encryption on the plurality of second feature values ​​to obtain a plurality of second feature value first encrypted subsets and send them to the participating party; perform second encryption on the plurality of first feature values ​​and the plurality of second feature value first encrypted subsets respectively to obtain a plurality of first feature value second encrypted subsets and a plurality of second feature value double encrypted subsets and send them to the initiator; Decrypting the multiple subsets of second feature values ​​that are double-encrypted by the first encryption yields multiple subsets of second feature values ​​that are second-encrypted. Cluster the plurality of first feature values ​​and second encryption subsets and the plurality of second feature values ​​to obtain multiple clusters, and obtain a second common user ID set between the first user ID and the second user ID corresponding to each cluster; sample each second common user ID set to obtain multiple second sampled user ID sets; S104, adjust the plurality of first sampled user ID sets or the plurality of second sampled user ID sets within a preset range according to the feature tags of the initiator to obtain a target user ID set; S105, send the target user ID set to the participating party.

2. The method according to claim 1, characterized in that: The clustering methods include: K-means clustering, DBSCAN clustering, hierarchical clustering, and GMM clustering.

3. The method according to claim 1, characterized in that: Sampling each of the first common user ID sets to obtain multiple first sampled user ID sets includes: sampling each of the first common user ID sets proportionally to obtain multiple first sampled user ID sets; sampling each of the second common user ID sets to obtain multiple second sampled user ID sets includes: sampling each of the second common user ID sets proportionally to obtain multiple second sampled user ID sets.

4. The method according to claim 1, characterized in that, Following S105 is: decryption of the target user ID set after a second encryption.

5. A federal data sampling system, characterized in that, include: The acquisition module is used to acquire the first user ID and first feature of the participant, wherein the first feature corresponds to multiple first feature values; And obtain the initiator's second user ID and second feature, where the second feature corresponds to multiple second feature values; The cross-module is used to, when determining that the number of both the first feature value and the second feature value is less than or equal to a first preset threshold, or their product is less than or equal to a second preset threshold, divide the first user ID of the participant into multiple first user ID subsets based on the multiple first feature values, and divide the second user ID of the initiator into multiple second user ID subsets based on the multiple second feature values; perform a first encryption on the multiple second user ID subsets to obtain multiple first encrypted subsets of second user IDs and send them to the participant; and perform a second encryption on the multiple first user ID subsets and the multiple first encrypted subsets of second user IDs respectively to obtain multiple second encrypted subsets of first user IDs and multiple double encrypted subsets of second user IDs and send them to the initiator. Decrypting the first encryption of the plurality of double-encrypted subsets of second user IDs yields a plurality of second-encrypted subsets of second user IDs; The intersection of the plurality of first user ID second encrypted subsets and the plurality of second user ID second encrypted subsets is calculated to obtain a plurality of first common user ID sets; each of the first common user ID sets is sampled to obtain a plurality of first sampled user ID sets; a clustering module is used to perform first encryption on the plurality of second feature values ​​when it is determined that the number of both the first feature value and the second feature value is greater than a first preset threshold or the product of the two is greater than a second preset threshold, to obtain a plurality of second feature value first encrypted subsets and send them to the participating party; the plurality of first feature values ​​and the plurality of second feature value first encrypted subsets are respectively subjected to second encryption to obtain a plurality of first feature value second encrypted subsets and a plurality of second feature value double encrypted subsets and send them to the initiator; Decrypting the multiple subsets of second feature values ​​that are double-encrypted by the first encryption yields multiple subsets of second feature values ​​that are second-encrypted. The plurality of first feature values ​​and second encryption subsets are clustered to obtain multiple clusters, and a second common user ID set between the first user ID and the second user ID corresponding to each cluster is obtained; each second common user ID set is sampled to obtain multiple second sampled user ID sets; an adjustment module is used to adjust the plurality of first sampled user ID sets or the plurality of second sampled user ID sets within a preset range according to the feature tags of the initiator to obtain a target user ID set; a sending module is used to send the target user ID set to the participating party.

6. The system according to claim 5, characterized in that, The cross-module includes: a partitioning submodule, used to partition the first user ID of the participant into multiple first user ID subsets based on the multiple first feature values, and to partition the second user ID of the initiator into multiple second user ID subsets based on the multiple second feature values, when the number of the first feature values ​​and the second feature values ​​are both less than or equal to a first preset threshold, or the product of the two is less than or equal to a second preset threshold; a cross-module, used to perform sample alignment-based cross-multiplication on the multiple first user ID subsets and the multiple second user ID subsets to obtain multiple first common user ID sets; and a sampling submodule, used to sample each first common user ID set to obtain multiple first sampled user ID sets.

7. The system according to claim 6, characterized in that, The cross-submodule includes: a first encryption unit, used to perform a first encryption on the plurality of second user ID subsets to obtain a plurality of first encrypted subsets of second user IDs and send them to the participating party; a second encryption unit, used to perform a second encryption on the plurality of first user ID subsets and the plurality of first encrypted subsets of second user IDs respectively to obtain a plurality of second encrypted subsets of first user IDs and a plurality of double encrypted subsets of second user IDs and send them to the initiator; a first decryption unit, used to decrypt the plurality of double encrypted subsets of second user IDs to obtain a plurality of second encrypted subsets of second user IDs; and a calculation unit, used to calculate the intersection of the plurality of second encrypted subsets of first user IDs and the plurality of second encrypted subsets of second user IDs to obtain a plurality of first common user ID sets.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the federal data sampling method as described in any one of claims 1 to 4.