Model aggregation method, device, equipment, medium and product

By using a data sharing platform to jointly generalize and protect the privacy of data from multiple data providers, and obtaining the intersection data for model updates within a federated learning framework, the problem of poor accuracy in model aggregation in existing technologies is solved, achieving higher security and accuracy.

CN121744384APending Publication Date: 2026-03-27CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing model aggregation methods only employ one-sided generalization, resulting in poor prediction accuracy of the aggregated model.

Method used

By using a data sharing platform, data from multiple data providers is jointly generalized, privacy protection measures are adopted to obtain the intersection data, and the model is updated under the federated learning framework, with encrypted gradients used for collaborative computation.

Benefits of technology

This improves the model's predictive accuracy and security, prevents data leaks and malicious attacks, and ensures the accuracy and completeness of model updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121744384A_ABST
    Figure CN121744384A_ABST
Patent Text Reader

Abstract

The invention provides a model aggregation method and device, equipment, a medium and a product, and relates to the technical field of big data. The method comprises the steps that data of at least one first data party and data of at least one second data party are subjected to joint generalization, then split according to data provided by all the parties and returned to clients of all the parties, and after the clients of all the data parties conduct anonymization on the data of all the data parties, privacy intersection is conducted to obtain intersection data. And after training the initial model according to the local data corresponding to the intersection data in the federated learning task by each data party, transmitting an encryption gradient between clients corresponding to each data party to obtain a final model. Data generalization is enhanced while data availability is guaranteed through joint generalization, data leakage can be avoided by splitting and returning after joint generalization, encryption gradient is adopted, decryption into plaintext is not needed, accuracy and integrity of model updating are guaranteed, and safety and reliability of the federated learning model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data technology, and in particular to a method, apparatus, equipment, medium and product for model aggregation. Background Technology

[0002] With the rapid development of big data technology, data is characterized by its large scale and diversity, and the volume of data is growing dramatically. Data application has entered a new stage of in-depth development, and data, as a new production factor and an important strategic resource, is playing an increasingly important role in enterprise production and management. To adapt to the new development situation, the country is actively creating a data sharing and circulation ecosystem with the participation of multiple stakeholders. It has clearly proposed, under the premise of ensuring data security, to promote the circulation and application of data in certain fields in a tiered, categorized, and orderly manner.

[0003] Currently, mainstream data sharing platforms use a method of unilateral generalization followed by federated learning for model prediction, resulting in poor accuracy of the aggregated model predictions. Summary of the Invention

[0004] The purpose of this invention is to provide a model aggregation method, apparatus, device, medium, and product to solve the problem that existing model aggregation methods only use a one-way generalization approach, resulting in poor prediction accuracy of the aggregated model.

[0005] To achieve the above objectives, embodiments of the present invention provide a model aggregation method, wherein the aggregation is performed by a data sharing platform, the data sharing platform comprising multiple clients, including:

[0006] A joint generalization process is performed on at least one generalized first local data from at least one first data party and on at least one generalized second local data from a second data party to generate at least one first generalized data corresponding to the at least one first local data, which is then sent to the first clients corresponding to each of the first data parties. Additionally, second generalized data corresponding to the second local data is generated and sent to the second clients corresponding to the second data parties. The first local data includes data collected by the first data party from multiple first users; the second local data includes data collected by the second data party from multiple second users; and the multiple clients include the first clients and the second clients.

[0007] The first client performs privacy protection measures on the first generalized data to obtain first privacy data, and the second client performs privacy protection measures on the second generalized data to obtain second privacy data;

[0008] Based on the first privacy data and the second privacy data, intersection data is obtained; wherein, the intersection data includes the intersection cardinality of the first user and the second user, and the encrypted identifier of the intersection user in the first privacy data and the second privacy data corresponding to the intersection cardinality;

[0009] Federated learning is initiated based on the intersection data. The final model is obtained by updating the initial model established under the federated learning framework through the second client based on the first encrypted gradient calculated by the first data provider on the first client.

[0010] Optionally, the method further includes, before performing joint generalization processing on at least one generalized first local data from at least one first data party and on generalized second local data from the second data party:

[0011] The first local data corresponding to each first data party is binned by the first client corresponding to each first data party, and the first binned data corresponding to each first data party is obtained.

[0012] By generalizing the first bin data corresponding to each of the first data parties through the first client, the number of data points in each bin of each first feature in each first bin data satisfies the first preset anonymity value, and at least one generalized first local data is obtained.

[0013] Optionally, the method, wherein joint generalization processing is performed on at least one generalized first local data from at least one first data party and on generalized second local data from a second data party to generate at least one first generalized data corresponding to the at least one first local data and send it to the first client corresponding to each of the first data parties, and second generalized data corresponding to the second local data and send it to the second client corresponding to the second data party, includes:

[0014] Based on the generalized first local data and the generalized second local data, the first joint data is obtained by joint sample generalization;

[0015] Based on the first joint data, a first information value is obtained for each of the plurality of fourth features relative to the target variable; wherein, the plurality of fourth features are features other than the target feature where the target variable is located in the third features, and the third features include a first feature in at least one of the generalized first local data and a second feature in the generalized second local data; the target variable is a bin of the target feature among the plurality of pre-specified third features;

[0016] Based on the first information value, the binning interval of the fourth feature of the first joint data is scaled, and the second joint data is obtained based on the target criterion, wherein the area under the curve and / or the Kolmogorov-Smirnov value of the first joint data are optimal when the number of data points in each binning interval meets the first preset anonymity value.

[0017] At least one first generalized data is generated based on the second joint data and each of the first features and sent to the corresponding first client; and second generalized data is generated based on the second joint data and the second features and sent to the second client.

[0018] Optionally, the method, wherein obtaining a first information value of each of a plurality of fourth features relative to the target variable based on the first joint data, includes:

[0019] The number of first samples and the amount of second samples in each bin of the fourth feature are calculated based on the target variable; wherein, the number of first samples is the number of data points that conform to the target variable; and the number of second samples is the number of data points that do not conform to the target variable.

[0020] The information value contribution value is obtained by multiplying the difference between the first value and the second value in each bin of each fourth feature by the natural logarithm of the ratio of the first value and the second value; wherein, the first value is the proportion of the first sample quantity in the total data points of the corresponding bin, and the second value is the proportion of the second sample quantity in the total data points of the corresponding bin.

[0021] The information value contribution value of each of the fourth features is summed to obtain the corresponding first information value.

[0022] Optionally, the method, wherein scaling the binning intervals of the fourth feature of the first joint data according to the first information value, and obtaining the second joint data based on the target criterion, includes:

[0023] Based on a preset information value threshold, the fourth feature whose first information value is higher than the information value threshold is binned, and the fourth feature whose first information value is lower than the information value threshold is generalized to obtain third joint data.

[0024] Using the binning interval of each of the fourth features in the third joint data as a variable, the scaling factor is obtained based on the target criterion;

[0025] The binning intervals of each of the fourth features in the third joint data are adjusted according to the scaling factor to obtain the second joint data.

[0026] Optionally, the method, wherein obtaining first privacy data by performing privacy protection measures on the first generalized data through the first client, includes:

[0027] After the first data party and the second data party exchange keys, and the first data party obtains the shared key, the first client generates a dynamic mask based on the shared key.

[0028] The first client obtains the first initial privacy data based on the dynamic mask and the first generalized data.

[0029] The first client sets a first privacy budget based on the first data sensitivity of the first initial privacy data, and determines a first Laplace noise based on the first privacy budget.

[0030] Add the first Laplace noise to the first initial privacy data to obtain the first privacy data.

[0031] Optionally, the method, wherein obtaining the intersection data based on the first privacy data and the second privacy data includes:

[0032] Each of the first clients hashes and encrypts each value in the first privacy data corresponding to each of the first data parties, adds it to the sum of the shared key and the first random integer, obtains the first intersection data, and sends it to the second client; wherein, the shared key is generated by exchanging public keys of key pairs generated by the first client and the second client respectively based on the elliptic curve algorithm for each of the first data parties;

[0033] The second client hashes and encrypts each value in the second privacy data, adds it to the shared key and the sum of the second random integer, obtains the second intersection data, and sends it to each of the first clients.

[0034] By counting the number of equal values ​​in the first intersection data and the second intersection data corresponding to each of the first data parties through each first client, multiple first intersection data are obtained; and by counting the number of equal values ​​in the first intersection data and the second intersection data through the second client, multiple second intersection data are obtained.

[0035] The minimum value among the multiple first intersection data and multiple second intersection data is taken as the intersection data.

[0036] Optionally, the method, wherein, in the case of initiating federated learning based on the intersection data, and updating the initial model established under the federated learning framework through the second client based on the first encrypted gradient calculated by the first data party on the first client, to obtain the final model, includes:

[0037] The first encrypted gradient obtained by training the initial model using the data corresponding to the intersection data in the first privacy data of each first data party in the corresponding first client is sent to the second client.

[0038] The first model obtained by training the initial model on the second client using the data corresponding to the intersection data in the second privacy data is updated sequentially using each of the first encryption gradients;

[0039] The process iteratively involves sending each of the first encryption gradients to the second client and updating the first model using each of the first encryption gradients, until a preset number of iterations is met, and the final model is obtained.

[0040] To achieve the above objectives, embodiments of the present invention provide a model aggregation apparatus, wherein the aggregation is performed by a data sharing platform, the data sharing platform including multiple clients, including:

[0041] A first generation module is configured to perform joint generalization processing on at least one generalized first local data from at least one first data party and generalized second local data from a second data party, generating at least one first generalized data corresponding to the at least one first local data and sending it to a first client corresponding to each of the first data parties, and generating second generalized data corresponding to the second local data and sending it to a second client corresponding to the second data party; wherein, the first local data includes data collected by the first data party from multiple first users; the second local data includes data collected by the second data party from multiple second users; the multiple clients include the first client and the second client;

[0042] The first acquisition module is used to acquire first privacy data by performing privacy protection measures on the first generalized data through the first client, and to acquire second privacy data by performing privacy protection measures on the second generalized data through the second client;

[0043] The second acquisition module is used to acquire intersection data based on the first privacy data and the second privacy data; wherein, the intersection data includes the intersection cardinality of the first user and the second user, and the encrypted identifier of the intersection user in the first privacy data and the second privacy data corresponding to the intersection cardinality;

[0044] The third acquisition module is used to initiate federated learning based on the intersection data, and to obtain the final model by updating the initial model established under the federated learning framework through the second client based on the first encrypted gradient calculated by the first data party on the first client.

[0045] To achieve the above objectives, embodiments of the present invention provide a model aggregation device, comprising: a processor, a memory, and a program or instructions stored in the memory and executable on the processor; wherein, when the processor executes the program or instructions, it implements the model aggregation method as described above.

[0046] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the steps in the aggregation method of the model as described above.

[0047] To achieve the above objectives, embodiments of the present invention provide a computer program product, comprising computer instructions that, when executed by a processor, implement the steps of the aggregation method of the model as described above.

[0048] The beneficial effects of the above-described technical solution of the present invention are as follows:

[0049] In this embodiment of the invention, after jointly generalizing the data from at least one first data party and a second data party, the data is split according to the data provided by each party and returned to the clients of each party. This joint generalization enhances data generalization while ensuring data availability, and the splitting and returning of data after joint generalization avoids data leakage, further protecting the privacy of the original data. After anonymizing their respective data through the clients of each data party, privacy intersection is performed to obtain the intersection data. Each data party trains the initial model based on the local data corresponding to the intersection data in the federated learning task, and encrypted gradients are passed between the data parties to obtain the final model. This embodiment of the invention eliminates the need to decrypt the encrypted gradients into plaintext, ensuring the accuracy and integrity of model updates, improving the security and reliability of the federated learning model, and preventing performance degradation or erroneous results due to malicious attacks. Attached Figure Description

[0050] Figure 1 This is a schematic diagram of the model aggregation method described in an embodiment of the present invention;

[0051] Figure 2 This is a flowchart of the model aggregation method described in an embodiment of the present invention;

[0052] Figure 3 This is a flowchart of step S1 of the model aggregation method described in this embodiment of the invention;

[0053] Figure 4 This is a flowchart of step S2 of the model aggregation method described in this embodiment of the invention;

[0054] Figure 5 This is a schematic diagram of the shared key for the aggregation method of the model described in this embodiment of the invention;

[0055] Figure 6 This is a flowchart of step S3 of the model aggregation method described in this embodiment of the invention;

[0056] Figure 7 This is a flowchart of step S4 of the model aggregation method described in this embodiment of the invention;

[0057] Figure 8 This is a flowchart of step S5 of the model aggregation method described in this embodiment of the invention;

[0058] Figure 9 This is a flowchart of step S6 of the model aggregation method described in this embodiment of the invention;

[0059] Figure 10 This is a schematic diagram of the polymerization apparatus of the model described in an embodiment of the present invention. Detailed Implementation

[0060] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0061] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0062] In various embodiments of the present invention, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0063] In addition, the terms "system" and "network" are often used interchangeably in this article.

[0064] In the embodiments provided by this invention, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.

[0065] For ease of understanding, the following describes some aspects of the embodiments of the present invention:

[0066] like Figure 1 As shown in the embodiment of the present invention, a model aggregation method is executed by a data sharing platform, which includes multiple clients, including:

[0067] Step D10: Perform joint generalization processing on at least one generalized first local data from at least one first data party and on the generalized second local data from a second data party to generate at least one first generalized data corresponding to the at least one first local data and send it to the first client corresponding to each of the first data parties; and generate second generalized data corresponding to the second local data and send it to the second client corresponding to the second data party; wherein, the first local data includes data collected by the first data party from multiple first users; the second local data includes data collected by the second data party from multiple second users; the multiple clients include the first client and the second client;

[0068] It should be noted that, as Figure 2As shown, this embodiment of the invention uses a "fitting room" scenario of a data sharing platform as the first example for illustration. The "fitting room" operation process includes two parts: data privacy processing and privacy computation. Data privacy processing includes data preprocessing, identity protection, and privacy enhancement, while privacy computation includes secure alignment, joint modeling, and optimized training. The first data party is the data provider of the data sharing platform, designated as A. If there are multiple first data parties, they are designated as A1, A2, etc. The second data party is the data receiver of the sharing platform, designated as car dealer B. The following mainly uses A as an example. A possesses raw data such as basic user information, driving time, and geographical location, while B possesses raw data such as the car model and price purchased by the user. Both parties initiate collaborative data processing on the data sharing platform. B needs to work with A to analyze high-potential customers, but the two parties cannot directly share raw data. A's first client is C1, B's second client is C2, and the aggregation server is S. The implementation process of this invention is as follows: In step S1, A and B perform sample generalization preprocessing on their respective original data, and obtain a generalized feature dataset (i.e., the first generalized data and the second generalized data) that meets privacy requirements through binning and joint deep generalization; In step S2, to avoid leakage of data identity documents (IDs), both parties use Hash-based Message Authentication Code (HMAC) hashing and dynamic masking based on Elliptic Curve Diffie-Hellman (ECDH) to dynamically anonymize the generalized dataset, generating a privacy-secure anonymous ID dataset; In step S3, to further enhance data privacy, Laplace noise is injected into the sample data in the anonymous ID dataset to complete differential privacy processing, resulting in a dataset with differential privacy protection (i.e., the first privacy data and the second privacy data); In step S4, both parties need to identify a common user group and perform privacy set intersection using ECDH technology. The SetIntersection (PSI-CA) algorithm is used to perform anonymous privacy intersection calculation to determine the cardinality of the intersection users and the anonymity identifier (i.e., the intersection data). In step S5, for the intersection user data, both parties establish a joint training model under the federated learning framework, and perform encrypted collaborative calculation of the gradient through Multi-Party Computation encrypted gradient (MPC) technology. In step S6, the batch gradient descent algorithm is used to optimize the gradient calculation efficiency, and local small batch data parallel processing is used to accelerate model convergence, and finally the jointly trained model (i.e., the final model) is obtained for business analysis.

[0069] exist Figure 2 In the data preprocessing, corresponding to step S1 in the privacy data security design, sample generalization processing achieves the effect of erasing sensitive data details, ensuring joint features satisfy K=50 (which may vary depending on actual needs) anonymity, and protecting the privacy of the original data after binning, merging, or proportionally amplifying the data. In step D10 of this embodiment, sample generalization processing is used as a privacy protection method in the data preparation stage. Generalization processing protects the privacy of the original data and minimizes the impact on the calculation results. Sample generalization processing includes two parts: preliminary generalization calculation and joint deep generalization. Preliminary generalization calculation involves discretizing continuous data to achieve data preprocessing, converting the data into a form more suitable for privacy calculations, facilitating data analysis and model building, reducing data precision, lowering the possibility of attackers directly obtaining sensitive information through data values, achieving data privacy, preventing data back-calculation, and avoiding the risk of privacy leakage due to excessive differences in data value ranges. Joint deep generalization processing includes, on the basis of sample generalization processing, joint deep generalization processing, which involves steps such as calculating the influence coefficient, scaling the binning interval again, and adjusting the scaling factor to amplify the binning interval of each feature until the K-value anonymity effect is met, thereby further protecting the privacy and security of the original data.

[0070] Step D20: Apply privacy protection measures to the first generalized data through the first client to obtain first privacy data; and apply privacy protection measures to the second generalized data through the second client to obtain second privacy data.

[0071] It should be noted that, in Figure 2 In the identity protection section, corresponding to step S2 in the privacy data security design, dynamic anonymization is implemented. This removes sensitive ID information, and both parties use the processed hash value to perform encrypted intersection operations, securely obtaining the intersection portion of the dataset and ensuring the original data is not exposed. In the privacy enhancement section, corresponding to step S3 in the privacy data security design, differential privacy processing of the sample data obfuscates the original data by adding Laplace noise and allocating a reasonable privacy budget. The data retains, to some extent, the statistical characteristics of the original data. Privacy protection measures are then applied to the corresponding generalized data through the client, resulting in privacy-preserving data.

[0072] In step S2, the IDs in the generalized data (i.e., the first generalized data and the second generalized data) from stage S1 are further privatized. HMAC hashing and dynamic masking are used to transform the data IDs, preventing the leakage of sensitive ID information and ensuring data privacy and security. HMAC hashing and dynamic masking algorithms are two commonly used techniques for protecting sensitive information. HMAC hashing, or Hash-based Message Authentication Code, uses a key and a hash function to generate a fixed-length hash value. This hash value depends not only on the data being hashed but also on the key. Even with the same data, different keys will generate different hash values. To prevent the leakage of sensitive ID information, sensitive ID information is used as input, combined with a confidential key, and a hash value is generated using the HMAC algorithm. When storing or transmitting ID information, the original ID is not used directly; instead, the corresponding HMAC hash value is used. When verifying the legitimacy of the ID, the same key and ID information are used again to calculate the HMAC hash value, which is then compared with the stored or transmitted hash value. Because a correct hash value cannot be generated without a key, even if an attacker obtains the hash value, it is difficult to deduce the original sensitive ID information. Dynamic masking algorithms are a technique that partially hides or replaces sensitive information according to certain rules. It typically determines the masking method and range dynamically based on different conditions, such as data location, time, and user role. For example, for an ID card number, it can decide to hide several digits based on the current timestamp or the user's access permissions, replacing them with specific characters (such as the asterisk "*"). When displaying or transmitting sensitive ID information, the ID information is partially hidden according to pre-set dynamic masking rules. For example, for a user's bank card number, when displayed to the user on the front end or transmitted between internal systems, only the first and last few digits of the card number are displayed, with the middle part replaced by mask characters. In this way, even if the information is intercepted during transmission, attackers cannot obtain the complete sensitive ID information. At the same time, the dynamic nature of the mask increases the difficulty for attackers to crack it.

[0073] In step S3, differential privacy processing is applied to the data. In steps S1 and S2, generalized computation and dynamic anonymization can largely protect data privacy in most scenarios. To prevent data leakage caused by model back-inference attacks in extreme cases, differential privacy processing of the sample data is further adopted in step S3. By injecting controllable noise into the sample data output from steps S1 and S2, differential privacy protection is achieved, ensuring that the computation results are resistant to differential attacks and preventing malicious parties from obtaining additional privacy information through the computation process or results.

[0074] Step D30: Obtain intersection data based on the first privacy data and the second privacy data; wherein, the intersection data includes the intersection cardinality of the first user and the second user, and the encrypted identifier of the intersection user in the first privacy data and the second privacy data corresponding to the intersection cardinality;

[0075] It should be noted that, in Figure 2 In the secure alignment, corresponding to step S4 in the privacy data security design, anonymized privacy intersection is used. This achieves secure computation of the data intersection, generating a value that only contains the number of intersection elements, without specifying the actual content of the intersection elements, thus calculating the number of intersection elements. In step S4, the anonymized privacy intersection algorithm allows participants to calculate only the number of intersection elements (i.e., the intersection cardinality) without revealing the specific content of their respective sets.

[0076] Step D40: Start federated learning based on the intersection data, and obtain the final model by updating the initial model established under the federated learning framework through the second client based on the first encrypted gradient calculated by the first data party on the first client.

[0077] It should be noted that, in Figure 2 In the joint modeling process, corresponding to step S5 in the privacy data security design, federated learning gradient encryption achieves the effect of establishing a virtual shared model. By encrypting the gradients, a federated learning model trained based on encrypted gradients is obtained while satisfying encryption security. In the optimization training process, corresponding to step S6 in the privacy data security design, batch gradient descent achieves the effect of stabilizing and optimizing model parameters, outputting the model parameter set that converges to a lower loss value, allowing the model to gradually adjust to the optimal parameter configuration and improve model evaluation metrics. In step S5, encrypted federated learning gradient computation is used. This stage is based on the data intersection calculated in step S4 (i.e., the intersection data). The goal of federated learning is to train a prediction model to achieve high-value user detection and prediction. Under the federated learning framework, MPC technology is used to perform encrypted collaborative computation of gradients, ensuring that participants complete model aggregation without disclosing the original gradient data, while also preventing malicious attackers from using gradient information to back-calculate training data. In step S6, batch gradient descent is used as the optimization algorithm. Batch Gradient Descent (BGD) optimizes the gradient calculation efficiency in federated learning, accelerates model convergence by using small-batch parallel processing of local data, improves the accuracy of model calculation, and reduces data sensitivity, avoiding data leakage problems that may be caused by training with a single data point.

[0078] In this embodiment, after joint generalization of the data from at least one first data party and one second data party, the data is split according to the data provided by each party and returned to the clients of each party. This joint generalization enhances data generalization while ensuring data availability, and the splitting and returning of the data after joint generalization avoids data leakage, further protecting the privacy of the original data. After anonymizing their respective data through the clients of each data party, privacy intersection is performed to obtain the intersection data. Each data party trains the initial model based on its local data corresponding to the intersection data in the federated learning task, and encrypted gradients are passed between the data parties to obtain the final model. This embodiment of the invention eliminates the need to decrypt the encrypted gradients into plaintext, ensuring the accuracy and integrity of model updates, improving the security and reliability of the federated learning model, and preventing performance degradation or erroneous results due to malicious attacks.

[0079] Optionally, the method, prior to step D10, further includes:

[0080] The first local data corresponding to each first data party is binned by the first client corresponding to each first data party, and the first binned data corresponding to each first data party is obtained.

[0081] By generalizing the first bin data corresponding to each of the first data parties through the first client, the number of data points in each bin of each first feature in each first bin data satisfies the first preset anonymity value, and at least one generalized first local data is obtained.

[0082] In this embodiment, such as Figure 3 As shown, in step S1, preliminary calculation of generalization in sample generalization processing is adopted. First, binning is performed, followed by joint generalization of unilateral features. Taking one of the first clients corresponding to each of the first data parties as an example, the first local data is binned through the first client, and then the obtained first binned data is generalized to ensure that the number of data points in each bin meets the first preset anonymity value (usually represented by K), and finally at least one generalized first local data is obtained. Similarly, on the second client side, the second local data is binned through the second client, and then the obtained second binned data is generalized to ensure that the number of data points in each bin meets the first preset anonymity value, and the generalized second local data is obtained.

[0083] First, binning involves dividing the data into different intervals according to certain rules. These intervals are continuous and do not overlap. Each data point is assigned to a specific bin, thereby achieving data discretization.

[0084] First, ensure that the number of data points in each bin is approximately equal. Then, based on the total number of data points and the set number of bins, calculate the number of data points that each bin should contain. After binning, use the K-anonymity algorithm to perform joint analysis on the data from A and B, while protecting customer privacy, to explore the matching degree.

[0085] User A is binned according to the user's travel time: [0-6] hours, [6-9] hours, [9-12] hours, [12-15] hours, [15-18] hours, [18-21] hours, and [21-24] hours. For simplicity, 10 sample users are selected in the first example, requiring an anonymity effect of K=3, meaning that each quasi-identifier combination has at least 3 records to achieve anonymity. In actual business scenarios, this principle can be extended to larger K values, such as K=50.

[0086] In the first example, the quasi-identifiers and sensitive information are defined as follows: For user A, basic user information (such as age and gender), driving time, and driving location can be used as quasi-identifiers; for user B, the model and price of the car purchased can be used as quasi-identifiers. Deeper information such as users' specific consumption habits and driving preferences, which are not intended to be disclosed, are considered sensitive information.

[0087] Assume that A's first local data is as shown in Table 1.

[0088] Table 1 First Local Data

[0089]

[0090] Assume that B's second local data is as shown in Table 2.

[0091] Table 2 Second Local Data

[0092]

[0093] The first local data of A is binned to obtain the first binned data as shown in Table 3.

[0094] Table 3 Data for the First Container

[0095]

[0096] In the first binning data, the number of customers in some time periods (bins) is less than 3, requiring generalization or merging to meet the requirement of K=3 (i.e., the first preset anonymity value). Processing steps:

[0097] Generalized geographical location: "Chaoyang District" and "Haidian District" are merged into "Six Urban Districts", while "Changping District" remains unchanged.

[0098] Generalization age: Grouping ages into:

[0099] Youth: 25-35 years old

[0100] Middle age: 36-45 years old

[0101] Merging Time Periods: Merging time periods with fewer than 3 customers:

[0102] The times [12-15], [15-18], and [18-21] are merged into [12-21].

[0103] [21-24] hours and [0-6] hours are combined into the nighttime period ([21-6] hours).

[0104] The generalized first local data is shown in Table 4.

[0105] Table 4 shows the first local data that has been generalized.

[0106]

[0107] Correspondingly, the generalized second local data is shown in Table 5.

[0108] Table 5 shows the generalized second local data.

[0109]

[0110] At this point, the joint features do not yet satisfy K=3, and further generalization processing is required.

[0111] Optionally, the method, wherein step D10 includes:

[0112] Based on the generalized first local data and the generalized second local data, the first joint data is obtained by joint sample generalization;

[0113] Based on the first joint data, a first information value is obtained for each of the plurality of fourth features relative to the target variable; wherein, the plurality of fourth features are features other than the target feature where the target variable is located in the third features, and the third features include a first feature in at least one of the generalized first local data and a second feature in the generalized second local data; the target variable is a bin of the target feature among the plurality of pre-specified third features;

[0114] Based on the first information value, the binning interval of the fourth feature of the first joint data is scaled, and the second joint data is obtained based on the target criterion, wherein the area under the curve and / or the Kolmogorov-Smirnov value of the first joint data are optimal when the number of data points in each binning interval meets the first preset anonymity value.

[0115] At least one first generalized data is generated based on the second joint data and each of the first features and sent to the corresponding first client; and second generalized data is generated based on the second joint data and the second features and sent to the second client.

[0116] In this embodiment, unilateral feature joint generalization is applied to at least one first local data and the second local data that have been generalized, merging or proportionally enlarging all feature binning intervals until the joint features of each data party achieve an anonymity effect of K=3, thereby obtaining the first joint data.

[0117] Nighttime hours + six urban districts + youth + A series + 100,000-200,000 yuan: Customers 1 and 8, need to add customer 7 (different gender but other attributes are the same).

[0118] [6-9] Time + Six Urban Districts + B Series + 10-20 / 20-300,000 RMB: Customers 2 and 9, Customer 5 needs to be added (same gender but different time periods, needs to be further merged).

[0119] [9-12] Age + Middle Age + C-Series / Luxury Gasoline Car + 200,000-300,000 / 300,000-400,000 RMB: Customers 3 and 10, Customer 6 needs to be added (different geographical locations but other attributes are the same).

[0120] [12-21] Time + six urban districts + middle-aged + luxury fuel vehicle + 300,000-400,000 yuan: Customers 4 and 6, and need to add customer 3 (different time periods but other attributes are the same).

[0121] Check if the number of customers for each quasi-identifier combination is ≥3:

[0122] By further adjustments (such as merging time periods and generalizing car brands), all combinations ultimately satisfy K=3. Using the K-anonymity algorithm, B achieves precise user profiles for different driving times without compromising user privacy, thereby optimizing marketing strategies.

[0123] In this embodiment of the invention, Figure 3 In step S1, joint deep generalization is employed, and binning interval scaling and adjustment calculations are performed after calculating the influence coefficient. Specifically, the influence coefficient calculation process involves obtaining the first information value of each of the multiple fourth features relative to the target variable based on the first joint data. The binning interval scaling and adjustment calculation process involves scaling the binning intervals of the fourth features of the first joint data according to the first information value, and obtaining second joint data based on the target criterion.

[0124] After calculating the second joint data, at least one first generalized data is generated based on the second joint data and each of the first features, and sent to the corresponding first client. Similarly, second generalized data is generated based on the second joint data and the second features, and sent to the second client. In other words, the second joint data is divided into different data types corresponding to different clients according to the characteristics of the local data.

[0125] Optionally, the method, wherein obtaining a first information value of each of a plurality of fourth features relative to the target variable based on the first joint data, includes:

[0126] The number of first samples and the amount of second samples in each bin of the fourth feature are calculated based on the target variable; wherein, the number of first samples is the number of data points that conform to the target variable; and the number of second samples is the number of data points that do not conform to the target variable.

[0127] The information value contribution value is obtained by multiplying the difference between the first value and the second value in each bin of each fourth feature by the natural logarithm of the ratio of the first value and the second value; wherein, the first value is the proportion of the first sample quantity in the total data points of the corresponding bin, and the second value is the proportion of the second sample quantity in the total data points of the corresponding bin.

[0128] The information value contribution value of each of the fourth features is summed to obtain the corresponding first information value.

[0129] In this embodiment, the process of calculating the influence coefficient is that both parties A and B jointly calculate the Information Value (IV) value (i.e. the first information value) to obtain the influence coefficient of each feature. The magnitude of the influence coefficient is inversely proportional to the IV. The larger the IV, the more important the feature is, and the smaller the value of the influence coefficient is. The minimum influence coefficient of a feature is 1.

[0130] The influence coefficient (IV) is a statistic used to assess the degree of influence of independent variables on dependent variables. Following the binning algorithm described above, we will obtain the influence coefficient of each feature by jointly calculating the IV.

[0131] Suppose we have a dataset as shown in Table 6, which contains data information for A and B.

[0132] Table 6 Data Information for A and B

[0133]

[0134] Calculate the IV value using the following steps (taking the target variable "price grouping = 30-40" as an example):

[0135] 1.1 Calculate WOE. WOE stands for Weight of Evidence, which quantifies the contribution of each group to the ability to distinguish between good and bad samples (i.e., the number of the first sample and the number of the second sample). Its value is obtained by taking the natural logarithm of the ratio of the bad sample rate to the good sample rate within the group, and is used to assess the predictive strength of the variable. The formula is: WOE = ln(p yi / p ni ),p yi It is the proportion of bad samples in this group out of the total number of bad samples (i.e., the first value), p ni This is the proportion of good samples in this group out of the total number of good samples (i.e., the second value). Good samples and bad samples are relative to a specific research or business objective (i.e., the target variable). Generally, samples that meet the expected results are defined as good samples, and samples that do not meet the expected results are defined as bad samples. For example, in this case, samples that meet the price range of 30-40 are good samples.

[0136] 1.2 The IV value is calculated using the following formula:

[0137] ;

[0138] Using the above formula, the data in Table 6 were calculated to obtain the IV values ​​of the time period bins relative to the target variable "price grouping = 30-40" as shown in Table 7.

[0139] Table 7 shows the IV values ​​of time-period binning relative to the target variable "price grouping = 30-40".

[0140]

[0141] Similarly, the influence coefficients of geographical location and age group on the target variable "price group = 30-40", which are also known as IV values ​​(i.e., the first information value), are calculated, resulting in Table 8.

[0142] Table 8. First Information Value

[0143]

[0144] Optionally, the method, wherein scaling the binning intervals of the fourth feature of the first joint data according to the first information value, and obtaining the second joint data based on the target criterion, includes:

[0145] Based on a preset information value threshold, the fourth feature whose first information value is higher than the information value threshold is binned, and the fourth feature whose first information value is lower than the information value threshold is generalized to obtain third joint data.

[0146] Using the binning interval of each of the fourth features in the third joint data as a variable, the scaling factor is obtained based on the target criterion;

[0147] The binning intervals of each of the fourth features in the third joint data are adjusted according to the scaling factor to obtain the second joint data.

[0148] In this embodiment, the step of scaling the binning interval is to scale each feature binning interval again according to the influence coefficient: the feature scaling coefficient of the most important feature (i.e. the target feature) is 1 (consistent with the influence coefficient), that is, the binning interval remains unchanged, and the other feature binning intervals are scaled according to the influence coefficient (i.e. the first information value).

[0149] Based on the calculated IV values, the influence of each feature on the target variable can be determined, and the binning intervals can be scaled and optimized to better improve model performance or uncover data value. The following is a binning interval scaling scheme for each feature. The adjustment strategy is to attempt to further split high-IV bins while satisfying K=3, that is, to bin the fourth feature whose first information value is higher than the information value threshold. The steps are as follows:

[0150] 2.1 Time-based binning (IV=0.825);

[0151] Problem: The original segmentation [12-21] covers multiple peak driving periods (midday, afternoon, and evening), potentially obscuring the detailed driving patterns. The following adjustment can be made:

[0152] Original box splitting: [12-21] hours;

[0153] After splitting: [12-15] hours (original boxes) [15-18] hours (original boxes) [18-21] hours (original boxes);

[0154] If the number of samples in each bin after splitting is ≥3, then retain it; otherwise, adjacent time periods need to be merged (e.g., [15-21]).

[0155] 2.2 Geographical location (IV=0.671);

[0156] Problem: There are only 2 samples from Changping District, violating the K=3 anonymity rule. K=3 anonymity should be satisfied first.

[0157] Adjustment strategy: Merge low-sample regions into a larger range.

[0158] Example adjustment:

[0159] Original distribution boxes: six urban districts vs. Changping District;

[0160] After adjustment:

[0161] The six urban districts (Haidian District and Chaoyang District);

[0162] Non-urban six districts (Changping District has been merged into other suburban areas, more suburban data needs to be added);

[0163] 2.3 Simplification of moderate / low IV value characteristics (gender, age grouping), i.e., further generalization processing.

[0164] Age grouping (IV=0.136);

[0165] Problem: The predictive power of sorting between young and middle-aged people is not significantly different.

[0166] Adjustment strategy: merge bins to reduce dimensionality.

[0167] Example adjustment:

[0168] Original classification: Youth (≤35 years old) vs. Middle-aged (>35 years old);

[0169] Merge into `adult`.

[0170] The third joint data is finally obtained, as shown in Table 9.

[0171] Table 9 Third Joint Data

[0172]

[0173] By using the binning interval of each of the fourth features in the third joint data as a variable, and based on the scaling factor obtained from the target criterion, the binning interval of the fourth feature is further adjusted to obtain the second joint data, thereby obtaining the final first information value, ensuring that:

[0174] Improved discriminative power of high-IV features (such as time periods).

[0175] The IV values ​​of low IV characteristics (such as age) further decreased, validating the rationale for merging.

[0176] All bins satisfy K=3 anonymity (≥3 samples are required for non-urban six districts). Scaling ends if this is achieved. Otherwise, the scaling factor is adjusted and recalculated to enlarge the binning interval for each feature until K=3 anonymity is satisfied. The adjustment formula is given below:

[0177] ① The formula for defining the scaling factor is: y=F(x), where x is the binning interval of each feature, y is the adjusted scaling interval, and F is the interval scaling calculation formula.

[0178] ② Calculate the y-value of each feature that satisfies K=3 after adjustment.

[0179] ③ Calculate AUC and KS using the results of generalization with the binning coefficients of y.

[0180] ④ Using strategies including but not limited to Bayesian optimization and Simulated Annealing, adjust the coefficients in the F(x) formula and repeat ①②③ to obtain the optimal Area Under the Curve (AUC) and Kolmogorov-Smirnov (KS) for F(x), and output F(x).

[0181] AUC is an important metric for evaluating the performance of classification models. The following is the evaluation and tuning process:

[0182] 3.1 Initial binning and AUC baseline assessment:

[0183] Based on the existing K=3 anonymized binning, the initial AUC value is calculated as the optimization baseline.

[0184] Example initial binning (as shown in Table 6):

[0185] Time slots are divided into: nighttime, [6-9] hours, [9-12] hours, and [12-21] hours.

[0186] Geographical location: the six urban districts and non-urban districts;

[0187] Age grouping: Adult (combining youth and middle age).

[0188] Initial AUC assumption: 0.75 (to be calculated based on the actual model).

[0189] 3.2 Binning Adjustment and AUC Optimization:

[0190] Feature optimization (taking time-time binning as an example);

[0191] Objective: To refine the binning of high predictive power features and improve the model's discriminative power.

[0192] Adjust strategy:

[0193] When splitting bins with excessively wide coverage (such as [12-21]), check whether k=3 is satisfied after splitting.

[0194] If there are not enough samples after splitting, merge adjacent time periods, retrain the model, and validate the AUC.

[0195] Example adjustment:

[0196] Original box: [12-21]

[0197] Try splitting it into:

[0198] [12-15] (sample size = 1, k = 3 is not satisfied);

[0199] [15-18] (sample size = 1, k = 3 is not satisfied);

[0200] [18-21] (sample size = 2, k = 3 is not satisfied).

[0201] Since splitting the data does not satisfy k=3, it needs to be merged into:

[0202] New binning: [12-18] (sample number = 2) + [18-21] (sample number = 2), still does not satisfy k=3, and finally merged into [12-21] (sample number = 4), keeping the original binning.

[0203] 3.3 Balanced Optimization of AUC and K=3:

[0204] If merging geographical locations leads to a significant decrease in AUC, alternative solutions need to be sought.

[0205] Supplementary data: In collaboration with other service providers, we have introduced more suburban samples, bringing the total number of samples outside the six urban districts to ≥3.

[0206] Feature crossover: Binning geographical location and time period is crossover to generate new bins (such as the six urban districts + nighttime hours), which may satisfy k=3 and retain the distinguishability.

[0207] Cross-binding is shown in Table 10.

[0208] Table 10 Cross-binding

[0209]

[0210] Problem: The number of samples in some cross-binding is still insufficient (e.g., only 1 sample when the sample size is not in the six urban districts + [9-12]).

[0211] Solution: Merge non-urban six districts with urban six districts, retain only time-based binning, and sacrifice geographic location information to prioritize K=3.

[0212] 3.4 Final Adjustment Plan

[0213] The optimized binning is shown in Table 11 (satisfying k=3 and AUC maximized).

[0214] Table 11 Optimized Binning

[0215]

[0216] Recalculate AUC: If geographic location merging causes the AUC to drop to 0.70, but time-time binning retains high discrimination, the overall AUC is still acceptable. The solution is adjusted here according to actual needs.

[0217] Another evaluation and adjustment scheme is the KS curve algorithm, which measures the model's ability to distinguish between positive and negative samples, defined as the maximum distance between the cumulative distribution curves of positive and negative samples. In binning, a higher KS value indicates a stronger ability of the bin to distinguish the target variable (e.g., "price ≥ 300,000 yuan"). The goal of binning adjustment is:

[0218] Maximize the KS value of each bin to improve the model's predictive ability;

[0219] Merging bins with low KS values ​​simplifies model complexity;

[0220] Anonymization is always satisfied at k=3 to ensure individual privacy.

[0221] The formula for calculating the KS value is as follows:

[0222] KS=max(∣CumulativePositive%−CumulativeNegative%∣);

[0223] Here, CumulativePositive% refers to the percentage of cumulative positive samples out of the total positive samples (i.e., the cumulative good sample ratio), and CumulativeNegative% refers to the percentage of cumulative negative samples out of the total negative samples (i.e., the cumulative bad sample ratio). The KS value is the maximum absolute value of the difference between these two percentages, used to measure the model's ability to distinguish between positive and negative samples. The positive samples in this part are binned data within the price-level grouping features that satisfy the condition of a price level ≥ 300,000 yuan, while the negative samples are binned data within the price-level grouping features that do not satisfy the condition of a price level ≥ 300,000 yuan.

[0224] The adjustment process based on the KS curve scheme is as follows:

[0225] 4.1 Initial binning and KS value calculation:

[0226] Assume the original binning is as shown in Table 12 (the target variable is "price ≥ 300,000 yuan").

[0227] Table 12 shows the KS values ​​for the assumed original binning.

[0228]

[0229] Initial KS value: The maximum cumulative difference between each bin is 100% (from bins in [6-9]).

[0230] 4.2 Merging bins with low KS values:

[0231] Problem: The KS value of the [9-12] time-division bin is 0%, indicating the worst discrimination ability.

[0232] Adjustment strategy: Merge adjacent bins (k=3 anonymity required).

[0233] Example merge:

[0234] The [9-12] time (sample size = 2) and the [6-9] time (sample size = 2) are merged into the [6-12] time (total sample size = 4, satisfying k = 3).

[0235] The KS value of the merged bins needs to be recalculated.

[0236] 4.3 Splitting high KS value bins:

[0237] Problem: The KS value of the time-division bins in [6-9] is as high as 100%, but the number of samples is only 2, which violates k=3.

[0238] Adjust strategy: After merging, try splitting high-potential bins.

[0239] If splitting is not possible (insufficient samples), retain the merged bins.

[0240] Example adjustment:

[0241] The merged [6-12] time bin (sample number = 4) was attempted to be split into [6-9] time bins and [9-12] time bins, but the number of samples after splitting was still insufficient (2 for each).

[0242] When forcibly retaining merged bins [6-12], the KS value needs to be recalculated.

[0243] 4.4 Recalculate the KS value:

[0244] The adjusted binning and KS values ​​are shown in Table 13.

[0245] Table 13 Adjusted binning and KS value

[0246]

[0247] Adjusted KS value: Maximum cumulative difference is 60% (from [6-12] time bins).

[0248] By adjusting other features in the same way, we can obtain the final binning scheme that satisfies K=3, as shown in Table 14.

[0249] Table 14 shows the binning schemes that ultimately satisfy K=3.

[0250]

[0251] Based on actual needs, the optimal algorithm is selected from the adjustments of AUC and KS values ​​to obtain a suitable binning scheme, achieving the generalization calculation objective and acquiring the second joint data. At least one first generalized data is generated based on the second joint data and each of the first features, and sent to the corresponding first client; similarly, second generalized data is generated based on the second joint data and the second features, and sent to the second client.

[0252] Optionally, the method, wherein step D20 includes:

[0253] After the first data party and the second data party exchange keys, and the first data party obtains the shared key, the first client generates a dynamic mask based on the shared key.

[0254] The first client obtains the first initial privacy data based on the dynamic mask and the first generalized data.

[0255] The first client sets a first privacy budget based on the first data sensitivity of the first initial privacy data, and determines a first Laplace noise based on the first privacy budget.

[0256] Add the first Laplace noise to the first initial privacy data to obtain the first privacy data.

[0257] In this embodiment, such as Figure 4 As shown, in step S2, HMAC hashing and a dynamic masking algorithm are combined for dynamic anonymization. First, HMAC hashing is used to process sensitive ID information, generating a unique hash value (i.e., the shared key) for authentication and data integrity verification. Then, in scenarios where ID information needs to be displayed or transmitted, a dynamic masking algorithm is used to partially hide the original ID or hash value (i.e., generating a real-time dynamic mask), further enhancing the security of sensitive information. Following the Diffie-Hellman identity verification protocol, the privacy of the original data is ensured when both parties calculate the hash value and perform subsequent encrypted intersection operations.

[0258] The Diffie-Hellman protocol is a key exchange protocol based on the difficulty of the discrete logarithm problem over finite fields. Its core principle is that two communicating parties, over an insecure communication channel, exchange some public information to compute a shared secret key, which can then be used for subsequent encrypted communication. The security of the Diffie-Hellman protocol relies on the difficulty of the discrete logarithm problem. When the prime number p is sufficiently large, computing the shared key K from the publicly available p, g, A, and B is extremely difficult, as this is equivalent to solving the discrete logarithm problem, for which no efficient algorithm currently exists that can solve it in polynomial time.

[0259] Suppose that the two parties involved in the computation are party A and party B, each of whom has a dataset containing identifiers (IDs), and they need to securely obtain the intersection of the two datasets without exposing the original data.

[0260] 5.1 Diffie-Hellman Key Exchange:

[0261] like Figure 5 As shown, keys A and B are calculated based on the elliptic curve base point (ECDH protocol). The ECDH protocol utilizes the principles of Elliptic Curve Cryptography (ECC). In an elliptic curve, a base point G is selected; it is a specific point on the elliptic curve. Each communicating party chooses a private key; for example, party A chooses private key a, and party B chooses private key b.

[0262] Party A calculates the key A = aG, which is obtained by performing an elliptic curve scalar multiplication operation between the base point G and the private key a; Party B calculates the key B = bG. Then the two parties exchange A and B.

[0263] Party A can calculate the shared key K=aB=a(bG)=(ab)G, and Party B can calculate the shared key K=bA=b(aG)=(ab)G, thus obtaining the same shared key K.

[0264] 5.2 Generating a dynamic mask:

[0265] Both parties use a shared key K as a random seed to generate a dynamic mask using a pseudo-random function (such as PRF). For example:

[0266] mask=PRF(K).

[0267] 5.3 Hash the identifier:

[0268] Party A performs a hash calculation on each identifier id_i in its dataset, combined with a dynamic mask, to generate a fixed-length hash value h_i. For example:

[0269] h_i = H(id_i + mask), where H is a hash function (such as SHA-256).

[0270] Party B performs similar processing on the identifiers in its own dataset to generate a hash value h_j.

[0271] Party A encrypts the generated hash value set {h_i} to obtain the first initial privacy data.

[0272] Similarly, Party B encrypts its own hash value set {h_j} to obtain the second initial privacy data. This allows for the secure acquisition of the intersection of the two datasets (i.e., the intersection data) during subsequent encrypted intersection operations, while simultaneously ensuring the privacy of the original data.

[0273] like Figure 6 As shown, in step S3, differential privacy processing is performed. First, the first initial privacy data is preprocessed through data cleaning, data transformation, and data normalization to ensure a unified data format. Then, a privacy budget is allocated to the preprocessed first initial privacy data. This allocation is achieved by determining the total privacy budget, allocating based on query type, allocating based on data subsets, using dynamic allocation strategies, and combining multiple mechanisms to reasonably allocate the privacy budget and achieve optimal privacy protection. Next, a dynamic masking method is used. By determining the privacy budget and sensitivity, Laplace noise is generated and added to the original data (i.e., the first privacy data). The specific steps are as follows:

[0274] 6.1 Data preprocessing: The original sample data (i.e., the first initial privacy data) is cleaned and normalized to eliminate outliers and format differences, ensuring data consistency.

[0275] 6.1.1 Data Cleaning:

[0276] Handling Missing Values: Examine the dataset for missing values ​​and choose an appropriate handling method based on the specific situation. For a small number of missing values, you can delete samples containing missing values ​​or use statistical measures such as the mean, median, and mode to fill in the missing values. If the proportion of missing values ​​is high, more complex methods may be needed, such as machine learning-based missing value prediction models.

[0277] Remove duplicate values: Identify and remove duplicate samples from the dataset to avoid interference from subsequent analysis and privacy protection. Duplicates can be identified by comparing the unique identifier field or all feature fields of the data.

[0278] Correcting data errors: Check for errors in the data, such as incorrect data types or incorrect value ranges, and correct them. For example, if an age field contains negative numbers, or if a date field has an incorrect format, these issues need to be corrected.

[0279] 6.1.2 Data Conversion:

[0280] Discretization: For continuous data, convert it into discrete data according to business needs. For example, divide age into different age groups, or income into different income levels. Discretization can reduce the range of data values, reduce data sensitivity, and also help improve the effectiveness of differential privacy protection.

[0281] Encoding: For categorical data, it is converted into numerical data to facilitate computer processing and analysis. Common encoding methods include one-hot encoding and label encoding. For example, the gender field "male" and "female" can be encoded as 0 and 1 respectively, or it can be represented as [1,0] and [0,1] using one-hot encoding.

[0282] Feature extraction and selection: This involves extracting representative features from the raw data and selecting the subset of features most relevant to the analysis task. This reduces data dimensionality, lowers computational complexity, and also helps protect privacy by reducing the amount of data that needs to be processed and protected. For example, in image data, feature vectors can be extracted from the image; in text data, word vectors can be extracted.

[0283] 6.1.3 Data Normalization:

[0284] Standardization: Transforming the feature values ​​of data into standardized data with zero mean and unit variance. Standardization makes different features comparable and avoids the influence of certain features with large value ranges on the analysis results. This scheme uses the Z-score standardization method, with the formula xstd=(x−μ) / σ, where x is the original data, μ is the mean, and σ is the standard deviation.

[0285] Normalization to a specific interval: Normalizing the feature values ​​of the data to a specified interval, such as [0,1] or [-1,1]. This restricts the range of data values ​​to a smaller interval, which helps improve the efficiency and stability of differential privacy algorithms. A commonly used method is Min-Max normalization, as shown in the following formula, where x min and x max These are the minimum and maximum values ​​of the data, respectively.

[0286] ;

[0287] 6.2 Privacy Budget Allocation: Set a privacy budget (ε) to control the trade-off between noise intensity and privacy protection.

[0288] 6.2.1 Determine the total privacy budget:

[0289] First, the total privacy budget for the entire data processing process needs to be determined based on factors such as data sensitivity, application scenarios, and privacy protection requirements. total A smaller value for ϵ (privacy budget parameter) provides a higher level of privacy protection, but may result in lower data availability. For example, for highly sensitive data such as personal medical records, a smaller total privacy budget, such as ϵ, might be chosen. total =1; however, for some relatively less sensitive statistical data, the total privacy budget can be appropriately relaxed.

[0290] 6.2.2 Assignment based on query type:

[0291] Frequent Queries: For frequently executed queries, such as those for basic statistical information (e.g., averages, counts), a relatively larger privacy budget can be allocated to ensure that these commonly used queries yield relatively accurate results. Because these queries may be executed multiple times, each consuming a portion of the privacy budget, it's crucial to ensure they have sufficient budget to maintain data availability.

[0292] Complex queries: Complex queries, such as multi-condition joint queries or queries involving machine learning model training, may require more computational resources and more granular privacy protection. A corresponding privacy budget can be allocated based on the complexity of the query and its impact on privacy. For example, a machine learning model training task that requires complex analysis of large amounts of data might allocate a larger proportion of the total privacy budget, such as 0.5%. total .

[0293] 6.2.3 Data subset allocation:

[0294] Sensitive subsets: If a dataset contains highly sensitive subsets, such as sensitive information about specific groups or critical business data, these subsets should be allocated more privacy budget. For example, in a dataset containing employee information, the salary information of senior managers might be a sensitive subset, requiring a larger privacy budget to protect their privacy.

[0295] Non-sensitive subset: For relatively insensitive subsets of data, the privacy budget can be allocated less. This can improve the usability and analytical value of non-sensitive data while ensuring overall privacy protection.

[0296] 6.2.4 Dynamic Allocation Strategy:

[0297] Dynamically adjust based on query frequency: As data processing progresses, monitor the actual execution frequency of different queries. If some queries are found to be executed more frequently than expected, the privacy budget can be dynamically increased for these queries to ensure the quality of their results. Conversely, if some queries are rarely executed, their unused privacy budget can be reallocated to other queries that need it more.

[0298] Dynamic adjustments based on data changes: If the sensitivity or importance of data changes—for example, if new sensitive data is added or the sensitivity of certain data decreases—the allocation of the privacy budget can be adjusted accordingly. For instance, when a company acquires another company and integrates its data, it needs to reassess the overall sensitivity of the data and reallocate the privacy budget.

[0299] 6.2.5 Allocation of multiple mechanisms in combination:

[0300] When using multiple differential privacy mechanisms to protect data, it's necessary to consider how to allocate the privacy budget among the different mechanisms. For example, a Laplace and exponential mechanism might be used simultaneously, each with its own privacy budget consumption. The privacy budget can be allocated rationally based on the characteristics of each mechanism and the application scenario to achieve optimal privacy protection. Generally, for operations requiring higher accuracy, more budget can be allocated to the relatively more precise mechanism.

[0301] 6.3 Noise generation and injection: Laplace noise is used to process the original data (the first initial privacy data after data preprocessing).

[0302] 6.3.1 Determine the privacy budget (i.e., the first privacy budget) and sensitivity (i.e., the first data sensitivity):

[0303] Privacy Budget: The privacy budget ϵ determines the level of privacy protection provided for the data. A smaller ϵ value indicates stronger privacy protection, but the data availability may be lower. The value of ϵ is generally determined based on the sensitivity of the data and the application scenario.

[0304] Sensitivity: Sensitivity Δf represents the maximum change in the query result when the data changes in a single record. The calculation method for sensitivity differs depending on the query type. For example, for a summation query, sensitivity is the maximum possible value for a single record in the dataset; for a count query, sensitivity is 1.

[0305] Scale parameter: The probability density function of the Laplace distribution is , where μ is the mean and b is the scaling parameter. When adding Laplace noise, the scaling parameter b is related to the privacy budget ϵ and the sensitivity Δf. The scaling parameter b of the Laplace distribution is calculated as b = Δf / ϵ.

[0306] 6.3.2 Generating Laplace noise:

[0307] Based on the calculated scale parameter b, a random number generator is used to generate noise conforming to a Laplace distribution (i.e., the first Laplace noise). In practical applications, Laplace noise can be generated using relevant functions in various programming languages ​​or data analysis libraries. For example, in Python, the `random.laplace` function from the numpy library can be used to generate Laplace noise.

[0308] 6.3.3 Add noise to the first initial privacy data:

[0309] The generated Laplace noise is added to the first initial privacy data. For numerical data, the noise value is simply added to the first initial privacy data. For example, for the first initial privacy data point xi, the result after adding noise is xi′=xi+ni, where ni is the generated Laplace noise. For non-numerical data, appropriate transformation and processing may be required depending on the specific situation. For example, categorical data may be converted to numerical data, noise may be added, and then converted back to categorical data.

[0310] By following the steps above, Laplace noise can be used to process the first initial privacy data, so that the processed data (i.e. the first privacy data) can retain the features and information of the original data as much as possible while satisfying differential privacy.

[0311] The method for obtaining the second privacy data is the same as the principle of obtaining the first privacy data. After the first data party and the second data party exchange keys, and the second data party obtains the shared key, the second client generates a dynamic mask based on the shared key; the second client obtains the second initial privacy data based on the dynamic mask and the second generalized data; the second client sets a second privacy budget based on the second data sensitivity of the second initial privacy data, and determines the second Laplace noise based on the second privacy budget; the second Laplace noise is added to the second initial privacy data to obtain the second privacy data.

[0312] Optionally, the method, wherein step D30 includes:

[0313] Each of the first clients hashes and encrypts each value in the first privacy data corresponding to each of the first data parties, adds it to the sum of the shared key and the first random integer, obtains the first intersection data, and sends it to the second client; wherein, the shared key is generated by exchanging public keys of key pairs generated by the first client and the second client respectively based on the elliptic curve algorithm for each of the first data parties;

[0314] The second client hashes and encrypts each value in the second privacy data, adds it to the shared key and the sum of the second random integer, obtains the second intersection data, and sends it to each of the first clients.

[0315] By counting the number of equal values ​​in the first intersection data and the second intersection data corresponding to each of the first data parties through each first client, multiple first intersection data are obtained; and by counting the number of equal values ​​in the first intersection data and the second intersection data through the second client, multiple second intersection data are obtained.

[0316] The minimum value among the multiple first intersection data and multiple second intersection data is taken as the intersection data.

[0317] In this embodiment, such as Figure 7 As shown, in step S4, anonymized privacy intersection is performed. The preparation phase is the same as in step S2: an elliptic curve is selected, a key pair is generated, and public keys are exchanged. In the implementation phase, P0 generates random numbers, P1 sends the encrypted point set to P0, P0 counts the number of equalities, and P1 calculates the temporary result to determine the intersection cardinality.

[0318] In step S2, the PSI-CA (intersection cardinality) algorithm based on ECDH (Elliptic Curve Diffie-Hellman) technology is used to calculate the intersection cardinality of two sets while protecting privacy and achieving anonymization.

[0319] In step S2, the encrypted dataset is obtained as follows: Party A holds data X={x1,x2,…,xn}, and Party B holds data Y={y1,y2,…,ym}. For simplicity, Party A is referred to as P0 and Party B as P1.

[0320] Implementation phase:

[0321] 7.1 Party P0 hashes each value xi (i=1,…,n) in X and maps it to a point H(xi) on an elliptic curve using a public encoding function H. Using Party P1's public key PB and its own private key XA, it computes the shared key KAB=XA*PB. For each encoded point H(xi), it computes CAi=H(xi)+rAi*KAB, where rAi is a randomly chosen integer. The encrypted point set {CA1,CA2,…,CAn} is sent to Party P1.

[0322] 7.2 P1 maps each element yi (i=1,…,m) in its set to a point H(yi) on an elliptic curve using the same encoding function H. Using P0's public key PA and its own private key XB, P1 calculates the shared key KBA=XB*PA. For each encoded point H(yi), P1 calculates CBi=H(yi)+rBi*KBA, where rBi is a random integer. P1 then sends the encrypted point set {CB1,CB2,…,CBm} to P0.

[0323] 7.3 After receiving the encrypted point set {CB1,CB2,…,CBm} sent by P1, P0 calculates DBi = CBi − XA * PB for each CBi. Then, it checks whether DBi is equal to a certain CAj sent by itself. The number of times they are equal, k (i.e., the first intersection data), is counted.

[0324] 7.4 After receiving the encrypted point set {CA1,CA2,…,CAn} sent by P0, P1 calculates DAj=CAj−XB*PA for each CAj. Then, it checks whether DAj is equal to a certain CBi sent by itself, and counts the number of times they are equal (i.e., the second intersection data).

[0325] 7.5 Since k and l should theoretically be equal, the final intersection cardinality (i.e., the intersection data) is min(k,l).

[0326] Using the above algorithm, P0 and P1 can calculate the cardinality of the intersection of two sets (i.e., the intersection data) without revealing the specific information of the elements in their respective sets, thus achieving anonymous and privacy-preserving intersection calculation.

[0327] Optionally, the method, wherein step D40 includes:

[0328] The first encrypted gradient obtained by training the initial model using the data corresponding to the intersection data in the first privacy data of each first data party in the corresponding first client is sent to the second client.

[0329] The first model obtained by training the initial model on the second client using the data corresponding to the intersection data in the second privacy data is updated sequentially using each of the first encryption gradients;

[0330] The process iteratively involves sending each of the first encryption gradients to the second client and updating the first model using each of the first encryption gradients, until a preset number of iterations is met, and the final model is obtained.

[0331] In this embodiment, such as Figure 8As shown, in step S5, encrypted calculation of federated learning gradients is performed. Through the encrypted collaborative calculation step, initialization, local gradient calculation, gradient encryption, decryption of aggregation results, and model updates are performed iteratively until the required number of iterations or other set termination conditions are reached, at which point the iteration ends, and the final model is obtained.

[0332] A and B jointly participate in a federated learning task to aggregate models without revealing the original gradient data. The model uses a simple linear regression model y=wx+b, with the loss function being the mean squared error. The encrypted collaborative computation steps are as follows:

[0333] 8.1 Initialization:

[0334] Initiator A generates a key pair (pk, sk), where pk is the public key and sk is the private key. A distributes the public key pk to receiver B. Receiver B randomly generates a random number, let's say r, for the cryptographic calculation.

[0335] The key pair (pk, sk) is generated based on the additive homomorphic encryption algorithm (Paillier encryption).

[0336] The key generation steps are as follows:

[0337] 8.1.1 Choose two large prime numbers:

[0338] Initiator A randomly selects two large prime numbers p and q such that gcd(pq,(p−1)(q−1))=1 (i.e., p and q are of the same length and are coprime). gcd (greatest common divisor) is the greatest common divisor.

[0339] 8.1.2 Calculate the modulus and parameters:

[0340] Calculate the modulus n = p × q.

[0341] Calculate λ = lcm(p−1, q−1) (the least common multiple of p−1 and q−1).

[0342] 8.1.3 Selecting generators:

[0343] Typically, g = n + 1 is chosen (to simplify calculations and satisfy the homomorphic property). Then, μ = (L(g)) is calculated. λ mod n 2 )) −1 mod n, where L(x) = (x−1) / n. mod returns the remainder when two numbers are divided.

[0344] 8.1.4 Determine the public and private keys:

[0345] Public key: pk=(n,g).

[0346] Private key: sk=(λ,μ).

[0347] 8.2 Local gradient calculation:

[0348] The initiator and receiver compute the gradients of the model on their local datasets. Assume the computed gradients are ∇w and ∇b.

[0349] 8.3 Encryption Gradient:

[0350] A uses the public key pk to encrypt the gradient, calculates E(∇w1) = Encp(∇w1 + r) and E(∇b1) = Encpk(∇b1 + r), and sends the encrypted gradients E(∇w1) and E(∇b1) to B. It should be noted that ∇w is the original gradient calculated on the local dataset, representing the gradient value in the current batch or iteration. That is, each of the first data providers, on the corresponding first client, trains the initial model using data from the first privacy data that corresponds to the intersection data, and sends the first encrypted gradient obtained to the second client.

[0351] ∇w1 and ∇b1 are specific instantiations of the original gradients ∇w and ∇b, used to identify that this is the gradient of participant 1.

[0352] In a single-participant scenario, where there is only one first data party among the at least one first data party, the actual value satisfies: ∇w=∇w1.

[0353] In a multi-participant scenario, where the at least one first data party includes multiple first data parties, the subscript is used to distinguish the gradients (e.g., ∇w1, ∇w2) of different participants (i.e., the first data parties).

[0354] 8.4 Decryption of Aggregation Results:

[0355] B uses the private key sk to decrypt the aggregated cryptographic gradient, obtaining ∇w1+r and ∇b1+r.

[0356] Since r is a random number, B and other participants do not know its specific value, so they cannot directly obtain the sum of the original gradients. However, during model updates, this random noise in r is canceled out and does not affect the model update.

[0357] Model updated in version 8.5:

[0358] B updates the model parameters w and b based on the decrypted aggregate gradients ∇w1+r and ∇b1+r. During the update process, random noise r is naturally eliminated; for example, the update formula can be w=w−α(∇w1+r), b=b−α(∇b1+r), where α is the learning rate. That is, the first model obtained by training the initial model on the second client using data corresponding to the intersection data in the second privacy data is updated sequentially using each of the first encrypted gradients.

[0359] Repeat steps 1 to 5 above until the model parameters are updated. Both parties jointly train a linear model using their respective data. The learning task is a classification task, and the training objective function is a log loss function. During this process, neither party leaks any plaintext data to any other participant. That is, the steps of sending each first encrypted gradient to the second client and updating the first model using each first encrypted gradient are iteratively performed until a preset number of iterations is met, and the final model is obtained.

[0360] In scenarios where A and B jointly explore and predict high-value users, the aforementioned federated learning algorithm is used for joint modeling, achieving both data privacy protection and collaborative modeling goals. Based on their respective accumulated user data, both parties use a linear regression model y=wx+b (where x represents user features, y is the user value prediction score, and w and b are parameters to be learned) as a foundation, optimizing the model through a mean squared error loss function. In this approach, A and B do not need to expose their original user data and gradient information, yet they can jointly train a model that accurately predicts high-value users, providing strong support for user-tiered operations and precise services while protecting data privacy.

[0361] like Figure 9 As shown, in step S6, gradient encryption calculation iteratively performs local gradient calculation, encrypted gradient and secure transmission, aggregation server calculation, joint decryption, and gradient descent parameter update. Service provider A and service provider B participate in federated learning through the aggregation server.

[0362] Based on the model established in step S5, the first client C1 and the second client C2 use the batch gradient descent algorithm to train the model locally, and then aggregate the calculations on the server to collaboratively complete the calculation objective.

[0363] 9.1 Gradient Calculation:

[0364] In this scenario, each client uses its own local dataset and employs a linear regression model y=wx+b, with the loss function being the mean squared error. Where n is the amount of data, y i It's a real label, ŷ iThis is a predicted value.

[0365] Calculate the gradient using the following formula:

[0366] ;

[0367] ;

[0368] After calculating the gradients of all bins, the first client C1 summarizes them to obtain the local gradient ∇w. C1 and ∇b C1 Similarly, the second client C2 calculates its local gradient ∇w. C2 、∇b C2 .

[0369] 9.2 Encryption and Transmission:

[0370] The client obtains the public key from the server and uses it to homomorphically encrypt the local gradient. The encrypted gradient can be directly used by the server for aggregation without decryption, thus avoiding the server or intermediate nodes from obtaining the original gradient.

[0371] The encrypted gradient uses Transport Layer Security (TLS) / Secure Sockets Layer (SSL) to encrypt the transmission channel, ensuring that the gradient is transmitted in ciphertext form in the network and resisting man-in-the-middle attacks and eavesdropping.

[0372] Each client and server verifies the other's identity using digital certificates to prevent malicious nodes from infiltrating and ensure that gradients are only sent to legitimate servers.

[0373] Each client calculates the SHA-256 hash value for the encrypted gradient and transmits the hash value along with the encrypted gradient. The server receives the transmitted gradient and verifies it against the hash to confirm that it has not been tampered with. This technique ensures effective aggregation of the encrypted gradient by the server, preventing gradient privacy leaks.

[0374] 9.3 Gradient Aggregation:

[0375] The client sends the calculated gradients to the aggregation server S. After receiving the gradients from C1 and C2, S performs the aggregation operation. For the gradient of w, it calculates ∇wsum = 1 / 2 (∇w C1 +∇w C2 For the gradient of b, calculate ∇bsum = 1 / 2(∇b). C1 +∇b C2 ).

[0376] 9.4 Gradient Update:

[0377] The server S updates the model parameters based on the aggregated gradients ∇wsum and ∇bsum. Assuming the learning rate is α, the update formulas are w = w − α∇wsum and b = b − α∇bsum. The server S then sends the updated model parameters to each client.

[0378] Parameters updated in version 9.5:

[0379] Each client uses the new model parameters for the next round of training.

[0380] By using batch encrypted computation, each client calculates gradients based on its local full dataset (rather than random sampling), ensuring the accuracy of local model training. The encrypted gradients are uploaded to the server for aggregation, and then the global model is updated. Compared to algorithms such as stochastic gradient descent, this approach offers advantages such as more accurate gradients, reduced communication rounds between clients and the server, and increased server-side computational load, thus improving the efficiency of gradient computation. Furthermore, because the gradient of the loss function is calculated based on all training data, and model parameters are iteratively updated to minimize prediction errors, the model training process based on batch gradient descent in federated learning is optimized.

[0381] In this scenario, through batch gradient descent, an accurate model for predicting high-value potential customers is ultimately formed for B without leaking the original data, achieving the business objective. In this stage, each client independently calculates gradients based on its complete local user data. By aggregating and optimizing the loss information of all local samples, the gradient updates in each iteration are ensured to be more stable and the convergence direction more reliable. Simultaneously, under the federated learning framework, gradients are transmitted between servers only in encrypted form, avoiding the privacy risks of leaking original user data while allowing both parties to collaboratively optimize model parameters based on globally aggregated gradients. This ultimately achieves accurate predictions of high-value users, balancing model performance and data security.

[0382] The present invention provides anonymization and privacy protection techniques during data value exploration, and proposes the following key technical points in data sharing scenarios:

[0383] This study focuses on protecting the privacy of raw data based on a sample generalization algorithm. It primarily includes preliminary generalization calculation and joint deep generalization. Preliminary generalization calculation aims to provide basic privacy protection for the raw data through systematic data processing. It optimizes and adjusts the binning intervals of each feature by merging some intervals or proportionally enlarging them, gradually reducing the detail and uniqueness of the data. This adjustment continues until the joint features of the data parties meet a predetermined K-value for anonymity, effectively reducing the risk of data tracking and identification. Joint deep generalization, based on the joint calculation of IV (information value), quantifies the influence of each feature on the target variable, obtaining the influence coefficient of each feature. Based on these coefficients, the original binning intervals of each feature are dynamically adjusted. This enhances data generalization while ensuring data availability, further protecting the privacy of the raw data.

[0384] b. Dynamic anonymization is implemented through multi-layered cryptographic protection, effectively preventing ID association attacks and data leakage risks while ensuring data availability. Participants generate a shared key using the ECDH protocol, leveraging the elliptic curve discrete logarithm problem to guarantee key security. The shared key serves as the root key for dynamic masking and HMAC calculation, ensuring its dynamism throughout its lifecycle. A dynamic mask is derived using the shared key, changing over time or session. This dynamic mask is then concatenated with the original ID before HMAC calculation. A fixed-length hash value is generated as the anonymized ID, ensuring that the same ID generates different hash values ​​at different times. Dynamic anonymization technology achieves non-linkability; the same ID generates different anon_IDs at different times, preventing cross-time tracking and effectively achieving collision resistance and key isolation. This enhances the privacy protection capabilities of data interaction.

[0385] c. Differential privacy processing of sample data protects data privacy through a series of rigorous steps. Preprocessing operations such as cleaning, transformation, and normalization are performed on the sample data, and Laplace noise is added to the data to a certain extent, perturbing and hiding the original data, preventing sensitive information from being directly obtained or inferred, and ensuring data privacy and security. A privacy budget is allocated reasonably, dynamically adjusted according to different query types, data subsets, and the characteristics of the differential privacy mechanism. While meeting privacy protection requirements, the budget retains as many data features and information as possible, ensuring that the processed data can still be used for various data analyses and applications, such as model training and statistical queries, avoiding the loss of data value due to excessive privacy protection.

[0386] The anonymized privacy-preserving intersection algorithm, while protecting data privacy, enables the calculation of the intersection of datasets among multiple participants. By employing techniques such as ECDH and the PSI-CA algorithm, the data is transformed to protect the original data during the computation process, preventing data leakage and tracking, and ensuring the data privacy and security of all participants. This meets the stringent privacy protection requirements in various scenarios. Furthermore, it enables all parties to accurately calculate the intersection of datasets without directly exposing the original data, while ensuring the accuracy and reliability of the calculation results. This provides a safe and feasible method for cross-institutional and cross-domain data collaboration, promoting data flow and sharing without the risk of privacy breaches.

[0387] Federated learning employs gradient encryption to achieve secure multi-party computation. Each participant's original data remains local, and learning occurs through the exchange of model gradients. Encrypting gradient computation prevents gradient information from being stolen or leaked, avoiding attackers' attempts to infer participants' original data through gradient analysis, thus protecting the data privacy of all participants. Encrypted gradients are difficult to tamper with or maliciously attack during transmission and computation, ensuring the accuracy and integrity of model updates, improving the security and reliability of federated learning models, and preventing performance degradation or erroneous results due to malicious attacks. Encrypted gradient computation reduces participants' concerns about data privacy breaches, allowing different institutions or organizations to participate in federated learning with greater confidence, promoting data sharing and collaboration, and facilitating the full utilization of data resources from all parties, thereby improving the model's generalization ability and performance.

[0388] f employs batch gradient descent as the federated learning optimization algorithm. Batch gradient descent uses the entire training dataset to calculate the gradient for each parameter update. This allows the algorithm to utilize information from all the data, updating parameters along the direction of fastest descent of the loss function. In most cases, this leads to rapid convergence to the global optimum or a region close to it, reducing training time and iterations. Because it uses gradient information from the entire dataset, the parameter update direction of batch gradient descent is relatively stable, without significant fluctuations due to noise or anomalies in individual data points. This helps the model learn more accurate parameters, improving model stability and generalization ability. Batch gradient descent can improve computational efficiency through parallel computing or distributed training, enabling it to effectively handle large-scale datasets and thus perform well in big data scenarios.

[0389] The embodiments of the present invention have the following advantages:

[0390] 1. Similar techniques to sample generalization algorithms include data augmentation. Data augmentation involves performing a series of transformations on the original data, such as rotation, flipping, scaling, and adding noise, to increase the diversity of the data and thus improve the model's generalization ability. Sample generalization algorithms typically focus more on mining the intrinsic features and patterns of the data. By analyzing and transforming the data, the model can better learn the essential characteristics of the data, thereby exhibiting better generalization ability in different datasets or scenarios. In contrast, data augmentation mainly increases the amount and diversity of data through external transformations, with relatively less focus on mining the intrinsic features of the data.

[0391] 2. Data encryption sharing primarily protects data through encryption technology, ensuring confidentiality during transmission and storage. However, it offers relatively weak privacy protection during data use and processing. Once data is legally decrypted, privacy risks increase. Anonymized privacy intersection algorithms are specifically designed for set intersection scenarios. By anonymizing the data, they can accurately calculate the intersection without revealing the specific elements within the set. They place greater emphasis on protecting privacy during data computation and processing, offering stronger targeting and better privacy protection for the specific operation of intersection.

[0392] 3. Currently, in multi-party computation, data is typically shared in plaintext or only undergoes simple anonymization. During multi-party computation, data is easily leaked, resulting in weak privacy protection. Federated learning gradient encrypted computation: This method uses encryption technology to protect gradients, making it difficult for attackers to obtain the true gradient information even if data is intercepted during multi-party interactions, effectively protecting the privacy of data owners.

[0393] like Figure 10 As shown, to achieve the above objectives, embodiments of the present invention provide a model aggregation device, wherein the aggregation is performed by a data sharing platform, the data sharing platform including multiple clients, including:

[0394] A first generation module 1001 is configured to perform joint generalization processing on at least one generalized first local data from at least one first data party and generalized second local data from a second data party, generating at least one first generalized data corresponding to the at least one first local data and sending it to a first client corresponding to each of the first data parties, and generating second generalized data corresponding to the second local data and sending it to a second client corresponding to the second data party; wherein the first local data includes data collected by the first data party from multiple first users; the second local data includes data collected by the second data party from multiple second users; and the multiple clients include the first client and the second client;

[0395] The first acquisition module 1002 is used to acquire first privacy data by performing privacy protection measures on the first generalized data through the first client, and to acquire second privacy data by performing privacy protection measures on the second generalized data through the second client;

[0396] The second acquisition module 1003 is used to acquire intersection data based on the first privacy data and the second privacy data; wherein, the intersection data includes the intersection cardinality of the first user and the second user, and the encrypted identifier of the intersection user in the first privacy data and the second privacy data corresponding to the intersection cardinality;

[0397] The third acquisition module 1004 is used to initiate federated learning based on the intersection data, and to obtain the final model by updating the initial model established under the federated learning framework through the second client based on the first encrypted gradient calculated by the first data party on the first client.

[0398] Optionally, the device further includes:

[0399] The fourth acquisition module is used to perform binning processing on the corresponding first local data through the first client corresponding to each first data party, and to acquire the first bin data corresponding to each first data party.

[0400] The fifth acquisition module is used to perform generalization processing on the corresponding first bin data through the first client corresponding to each first data party, so that the number of data points in each bin of each first feature in each first bin data satisfies the first preset anonymity value, and to acquire at least one generalized first local data.

[0401] Optionally, in the aforementioned apparatus, the first generation module 1001 includes:

[0402] The first acquisition unit is configured to acquire first joint data based on the joint sample generalization of at least one first local data and the second local data that has been generalized;

[0403] The second acquisition unit is configured to acquire, based on the first joint data, the first information value of each of the plurality of fourth features relative to the target variable; wherein, the plurality of fourth features are features of the third features other than the target feature where the target variable is located, and the third features include a first feature in at least one of the generalized first local data and a second feature in the generalized second local data; the target variable is a bin of the target feature among the plurality of pre-specified third features;

[0404] The third acquisition unit is used to scale the binning interval of the fourth feature of the first joint data according to the first information value, and acquire the second joint data based on the target criterion, wherein the target criterion is that the area under the curve and / or the Kolmogorov-Smirnov value of the first joint data are optimal when the number of data points in each binning interval meets the first preset anonymity value.

[0405] The first sending unit is configured to generate at least one first generalized data based on the second joint data and each of the first features, and send it to the corresponding first client; and to generate the second generalized data based on the second joint data and the second features, and send it to the second client.

[0406] Optionally, in the apparatus, the second acquiring unit includes:

[0407] A first processing component is configured to calculate the number of first samples and the amount of second sample data in each bin of the fourth feature based on the target variable; wherein the number of first samples is the number of data points that conform to the target variable; and the number of second samples is the number of data points that do not conform to the target variable.

[0408] The second processing component is used to obtain the information value contribution value by multiplying the difference between the first value and the second value in each bin of each of the fourth features by the natural logarithm of the ratio of the first value and the second value; wherein the first value is the proportion of the first sample quantity in the total data points of the corresponding bin, and the second value is the proportion of the second sample quantity in the total data points of the corresponding bin.

[0409] The first acquisition component is used to sum the information value contribution values ​​in each of the fourth features to obtain the corresponding first information value.

[0410] Optionally, in the aforementioned apparatus, the third acquisition unit comprises:

[0411] The second acquisition component is used to perform binning processing on the fourth feature whose first information value is higher than the information value threshold, and to perform generalization processing on the fourth feature whose first information value is lower than the information value threshold, in order to acquire third joint data.

[0412] The third acquisition component is used to take the binning interval of each of the fourth features in the third joint data as a variable and obtain the scaling factor based on the target criterion.

[0413] The fourth acquisition component is used to adjust the binning interval of each of the fourth features in the third joint data according to the scaling factor, and acquire the second joint data.

[0414] Optionally, in the aforementioned apparatus, the first acquisition module 1002 includes:

[0415] The first generation unit is configured to generate a dynamic mask based on the shared key through the first client after the first data party and the second data party exchange keys and the first data party obtains the shared key.

[0416] The fourth acquisition unit is used to acquire first initial privacy data through the first client based on the dynamic mask and the first generalized data;

[0417] The first determining unit is configured to set a first privacy budget by the first client based on the first data sensitivity of the first initial privacy data, and determine a first Laplace noise based on the first privacy budget.

[0418] The fifth acquisition unit is used to add the first Laplace noise to the first initial privacy data to acquire the first privacy data.

[0419] Optionally, in the aforementioned apparatus, the second acquisition module 1003 includes:

[0420] The sixth acquisition unit is configured to hash and encrypt each value in the first privacy data corresponding to each of the first data parties through each of the first clients, and add it to the sum of the shared key and the first random integer to obtain the first intersection data and send it to the second client; wherein, the shared key is generated by exchanging public keys of key pairs generated by the first clients and the second clients corresponding to each of the first data parties based on the elliptic curve algorithm;

[0421] The seventh acquisition unit is used to hash and encrypt each value in the second privacy data through the second client and add it to the shared key and the second random integer to obtain the second intersection data and send it to each of the first clients;

[0422] The eighth acquisition unit is configured to acquire multiple first intersection data by counting the number of equal values ​​in the first intersection data and the second intersection data corresponding to each first data party through each first client, and to acquire multiple second intersection data by counting the number of equal values ​​in each first intersection data and the second intersection data through the second client;

[0423] The first processing unit is configured to take the minimum value among the plurality of first intersection data and the plurality of second intersection data as the intersection data.

[0424] Optionally, in the aforementioned apparatus, the third acquisition module 1004 includes:

[0425] The ninth acquisition unit is used to send the first encrypted gradient obtained by each first data party in training the initial model using the data corresponding to the intersection data in the first privacy data to the second client.

[0426] The second processing unit is used to update the first model obtained by the second data party training the initial model on the second client using the data corresponding to the intersection data in the second privacy data with the data of the second privacy data in the second client, using each of the first encryption gradients in turn.

[0427] The tenth acquisition unit is used to iteratively perform the steps of sending each of the first encryption gradients to the second client and updating the first model using each of the first encryption gradients, until a preset number of iterations is met, and to acquire the final model.

[0428] It should be noted that the apparatus provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.

[0429] To achieve the above objectives, embodiments of the present invention provide a model aggregation device, comprising: a processor, a memory, and a program or instructions stored in the memory and executable on the processor; wherein, when the processor executes the program or instructions, it implements the model aggregation method as described above.

[0430] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the steps in the aggregation method of the model as described above.

[0431] To achieve the above objectives, embodiments of the present invention provide a computer program product, comprising computer instructions that, when executed by a processor, implement the steps of the aggregation method of the model as described above.

[0432] It should be further noted that the terminals described in this specification include, but are not limited to, smartphones, tablets, etc., and many of the functional components described are referred to as modules in order to emphasize the independence of their implementation.

[0433] In this embodiment of the invention, the module can be implemented in software so that it can be executed by various types of processors. For example, an identified executable code module may include one or more physical or logical blocks of computer instructions, which may be constructed as objects, procedures, or functions. Nevertheless, the executable code of the identified module does not need to be physically located together, but may include different instructions stored in different bits, which, when logically combined, constitute the module and achieve the module's intended purpose.

[0434] In practice, an executable code module can be a single instruction or many instructions, and can even be distributed across multiple different code segments, different programs, and across multiple memory devices. Similarly, operational data can be identified within the module and can be implemented in any suitable form and organized within any suitable data structure. This operational data can be collected as a single dataset or distributed across different locations (including different storage devices), and can exist, at least in part, solely as electronic signals within the system or network.

[0435] When a module can be implemented using software, considering the current level of hardware technology, modules that can be implemented in software can be implemented using hardware circuits by those skilled in the art to achieve the corresponding functions, without considering cost. These hardware circuits include conventional very-large-scale integrated circuits (VLSI) or gate arrays, as well as existing semiconductors such as logic chips and transistors, or other discrete components. Modules can also be implemented using programmable hardware devices, such as field-programmable gate arrays, programmable array logic, and programmable logic devices.

[0436] The exemplary embodiments described above are with reference to the accompanying drawings. Many different forms and embodiments are feasible without departing from the spirit and teachings of the invention. Therefore, the invention should not be construed as limiting the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention complete and convey the scope of the invention to those skilled in the art. In these drawings, component dimensions and relative dimensions may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. As used herein, unless clearly indicated otherwise, the singular forms “a,” “an,” and “the” are intended to include all such forms. It will be further understood that the terms “comprising” and / or “including”, when used in this specification, indicate the presence of the stated features, integers, steps, operations, components, and / or elements, but do not exclude the presence or addition of one or more other features, integers, steps, operations, components, and / or groups thereof. Unless otherwise indicated, when stated, a range of values ​​includes the upper and lower limits of the range and any subranges in between.

[0437] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method of aggregating models, the method comprising: executed by a data sharing platform, the data sharing platform comprising a plurality of clients, including: jointly generalizing at least one first local data of at least one first data party and second local data of a second data party, generating at least one first generalization data corresponding to the at least one first local data and sending the at least one first generalization data to a first client corresponding to each of the first data parties, and generating second generalization data corresponding to the second local data and sending the second generalization data to a second client corresponding to the second data party; wherein the first local data comprises data of a plurality of first users collected by the first data party; the second local data comprises data of a plurality of second users collected by the second data party; and the plurality of clients comprises the first client and the second client; performing privacy protection measures on the first generalization data through the first client to obtain first privacy data, and performing privacy protection measures on the second generalization data through the second client to obtain second privacy data; obtaining intersection data according to the first privacy data and the second privacy data; wherein the intersection data comprises an intersection cardinality of the first users and the second users, and encrypted identifiers of intersection users in the first privacy data and the second privacy data corresponding to the intersection cardinality; starting federated learning according to the intersection data, and obtaining a final model by updating an initial model established under a federated learning framework according to a first encrypted gradient calculated by the first data party at the first client.

2. The method of claim 1, wherein, Before the jointly generalizing at least one first local data of at least one first data party and second local data of a second data party, the method further comprises: performing binning processing on the corresponding first local data through the first client corresponding to each of the first data parties to obtain first binning data corresponding to each of the first data parties; performing generalization processing on the corresponding first binning data through the first client corresponding to each of the first data parties, so that the number of data points in each bin of each first feature in each of the first binning data satisfies a first preset anonymity value, to obtain the at least one first generalization data.

3. The method of claim 1, wherein, The jointly generalizing at least one first local data of at least one first data party and second local data of a second data party, generating at least one first generalization data corresponding to the at least one first local data and sending the at least one first generalization data to a first client corresponding to each of the first data parties, and generating second generalization data corresponding to the second local data and sending the second generalization data to a second client corresponding to the second data party, comprises: jointly sample generalizing the at least one first generalization data and the second generalization data to obtain first joint data; According to the first joint data, obtain a first information value of each feature in a plurality of fourth features with respect to a target variable; wherein the plurality of fourth features are features other than a target feature in which the target variable is located in third features, the third features including first features in the at least one first generalized local data and second features in the second generalized local data; the target variable is a bin of the target feature in the plurality of third features; According to the first information value, the bin interval of the fourth feature of the first joint data is scaled, and second joint data is obtained based on a target criterion, the target criterion being that the area under the curve and / or the Kolmogorov-Smirnov value of the first joint data is best when the number of data points in each bin interval meets a first preset anonymity value; According to the second joint data and each first feature, the at least one first generalized data is generated and sent to the corresponding first client, and according to the second joint data and the second feature, the second generalized data is generated and sent to the second client.

4. The method of claim 3, wherein, According to the first joint data, obtain a first information value of each feature in a plurality of fourth features with respect to a target variable; wherein the plurality of fourth features are features other than a target feature in which the target variable is located in third features, the third features including first features in the at least one first generalized local data and second features in the second generalized local data; the target variable is a bin of the target feature in the plurality of third features; According to the target variable, the first sample quantity and the second sample data quantity in each bin of each fourth feature are calculated; wherein the first sample quantity is the number of data points meeting the target variable; and the second sample quantity is the number of data points not meeting the target variable; The information value contribution value obtained by multiplying the difference between the first value and the second value in each bin of each fourth feature by the natural logarithm of the ratio of the first value and the second value; wherein the first value is the proportion of the first sample quantity in the total data points in the corresponding bin, and the second value is the proportion of the second sample quantity in the total data points in the corresponding bin; Sum the information value contribution values in each fourth feature to obtain the corresponding first information value.

5. The method of claim 3, wherein, According to the first information value, the bin interval of the fourth feature of the first joint data is scaled, and second joint data is obtained based on a target criterion, the target criterion being that the area under the curve and / or the Kolmogorov-Smirnov value of the first joint data is best when the number of data points in each bin interval meets a first preset anonymity value; According to a preset information value threshold, the fourth features with the first information value higher than the information value threshold are subjected to binning processing, and the fourth features with the first information value lower than the information value threshold are subjected to generalization processing to obtain third joint data; Taking the bin interval of each fourth feature in the third joint data as a variable, a scaling coefficient is obtained based on the target criterion; According to the scaling coefficient, the bin interval of each fourth feature in the third joint data is adjusted to obtain the second joint data.

6. The method of claim 1, wherein, Through the first client, the first generalized data is subjected to privacy protection measures to obtain first privacy data, including: In the case that the first data party obtains a shared key after key exchange with the second data party, a dynamic mask is generated by the first client according to the shared key; acquiring, by the first client, first initial privacy data according to the dynamic mask and the first generalized data; setting, by the first client, a first privacy budget according to a first data sensitivity of the first initial privacy data, and determining a first Laplace noise according to the first privacy budget; adding the first Laplace noise to the first initial privacy data to acquire the first privacy data.

7. The method of claim 1, wherein, According to the first privacy data and the second privacy data, the intersection data is acquired, including: Each of the first client encrypts each value in the first privacy data corresponding to each of the first data party by hash encryption and adds the sum of the shared key and the first random integer to acquire the first intersection data and send it to the second client; wherein the shared key is generated by exchanging public keys of the key pair generated by each of the first client and the second client based on elliptic curve algorithm respectively; Each of the second client encrypts each value in the second privacy data by hash encryption and adds the sum of the shared key and the second random integer to acquire the second intersection data and send it to each of the first client; Each of the first client statistics the number of equal values in the first intersection data and the second intersection data corresponding to each of the first data party to acquire a plurality of first intersection data, and the second client statistics the number of equal values in each of the first intersection data and the second intersection data to acquire a plurality of second intersection data; The minimum value of the plurality of first intersection data and the plurality of second intersection data is taken as the intersection data.

8. The method of claim 1, wherein, According to the intersection data, the federated learning is started, and the final model is acquired by the second client according to the first encrypted gradient calculated by the first data party at the first client, under the condition that the initial model established under the federated learning framework is updated, including: Each of the first data party sends the first encrypted gradient acquired by training the initial model with the data corresponding to the intersection data in the first privacy data at the corresponding first client to the second client; Each of the first encrypted gradient is used to update the first model acquired by training the initial model with the data corresponding to the intersection data in the second privacy data at the second client in turn; Iterate the steps of sending each of the first encrypted gradient to the second client and updating the first model with each of the first encrypted gradient until the preset iteration number is met to acquire the final model.

9. An apparatus for aggregating models, the apparatus comprising: executed by a data sharing platform, the data sharing platform comprising a plurality of clients, including: The first generation module is configured to perform joint generalization processing on the generalized at least one first local data of at least one first data party and the generalized second local data of a second data party, generate at least one first generalization data corresponding to the at least one first local data and send the at least one first generalization data to a first client corresponding to each first data party, and generate second generalization data corresponding to the second local data and send the second generalization data to a second client corresponding to the second data party; wherein the first local data includes data of a plurality of first users collected by the first data party; the second local data includes data of a plurality of second users collected by the second data party; and the plurality of clients includes the first client and the second client. The first acquisition module is configured to perform privacy protection measures on the first generalization data through the first client to acquire first privacy data, and perform privacy protection measures on the second generalization data through the second client to acquire second privacy data. The second acquisition module is configured to acquire intersection data according to the first privacy data and the second privacy data; wherein the intersection data includes an intersection cardinality of the first users and the second users, and encrypted identities of intersection users in the first privacy data and the second privacy data corresponding to the intersection cardinality. The third acquisition module is configured to start federated learning according to the intersection data, and acquire a final model in a case that an initial model established under a federated learning framework is updated by a second client according to a first encrypted gradient calculated by the first data party at the first client.

10. A model's aggregation device, comprising: A processor, a memory, and a program or instructions stored on the memory and executable on the processor; characterized by the processor implementing the model aggregation method of any one of claims 1-8 when executing the program or instructions.

11. A readable storage medium, on which a program or instructions are stored, characterized in that, The program or instructions are executed by the processor to implement the steps in the model aggregation method of any one of claims 1-8.

12. A computer program product, characterised in that, The program or instructions are executed by the processor to implement the steps in the model aggregation method of any one of claims 1-8. The program or instructions are executed by the processor to implement the steps in the model aggregation method of any one of claims 1-8.