A cross-platform heterogeneous data sharing analysis method based on federated learning
By constructing a heterogeneous feature extraction network on the client side and introducing a homomorphic encryption algorithm, the problems of feature heterogeneity and privacy leakage of cross-platform heterogeneous data are solved, enabling secure joint training and efficient collaboration of cross-platform data, and improving the model's generalization ability and system robustness.
Patent Information
- Application Number
- CN202611212354.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-11-10
AI Technical Summary
Existing federated learning systems face bottlenecks in feature space heterogeneity, privacy leakage risks, and communication and system heterogeneity when dealing with cross-platform heterogeneous data. This results in limited generalization ability of cross-platform models, insufficient privacy security, and low training efficiency.
By constructing a heterogeneous feature extraction network locally on the client side, data is mapped to a unified latent space, data is encrypted using a homomorphic encryption algorithm, and a global prototype contrastive loss and a dynamic sparse gradient upload mechanism are introduced to achieve joint training and secure aggregation of heterogeneous data across platforms.
It achieves semantic alignment of heterogeneous data across platforms, ensures data privacy and security, and significantly improves training efficiency and system robustness, overcoming heterogeneity and communication bottlenecks.
Smart Images

Figure CN123068375A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of data sharing analysis, and in particular to a cross-platform heterogeneous data sharing analysis method based on federated learning. Background Technology
[0002] With the continuous improvement of global data security and privacy protection regulations, the phenomenon of data silos across departments and platforms is becoming increasingly prominent. Federated learning, as a distributed machine learning paradigm, allows participating parties to collaboratively train models without sharing their local raw data, becoming an effective means of breaking down data silos. However, existing federated learning systems have the following significant technical limitations when dealing with heterogeneous cross-platform data: First, there is the issue of feature space heterogeneity. Data collected from different platforms (such as healthcare systems, social networks, and e-commerce platforms) varies significantly in feature dimensions, data types, and semantic information. Traditional federated learning algorithms (such as FedAvg) typically require all participants to have feature spaces of the same dimension, or are only applicable to fixed scenarios such as horizontal (sample alignment) and vertical (feature alignment). When faced with asymmetric heterogeneous data (such as a mixture of structured tables, images, and text), existing frameworks cannot directly perform joint representation learning, resulting in severely limited generalization capabilities of cross-platform models.
[0003] Second, there is the risk of privacy breaches arising from the interaction of intermediate representations. To mitigate the problem of feature heterogeneity, some existing solutions employ representation exchange or feature alignment techniques to transmit activation values or feature vectors of intermediate layers between the client and server. However, these intermediate representations often still contain a large amount of sensitive information, making them highly vulnerable to gradient inversion attacks or attribute inference attacks during transmission and aggregation. Without strong security safeguards in the ciphertext domain, attackers can analyze these intermediate representations to infer the distribution of the original local data, violating the privacy protection principle of federated learning.
[0004] Third, communication and system heterogeneity bottlenecks. In cross-platform collaboration scenarios, the network bandwidth and computing power of each participant vary greatly. Traditional federated learning requires the client to upload complete model gradients or parameters in each iteration. For deep network models with large dimensions, this intensive communication leads to extremely high bandwidth consumption. Platforms with high network latency or weak computing power will slow down the overall training progress, creating a "weakest link" effect, which severely restricts the efficiency and robustness of cross-platform federated training. Summary of the Invention
[0005] The purpose of this invention is to provide a cross-platform heterogeneous data sharing and analysis method based on federated learning to solve the above-mentioned problems.
[0006] To achieve the above objectives, this invention provides a cross-platform heterogeneous data sharing and analysis method based on federated learning, comprising the following steps: S1. Each client participating in the data sharing analysis builds a heterogeneous feature extraction network locally to map local heterogeneous data of different dimensions to a latent space of a unified dimension and obtain local latent representations. S2. Each client calculates the local prototype vector for each category based on the local implicit representation, and encrypts the local prototype vector using a homomorphic encryption algorithm to generate a ciphertext prototype. S3. The federation server receives the ciphertext prototype, performs weighted aggregation on the ciphertext prototype under the ciphertext domain, generates a global ciphertext prototype, and distributes it to each client. S4. Each client receives and decrypts the global ciphertext prototype, constructs a joint loss function using the contrast loss and cross-entropy loss based on the global plaintext prototype, and updates the local network parameters through backpropagation. S5. Each client monitors the local network and computing resource status in real time, performs Top-K sparsification on the locally updated gradient based on the dynamically calculated sparsification rate, and asynchronously uploads the sparsified gradient triplet to the server for aggregation.
[0007] Preferably, in step S1, the client The local data feature dimension is The unified latent space dimension is ,and Heterogeneous feature extraction networks include one of the following: multilayer perceptron, convolutional neural network, or Transformer network, where the output layer dimension is forcibly set to a certain value. .
[0008] Preferably, in step S2, the formula for calculating the local prototype vector is: ; in, For the client Medium category The local prototype, For the client Belongs to the category The sample set, For the sample The local hidden representation.
[0009] Preferably, in step S3, the formula for weighted aggregation of the ciphertext prototype under the ciphertext field is: ; in, For all clients regarding categories The global plaintext prototype, For encrypted global category prototype, The total number of clients participating in federated learning.
[0010] Preferably, the homomorphic encryption algorithm is the Paillier encryption algorithm. Each client generates a Paillier public-private key pair locally and uses the public key pair to set up a local prototype vector. and the number of local samples Encrypt; Since the Paillier algorithm does not support direct division between ciphertexts, step S3, which generates a global ciphertext prototype and distributes it to each client, specifically includes: The federated server calculates the ciphertext molecule under the ciphertext domain. And count the plaintext denominator ; The server sends the ciphertext numerator and plaintext denominator to each client. After receiving the data, each client decrypts the ciphertext using its local private key to obtain the plaintext, and then performs a division operation in its local plaintext field to obtain the global plaintext prototype. .
[0011] Preferably, in step S4, the joint loss function is as follows: ; in, For cross-entropy loss, To balance hyperparameters, For prototype comparison loss; Prototype contrast loss The calculation formula is: ; in, Represents cosine similarity. For temperature coefficient, For the sample The global prototype corresponding to the real label.
[0012] Preferably, in step S5, the formula for dynamically calculating the sparsity rate is as follows: ; in, To preset the maximum sparsity, For the client Real-time bandwidth, For the client CPU utilization and As a preset reference standard, and These are preset weighting coefficients.
[0013] Preferably, in step S5, the specific method for Top-K sparsification and gradient triplet construction is as follows: Client Based on the calculated sparsity rate Determine the number of gradient elements to be retained. ,in Update gradient tensors locally The total number of elements; gradient tensor Sort all elements in descending order by absolute value, and extract the elements with the largest absolute value. Gradient elements; Extracted The values of each gradient element are used as Its original gradient tensor The position number in the middle is used as And append the current client's unique identifier as Combine to generate gradient triples ; The client asynchronously uploads the set of gradient triples to the server, and the server receives and then... Will The data is accumulated to the corresponding position in the global model parameters to complete the asynchronous aggregation.
[0014] Preferably, in step S5, the aggregation step performed by the server specifically includes asynchronous weighted aggregation: The server maintains a global model parameter cache. When it receives a gradient triplet asynchronously uploaded by a client, it does not need to wait for other clients that have not yet uploaded; it directly calculates the time decay weight of that client based on the received timestamp. ; in, The preset attenuation factor and , This represents the server's current receiving time. This refers to the time when the client completed its previous upload. The server will receive the gradient triplet. Multiply by time decay weight Afterwards, according to The data is accumulated to the corresponding position of the global model parameters to complete the asynchronous aggregation update.
[0015] Therefore, the present invention employs the above-described cross-platform heterogeneous data sharing and analysis method based on federated learning, which has the following advantages: (1) In this invention, heterogeneous feature extraction networks (such as multilayer perceptrons, convolutional neural networks, or Transformers) are constructed locally on each client to uniformly map local heterogeneous data of different dimensions and modalities to a latent space of the same dimension, and a contrastive loss based on a global prototype is introduced for joint training. This design breaks the strict restriction of traditional federated learning that the feature dimensions of the participating data must be consistent, and realizes the semantic alignment and joint representation learning of truly cross-platform asymmetric heterogeneous data (such as structured tables, images, and text), which greatly improves the generalization ability of cross-domain collaborative models.
[0016] (2) In this invention, each client calculates the category prototype based on the local implicit representation, and uploads the local prototype vector and sample quantity after encrypting them using a homomorphic encryption algorithm. The federated server completes the weighted aggregation and distributes the global encrypted prototype entirely in the encrypted domain. This mechanism ensures that the server can only obtain the aggregated encrypted result, and that the clients do not directly interact with any intermediate feature representations or original data, fundamentally eliminating gradient inversion attacks and attribute inference attacks. While achieving cross-platform feature alignment, it strictly protects the "usable but not visible" nature and privacy of local data.
[0017] (3) In this invention, each client monitors its local network bandwidth and computing resource status in real time, performs Top-K sparsification on the locally updated gradient based on the dynamically calculated sparsity rate, and asynchronously uploads only the gradient triplet containing the key gradient value, position index, and client identifier to the server. This mechanism not only adaptively compresses the amount of communication data according to the real-time status of the nodes, greatly reducing bandwidth consumption, but also allows platforms with huge differences in computing power and network conditions to train together asynchronously, effectively avoiding training stagnation caused by the "barrel effect" of the system, and significantly improving the communication efficiency and overall robustness of the cross-platform federated system.
[0018] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating a cross-platform heterogeneous data sharing and analysis method based on federated learning according to the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Specific model specifications need to be selected and determined according to the actual specifications of the device, etc. The specific selection calculation method adopts existing technology in the art, and therefore will not be described in detail.
[0021] Example like Figure 1 As shown, this invention provides a cross-platform heterogeneous data sharing and analysis method based on federated learning, comprising the following steps: S1. Each client participating in the data sharing analysis builds a heterogeneous feature extraction network locally to map local heterogeneous data of different dimensions to a latent space of a unified dimension and obtain local latent representations. Client The local data feature dimension is The unified latent space dimension is ,and Heterogeneous feature extraction networks include one of the following: multilayer perceptron, convolutional neural network, or Transformer network, where the output layer dimension is forcibly set to a certain value. .
[0022] S2. Each client calculates the local prototype vector for each category based on the local implicit representation, and encrypts the local prototype vector using a homomorphic encryption algorithm to generate a ciphertext prototype. The formula for calculating the local prototype vector is: ; in, For the client Medium category The local prototype, For the client Belongs to the category The sample set, For the sample The local hidden representation.
[0023] S3. The federation server receives the ciphertext prototype, performs weighted aggregation on the ciphertext prototype under the ciphertext domain, generates a global ciphertext prototype, and distributes it to each client. The formula for weighted aggregation of ciphertext prototypes under the ciphertext field is: ; in, For all clients regarding categories The global plaintext prototype, For encrypted global category prototype, The total number of clients participating in federated learning.
[0024] The homomorphic encryption algorithm is the Paillier encryption algorithm. Each client generates a Paillier public-private key pair locally and uses the public key pair to set up a local prototype vector. and the number of local samples Encrypt; Since the Paillier algorithm does not support direct division between ciphertexts, step S3, which generates a global ciphertext prototype and distributes it to each client, specifically includes: The federated server calculates the ciphertext molecule under the ciphertext domain. And count the plaintext denominator ; The server sends the ciphertext numerator and plaintext denominator to each client. After receiving the data, each client decrypts the ciphertext using its local private key to obtain the plaintext, and then performs a division operation in its local plaintext field to obtain the global plaintext prototype. .
[0025] S4. Each client receives and decrypts the global ciphertext prototype, constructs a joint loss function using the contrast loss and cross-entropy loss based on the global plaintext prototype, and updates the local network parameters through backpropagation. The joint loss function is as follows: ; in, For cross-entropy loss, To balance hyperparameters, For prototype comparison loss; Prototype contrast loss The calculation formula is: ; in, Represents cosine similarity. For temperature coefficient, For the sample The global prototype corresponding to the real label.
[0026] S5. Each client monitors the local network and computing resource status in real time, performs Top-K sparsification on the locally updated gradient based on the dynamically calculated sparsification rate, and asynchronously uploads the sparsified gradient triplet to the server for aggregation. The formula for dynamically calculating the sparsity rate is as follows: ; in, To preset the maximum sparsity, For the client Real-time bandwidth, For the client CPU utilization and As a preset reference standard, and These are preset weighting coefficients.
[0027] The specific method for Top-K sparsification and the construction of gradient triples is as follows: Client Based on the calculated sparsity rate Determine the number of gradient elements to be retained. ,in Update gradient tensors locally The total number of elements; gradient tensor Sort all elements in descending order by absolute value, and extract the elements with the largest absolute value. Gradient elements; Extracted The values of each gradient element are used as Its original gradient tensor The position number in the middle is used as And append the current client's unique identifier as Combine to generate gradient triples ; The client asynchronously uploads the set of gradient triples to the server, and the server receives and then... Will The data is accumulated to the corresponding position in the global model parameters to complete the asynchronous aggregation.
[0028] The specific steps for server aggregation include asynchronous weighted aggregation: The server maintains a global model parameter cache. When it receives a gradient triplet asynchronously uploaded by a client, it does not need to wait for other clients that have not yet uploaded; it directly calculates the time decay weight of that client based on the received timestamp. ; in, The preset attenuation factor and , This represents the server's current receiving time. This refers to the time when the client completed its previous upload. The server will receive the gradient triplet. Multiply by time decay weight Afterwards, according to The data is accumulated to the corresponding position of the global model parameters to complete the asynchronous aggregation update.
[0029] Therefore, this invention employs a cross-platform heterogeneous data sharing and analysis method based on federated learning. By constructing a heterogeneous feature extraction network and combining it with a contrastive loss based on a global prototype, it effectively overcomes the feature heterogeneity problem caused by differences in data dimensions and modalities across different platforms, achieving semantic alignment of cross-domain data in a unified latent space. Simultaneously, homomorphic encryption technology is introduced to complete prototype-secure aggregation in the ciphertext domain, completely eliminating the privacy leakage risk caused by intermediate representation interactions. Furthermore, the Top-K gradient sparsity based on real-time resource state dynamic calculation and the asynchronous communication mechanism of gradient triples significantly reduces network bandwidth consumption and effectively avoids the system's "weakest link" effect. This effectively solves the feature heterogeneity and communication bottlenecks, significantly improving the collaborative training efficiency and overall robustness of the cross-platform federated system while strictly ensuring data privacy and security, demonstrating high industrial application value.
[0030] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A cross-platform heterogeneous data sharing and analysis method based on federated learning, characterized in that: Includes the following steps: S1. Each client participating in the data sharing analysis builds a heterogeneous feature extraction network locally to map local heterogeneous data of different dimensions to a latent space of a unified dimension and obtain local latent representations. S2. Each client calculates the local prototype vector for each category based on the local implicit representation, and encrypts the local prototype vector using a homomorphic encryption algorithm to generate a ciphertext prototype. S3. The federation server receives the ciphertext prototype, performs weighted aggregation on the ciphertext prototype under the ciphertext domain, generates a global ciphertext prototype, and distributes it to each client. S4. Each client receives and decrypts the global ciphertext prototype, constructs a joint loss function using the contrast loss and cross-entropy loss based on the global plaintext prototype, and updates the local network parameters through backpropagation. S5. Each client monitors the local network and computing resource status in real time, performs Top-K sparsification on the locally updated gradient based on the dynamically calculated sparsification rate, and asynchronously uploads the sparsified gradient triplet to the server for aggregation.
2. The cross-platform heterogeneous data sharing and analysis method based on federated learning according to claim 1, characterized in that: In step S1, the client The local data feature dimension is The unified latent space dimension is ,and Heterogeneous feature extraction networks include one of the following: multilayer perceptron, convolutional neural network, or Transformer network, where the output layer dimension is forcibly set to a certain value. .
3. The cross-platform heterogeneous data sharing and analysis method based on federated learning according to claim 2, characterized in that: In step S2, the formula for calculating the local prototype vector is: ; in, For the client Medium category The local prototype, For the client Belongs to the category The sample set, For the sample The local hidden representation.
4. The cross-platform heterogeneous data sharing and analysis method based on federated learning according to claim 3, characterized in that: In step S3, the formula for weighted aggregation of the ciphertext prototype under the ciphertext field is: ; in, For all clients regarding categories The global plaintext prototype, For encrypted global category prototype, The total number of clients participating in federated learning.
5. The cross-platform heterogeneous data sharing and analysis method based on federated learning according to claim 4, characterized in that: The homomorphic encryption algorithm is the Paillier encryption algorithm. Each client generates a Paillier public-private key pair locally and uses the public key pair to set up a local prototype vector. and the number of local samples Encrypt; Since the Paillier algorithm does not support direct division between ciphertexts, step S3, which generates a global ciphertext prototype and distributes it to each client, specifically includes: The federated server calculates the ciphertext molecule under the ciphertext domain. And count the plaintext denominator ; The server sends the ciphertext numerator and plaintext denominator to each client. After receiving the data, each client decrypts the ciphertext using its local private key to obtain the plaintext, and then performs a division operation in its local plaintext field to obtain the global plaintext prototype. .
6. The cross-platform heterogeneous data sharing and analysis method based on federated learning according to claim 5, characterized in that: In step S4, the joint loss function is specifically as follows: ; in, For cross-entropy loss, To balance hyperparameters, For prototype comparison loss; Prototype contrast loss The calculation formula is: ; in, Represents cosine similarity. For temperature coefficient, For the sample The global prototype corresponding to the real label.
7. The cross-platform heterogeneous data sharing and analysis method based on federated learning according to claim 6, characterized in that: In step S5, the formula for dynamically calculating the sparsity rate is as follows: ; in, To preset the maximum sparsity, For the client Real-time bandwidth, For the client CPU utilization and As a preset reference standard, and These are preset weighting coefficients.
8. The cross-platform heterogeneous data sharing and analysis method based on federated learning according to claim 7, characterized in that: In step S5, the specific method for Top-K sparsification and the construction of gradient triples is as follows: Client Based on the calculated sparsity rate Determine the number of gradient elements to be retained. ,in Update gradient tensors locally The total number of elements; gradient tensor Sort all elements in descending order by absolute value, and extract the elements with the largest absolute value. gradient elements; Extracted The values of each gradient element are used as Its original gradient tensor The position number in the middle is used as And append the current client's unique identifier as Combine to generate gradient triples ; The client asynchronously uploads the set of gradient triples to the server, and the server receives and then... Will The data is accumulated to the corresponding position in the global model parameters to complete the asynchronous aggregation.
9. A cross-platform heterogeneous data sharing and analysis method based on federated learning according to claim 8, characterized in that: In step S5, the server performs aggregation, specifically including asynchronous weighted aggregation: The server maintains a global model parameter cache. When it receives a gradient triplet asynchronously uploaded by a client, it does not need to wait for other clients that have not yet uploaded; it directly calculates the time decay weight of that client based on the received timestamp. ; in, The preset attenuation factor and , This represents the server's current receiving time. This refers to the time when the client completed its previous upload. The server will receive the gradient triplet. Multiply by time decay weight Afterwards, according to The data is accumulated to the corresponding position of the global model parameters to complete the asynchronous aggregation update.
