Enterprise data encryption method and system based on federated learning
Through the enterprise data encryption method based on federated learning, homomorphic encryption and secure multi-party computing technology, efficient collaborative computing of enterprise sensitive data in cross-organizational collaboration scenarios is realized, and collaborative computing models that meet business needs are generated, solving the problems of data sharing and collaborative computing, and promoting the privacy protection of enterprise data.
Patent Information
- Application Number
- CN202510675407.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-07-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the cross-organizational collaboration scenario, it is difficult for existing technologies to achieve efficient collaborative computing while protecting the privacy of sensitive data in enterprise, resulting in limited collaboration efficiency and increased risk of data breaches.
Using a corporate data encryption method based on federated learning, the enterprise sensitive data is encrypted and mapped to high-dimensional vector space, homomorphic encryption and secure multi-party computing technology are used to realize efficient aggregation and calculation of multi-party encryption vectors, and combined with task shard mapping and dynamic adjustment, a collaborative computing model that meets business needs is generated.
It realizes efficient collaborative computing under the premise of protecting data privacy, solves the problems of data sharing and collaborative computing among enterprises, and promotes privacy protection and collaborative computing of enterprise data.
Smart Images

Figure CN120389898A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to an enterprise data encryption method and system based on federated learning. Background Art
[0002] Data security and privacy protection are core tasks in the information age, and are related to the core competitiveness of enterprises and user trust. Especially in cross-organizational collaboration scenarios with multiple participants, how to achieve efficient collaborative computing while protecting sensitive data has become the key to promoting enterprise digital transformation.
[0003] Current solutions for sensitive enterprise data rely on traditional encryption technologies or centralized data storage. While these solutions can protect data to a certain extent, they often face the risk of inefficient data computation and privacy breaches. Especially in cross-organizational collaboration scenarios where data needs to be shared across organizations, these solutions struggle to support complex computational requirements while protecting privacy, resulting in limited collaboration efficiency and even increased risk of data breaches.
[0004] Therefore, how to achieve encryption and efficient collaborative computing of enterprises' sensitive data has become a key issue that needs to be urgently solved in the industry. Summary of the Invention
[0005] In view of this, the present invention proposes an enterprise data encryption method and system based on federated learning to solve the problem that it is difficult to process enterprise sensitive data while protecting privacy and supporting complex computing requirements.
[0006] The technical solution of the present invention is achieved in this way: According to a first aspect, an embodiment of the present invention provides an enterprise data encryption method based on federated learning, the method being applied to a node end, the method comprising: Access sensitive enterprise data; Send enterprise sensitive data to the server, obtain the sharded encrypted data and local tasks issued by the server, process the sharded encrypted data according to the local tasks and the local computing model in the collaborative computing model, obtain local computing results, and send the local computing results to the server; the server aggregates the local computing results of each node to obtain the global computing result. The collaborative computing model is composed of the local computing models of each node, and each local computing model has corresponding local task parameters; The collaborative computing model is trained by the following steps: Acquire historical sensitive data, encrypt the historical sensitive data to obtain the historical encrypted data stream of the node end, extract historical feature information from the encrypted data stream, and map the historical feature information to a vector space of a preset dimension to obtain the historical feature vector of the node end; Perform homomorphic encryption on the historical feature vectors to obtain historical homomorphic encrypted vectors, and upload the historical homomorphic encrypted vectors to the server side; the server side is used to perform weighted aggregation processing on the historical homomorphic encrypted vectors obtained from each node side according to the historical aggregation coefficients of the node sides to obtain historical global encrypted vectors, slice the historical global encrypted vectors according to the historical task requirements and the historical aggregation coefficients of each node side to obtain historical task slice mapping rules and the historical slice encrypted data of each node side, and distribute the historical slice encrypted data and local tasks to each node side according to the historical task slice mapping rules; Obtain the historical slice encrypted data and local tasks sent by the server side, decrypt the historical slice encrypted data according to the local tasks to obtain historical local decrypted vectors, and send the historical local decrypted vectors to the server side; the server side is used to perform distributed training on the historical local decrypted vectors in the way of federated learning to obtain local task parameters.
[0007] Combined with the first aspect, in the first implementation manner of the first aspect, the obtaining of historical sensitive data, encrypting the historical sensitive data to obtain the historical encrypted data stream of the node side, extracting historical feature information from the encrypted data stream, and mapping the historical feature information to a vector space of a preset dimension to obtain the historical feature vector of the node side specifically includes: Obtain the historical sensitive data of each node side, and encrypt all the historical sensitive data to obtain the historical encrypted data streams of each node; Perform feature analysis on the historical encrypted data streams of each node side, and extract the historical feature information of each node from the historical encrypted data stream; Perform feature compression processing on the historical feature information of each node side, reduce the dimension of the historical feature information to a preset dimension, and map the dimension-reduced historical feature information to a vector space of a preset dimension to obtain the historical feature vectors of each node side; Determine whether the historical feature vector reaches the preset dimension. If it is determined that it does not reach, perform dimension expansion on the historical feature vector so that the historical feature vector reaches the preset dimension; Determine the Euclidean distance between each historical feature vector in each node side, obtain the first distance distribution diagram of each node according to the Euclidean distance, and determine the encryption effectiveness of the historical feature vectors of each node side according to the first distance distribution diagram.
[0008] Combined with the first implementation manner of the first aspect, in the second implementation manner of the first aspect, the performing homomorphic encryption on the historical feature vectors to obtain historical homomorphic encrypted vectors, and uploading the historical homomorphic encrypted vectors to the server side specifically includes: Each node terminal negotiates to obtain a homomorphic encryption key, uses the homomorphic encryption key to perform homomorphic encryption processing on the historical feature vectors, and obtains the corresponding historical homomorphic encryption vectors of each node terminal according to the secure multi-party computing protocol; Determine whether the historical homomorphic encryption vectors reach a preset dimension. If it is determined that they do not reach the preset dimension, expand the dimension of the historical homomorphic encryption vectors so that the historical feature vectors reach the preset dimension; Determine the Euclidean distance between the historical homomorphic encryption vectors of each node terminal, obtain the second first distance distribution diagram of each node terminal according to the Euclidean distance, and determine the historical homomorphic encryption vectors of the historical feature vectors of each node terminal according to the second distance distribution diagram, and upload the historical homomorphic encryption vectors to the server side.
[0009] Combined with the first aspect, in the third implementation manner of the first aspect, the local task parameters are obtained through the following steps: Obtain the local task parameters of the local computing model sent by the server side; the server side is used to perform consistency verification on the historical local decryption vectors obtained from each node terminal, perform distributed training on the historical local decryption vectors that pass the consistency verification in a federated learning manner, and encrypt the gradient data generated during the training process to obtain the historical local model parameters of the node terminal. Perform weighted aggregation processing on the historical local model parameters according to the historical aggregation coefficient of the node terminal to obtain the historical global model parameters, and determine whether the historical global model parameters meet the global convergence. If it is determined that the historical global model parameters meet the global convergence, decrypt and perform consistency verification on the historical global model parameters to obtain the local task parameters that pass the consistency.
[0010] According to the second aspect, an embodiment of the present invention provides an enterprise data encryption method based on federated learning. The method is applied to the server side, and the method includes: Obtain the current aggregation coefficient of each node terminal and the enterprise sensitive data uploaded by the node terminal, slice all the enterprise sensitive data according to the current aggregation coefficient to obtain a task slice mapping rule, local tasks, and slice encryption data corresponding to the local tasks, and send the local tasks and slice encryption data to each node terminal according to the task slice mapping rule; the server side allocates the current aggregation coefficient for each node terminal according to the current data volume and current computing power of the node terminal, and the current computing power of the node terminal is the current allocable hardware resources of the node terminal; Obtain the local computing results uploaded by each node terminal, and aggregate the local computing results of each node terminal to obtain the global computing result; the node terminal is used to process the slice encryption data according to the local tasks and the local computing model in the collaborative computing model to obtain the local computing result, and the collaborative computing model is jointly composed of the local computing models of each node terminal, and each local computing model has corresponding local task parameters.
[0011] Combined with the second aspect, in the first implementation manner of the second aspect, the collaborative computing model is trained through the following steps: Obtain the historical homomorphic encryption vectors uploaded by each node; the node is used to perform homomorphic encryption processing on the historical feature vectors to obtain historical homomorphic encryption vectors. The historical feature vectors are obtained by the node mapping the historical feature information to a vector space of a preset dimension, and the historical feature information is obtained by the node extracting features from the encrypted historical sensitive data; Perform weighted aggregation processing on the historical homomorphic encryption vectors obtained from each node according to the historical aggregation coefficient of the node to obtain a historical global encryption vector. Shard the historical global encryption vector according to the historical task requirements and the historical aggregation coefficients of each node to obtain a historical task sharding mapping rule and the historical sharded encrypted data of each node, and distribute the historical sharded encrypted data and local tasks to each node according to the historical task sharding mapping rule; Obtain the historical local decryption vectors uploaded by each node, perform consistency verification on the historical local decryption vectors, perform distributed training on the historical local decryption vectors that pass the consistency verification in a federated learning manner, and encrypt the gradient data generated during the training process to obtain the historical local model parameters of each local computing model; the node is used to decrypt the historical sharded encrypted data according to the local task to obtain the historical local decryption vectors; Perform weighted aggregation processing on the historical local model parameters according to the historical aggregation coefficient of the node to obtain historical global model parameters, and determine whether the historical global model parameters meet the global convergence. When it is determined that the historical global model parameters meet the global convergence, decrypt and perform consistency verification on the historical global model parameters to obtain local task parameters that pass the consistency, and distribute the local task parameters to the local computing models of each node.
[0012] Combined with the first implementation manner of the second aspect, in the second implementation manner of the second aspect, the step of performing weighted aggregation processing on the historical homomorphic encryption vectors obtained from each node according to the historical aggregation coefficient of the node to obtain a historical global encryption vector, sharding the historical global encryption vector according to the historical task requirements and the historical aggregation coefficients of each node to obtain a historical task sharding mapping rule and the historical sharded encrypted data of each node, and distributing the historical sharded encrypted data and local tasks to each node according to the historical task sharding mapping rule specifically includes: Allocate corresponding historical aggregation coefficients for each node according to the historical data volume and historical computing power of the node; Perform weighted aggregation processing on the historical homomorphic encryption vectors obtained from each node end according to the historical aggregation coefficients at the node end to obtain a historical global encryption vector, and perform consistency verification on the historical global encryption vector; Generate a historical task sharding mapping rule according to the historical task requirements and the historical aggregation coefficients of each node end and using a decision tree algorithm, and shard the historical global encryption vector according to the historical task sharding mapping rule to obtain the historical sharded encrypted data of each node end; According to the historical task sharding mapping rule, distribute the historical sharded encrypted data and the local task to each node end; the node end is used to perform homomorphic encryption processing on the historical sharded encrypted data to obtain a historical encrypted calculation result; Obtain the historical encrypted calculation results uploaded by each node, perform weighted aggregation processing on the historical encrypted calculation results according to the historical aggregation coefficients of each node end, adjust the local task according to the result of the weighted aggregation, and distribute the historical sharded encrypted data and the adjusted local task to each node end according to the historical task sharding mapping rule.
[0013] Combined with the first implementation manner of the second aspect, in the third implementation manner of the second aspect, the method for obtaining the historical local decryption vectors uploaded by each node end, performing consistency verification on the historical local decryption vectors, performing distributed training on the historical local decryption vectors that pass the consistency verification in a federated learning manner, and encrypting the gradient data generated during the training process to obtain the historical local model parameters of each local computing model specifically includes: Obtain the historical local decryption vectors uploaded by each node end, and perform consistency verification on the historical local decryption vectors; Perform data signature verification on the historical local decryption vectors that pass the consistency verification; the node end is used to add a corresponding digital signature to the historical local decryption vector; Perform distributed training on the historical local decryption vectors that pass the data signature verification in a federated learning manner, and encrypt the gradient data generated during the training process to obtain the historical local model parameters of each local computing model; Perform gradient detection on the historical local model parameters, and delete the historical local model parameters with abnormal gradient detection.
[0014] According to the third aspect, an embodiment of the present invention provides an enterprise data encryption system based on federated learning. The system is applied to the node end, and the system includes: A first data acquisition module, configured to acquire enterprise sensitive data; The second data processing module is used to send enterprise sensitive data to the server side, obtain the sharded encrypted data and local tasks sent by the server side, process the sharded encrypted data according to the local tasks and the local calculation models in the collaborative computing model to obtain local calculation results, and send the local calculation results to the server side; the server side aggregates the local calculation results of each node end to obtain the global calculation result. The collaborative computing model is jointly composed of the local calculation models of each node end, and each local calculation model has corresponding local task parameters; The collaborative computing model is trained through the following steps: Obtain historical sensitive data, encrypt the historical sensitive data to obtain the historical encrypted data stream of the node end, extract historical feature information from the encrypted data stream, and map the historical feature information to a vector space of a preset dimension to obtain the historical feature vector of the node end; Perform homomorphic encryption processing on the historical feature vector to obtain a historical homomorphic encrypted vector, and upload the historical homomorphic encrypted vector to the server side; the server side is used to perform weighted aggregation processing on the historical homomorphic encrypted vectors obtained from each node end according to the historical aggregation coefficient of the node end to obtain a historical global encrypted vector, slice the historical global encrypted vector according to the historical task requirements and the historical aggregation coefficients of each node end to obtain a historical task sharding mapping rule and the historical sharded encrypted data of each node end, and distribute the historical sharded encrypted data and local tasks to each node end according to the historical task sharding mapping rule; Obtain the historical sharded encrypted data and local tasks sent by the server side, decrypt the historical sharded encrypted data according to the local tasks to obtain a historical local decrypted vector, and send the historical local decrypted vector to the server side; the server side is used to perform distributed training on the historical local decrypted vectors in the way of federated learning to obtain local task parameters.
[0015] According to the fourth aspect, an embodiment of the present invention provides an enterprise data encryption system based on federated learning. The system is applied to the server side, and the system includes: The second data acquisition module is used to acquire the current aggregation coefficients of each node end and the enterprise sensitive data uploaded by the node end, slice all the enterprise sensitive data according to the current aggregation coefficients to obtain a task sharding mapping rule, local tasks and sharded encrypted data corresponding to the local tasks, and distribute the local tasks and sharded encrypted data to each node end according to the task sharding mapping rule; the server side allocates the current aggregation coefficient for each node end according to the current data volume and current computing power of the node end, and the current computing power of the node end is the current allocable hardware resources of the node end; The second data processing module is used to obtain the local calculation results uploaded by each node, collect the local calculation results of each node, and obtain the global calculation result; the node is used to process the sharded encrypted data according to the local task and the local calculation model in the collaborative calculation model to obtain the local calculation result. The collaborative calculation model is jointly composed of the local calculation models of each node, and each local calculation model has corresponding local task parameters.
[0016] The enterprise data encryption method and system based on federated learning of the present invention have the following beneficial effects compared with the prior art: At the node side, the enterprise sensitive data is encrypted, the feature information in the data is extracted, the feature information is mapped to a high-dimensional vector space to obtain a feature vector, then the feature vector is homomorphically encrypted to obtain a homomorphic encrypted vector, and then the server side performs weighted aggregation processing on the homomorphic encrypted vector according to the task processing capabilities of each node, and performs sharding and task allocation on the weighted aggregation processing result. The sharded encrypted data is decrypted according to the local task to obtain a local decrypted vector. The server side then uses the federated learning method to perform distributed training on the local decrypted vector to obtain local task parameters. In this way, the enterprise sensitive data is encrypted multiple times, and data collaboration is realized by using homomorphic encryption, homomorphic decryption and secure multi-party calculation. At the same time, the efficient aggregation and calculation of multi-party encrypted vectors are realized by using homomorphic encryption or secure multi-party calculation technology, and the collaborative calculation task is executed on the premise of protecting data privacy. The calculation efficiency is improved through task sharding mapping and dynamic adjustment. The finally generated collaborative calculation model has passed performance verification and can meet the business requirements of enterprise sensitive data. High-efficiency collaborative calculation is carried out while protecting data privacy, solving the problems of data sharing and collaborative calculation among enterprises, providing a new solution for the secure utilization of enterprise sensitive data, and promoting the privacy protection and collaborative calculation of enterprise data. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings.
[0018] Figure 1 It is one of the flow diagrams of the enterprise data encryption method based on federated learning of the present invention applied to the node side; Figure 2 It is the training process flow diagram of the collaborative calculation model when the enterprise data encryption method based on federated learning of the present invention is applied to the node side; Figure 3Schematic diagram II of the process of the enterprise data encryption method based on federated learning of the present invention applied to the node side; Figure 4 Schematic diagram III of the process of the enterprise data encryption method based on federated learning of the present invention applied to the node side; Figure 5 Schematic diagram I of the process of the enterprise data encryption method based on federated learning of the present invention applied to the server side; Figure 6 Schematic diagram of the training process of the collaborative computing model when the enterprise data encryption method based on federated learning of the present invention is applied to the server side; Figure 7 Schematic diagram II of the process of the enterprise data encryption method based on federated learning of the present invention applied to the server side; Figure 8 Schematic diagram III of the process of the enterprise data encryption method based on federated learning of the present invention applied to the server side; Figure 9 Schematic diagram of the structure of the enterprise data encryption system based on federated learning of the present invention applied to the node side; Figure 10 Schematic diagram of the structure of the enterprise data encryption system based on federated learning of the present invention applied to the server side. Detailed implementation manners
[0019] Next, in combination with the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0020] Data security and privacy protection are the core tasks in the information age, which are related to the core competitiveness of enterprises and user trust. Especially in the cross-organization collaboration scenario participated by multiple parties, how to achieve efficient collaborative computing while protecting sensitive data has become the key to promoting the digital transformation of enterprises.
[0021] Currently, the solutions for enterprise sensitive data rely on traditional data encryption technologies or centralized data storage. Although these solutions can protect data to a certain extent, they often face the risks of low data computing efficiency or privacy leakage. Especially in the cross-organization collaboration scenario, data needs to be shared across organizations, and these solutions are difficult to support complex computing requirements while protecting privacy, resulting in limited collaboration efficiency and even increased risk of data leakage.
[0022] Specifically, the first is that the data encryption method needs to support computing operations while protecting privacy. Secondly, in cross-organizational collaboration scenarios, data aggregation and computing, when the encrypted data is aggregated on the central server, how to achieve efficient computing operations to avoid wasting computing resources or failing to protect privacy? Finally, more complicated is how to build a global model without leaking the original data of each party when multiple parties are involved.
[0023] To sum up, in this context, how to achieve encryption and efficient collaborative computing of enterprises' sensitive data has become a key issue that the industry urgently needs to solve.
[0024] The enterprise data encryption method based on federated learning provided in this specification aims to securely encrypt sensitive enterprise data through a symmetric encryption algorithm and map it to a high-dimensional vector space. It also leverages homomorphic encryption and secure multi-party computing technologies to achieve efficient aggregation and computation of multi-party encrypted vectors, promoting privacy protection and collaborative computing of enterprise data.
[0025] See also Figure 1 and Figure 2 , Figure 1 The figure shows a flow chart of the enterprise data encryption method based on federated learning according to an embodiment of the present invention. Figure 2 A training diagram of a collaborative computing model in federated learning according to an embodiment of the present invention is shown. The method is applied to a node end, such as each distributed node in a distributed system. The method may include the following steps: S101. Obtain sensitive enterprise data, such as the enterprise's financial data.
[0026] A server (e.g., a central server) connects to several nodes via secure communication channels. Some or all of these nodes collaborate with each other. Enterprise sensitive data can be stored in each node or retrieved from the outside. There are no restrictions on the specific method of obtaining enterprise sensitive data; the only requirement is that the nodes can access the data.
[0027] S102: Send the enterprise's sensitive data to the server, obtain the encrypted shard data and local tasks issued by the server, process the encrypted shard data according to the local tasks and the local computing models in the collaborative computing model, obtain local computing results, and send the local computing results to the server. The server aggregates the local computing results of each node to obtain a global computing result. The collaborative computing model is composed of the local computing models of each node, and each local computing model has its own corresponding local task parameters.
[0028] The global calculation results can assist enterprise decision-making. For example, if the enterprise's sensitive data is the enterprise's financial data, the corresponding global calculation results can be further used to dynamically monitor cost changes, adjust budget allocation accordingly for financial planning, and meet stringent business requirements.
[0029] In this embodiment, specifically, the collaborative computing model is trained through the following steps: S201. Obtain historical sensitive data, encrypt the historical sensitive data to obtain the historical encrypted data stream of the node, extract historical feature information from the encrypted data stream, and map the historical feature information to a vector space of a preset dimension to obtain the historical feature vector of the node.
[0030] Similarly, the historical sensitive data can be stored in each node in advance, or can be obtained by each node from the outside world. No specific restrictions are imposed on the specific acquisition form of the historical sensitive data here, as long as it is ensured that the node side can obtain the historical sensitive data.
[0031] In this step, each node side will perform the first data encryption process on the historical sensitive data it obtains, and finally encrypt it to obtain a high-dimensional vector, so as to ensure data security and the effectiveness of the encrypted vector.
[0032] S202. Perform homomorphic encryption processing on the historical feature vector to obtain a historical homomorphic encrypted vector, and upload the historical homomorphic encrypted vector to the server side.
[0033] Among them, the server side is used to perform weighted aggregation processing on the historical homomorphic encrypted vectors obtained from each node side according to the historical aggregation coefficient of the node side to obtain a historical global encrypted vector, slice the historical global encrypted vector according to the historical task requirements and the historical aggregation coefficient of each node side to obtain a historical task slice mapping rule and the historical slice encrypted data of each node side, and distribute the historical slice encrypted data and local tasks to each node side according to the historical task slice mapping rule.
[0034] It can be understood that after all the historical slice encrypted data are merged according to the historical task slice mapping rule, the above complete historical global encrypted vector will be obtained, and the historical task slice mapping rule includes the local tasks of each node side, the types of local tasks, the computational complexity, and the computing resources.
[0035] In this embodiment, the server side will allocate corresponding historical aggregation coefficients for each node side according to the historical data volume and historical computing ability of the node side. The historical computing ability of the node side specifically includes the historical allocable hardware resources of the node side (such as the available CPU resources and available memory resources at a certain historical moment), and the historical aggregation coefficient reflects the task processing ability of the node side.
[0036] S203. Obtain the historical shard encrypted data and local tasks sent by the server side, decrypt the historical shard encrypted data according to the local tasks to obtain historical local decryption vectors, and send the historical local decryption vectors to the server side.
[0037] Among them, the server side is used to perform consistency verification on the historical local decryption vectors obtained from each node side, perform distributed training on the historical local decryption vectors that pass the consistency verification in a federated learning manner, and encrypt the gradient data generated during the training process to obtain the historical local model parameters of the node side. Perform weighted aggregation processing on the historical local model parameters according to the historical aggregation coefficients of the node side to obtain the historical global model parameters, and determine whether the historical global model parameters meet the global convergence. In the case of determining that the historical global model parameters meet the global convergence, decrypt and perform consistency verification on the historical global model parameters to obtain the local task parameters that pass the consistency verification. The final collaborative computing model consists of the local computing models of each node side and the corresponding local task parameters. The local computing model is obtained according to the local tasks.
[0038] During the process of distributing the shard data and tasks to the node side, the corresponding historical aggregation coefficients can be dynamically adjusted for each node side according to the changing historical data volume and historical computing power of the node side.
[0039] Specifically, assuming that the data is a 1024-dimensional vector, by sharding the vector into several sub-shares, at least multiple sub-shares are required to decrypt the vector during decryption. This method ensures the security of the original data even if the data of some node sides is leaked.
[0040] The enterprise data encryption method based on federated learning of the present invention encrypts enterprise sensitive data at the node side, extracts feature information from the data, maps the feature information to a high-dimensional vector space to obtain feature vectors, then performs homomorphic encryption processing on the feature vectors to obtain homomorphic encryption vectors, and then performs weighted aggregation processing on the homomorphic encryption vectors by the server side according to the task processing capabilities of each node side, and performs fragmentation and task allocation on the weighted aggregation processing result. Decrypt the fragmented encrypted data according to the local task to obtain local decryption vectors, and the server side uses the federated learning method to perform distributed training on the local decryption vectors to obtain local task parameters. In this way, multiple encryptions are performed on enterprise sensitive data, and data collaboration is achieved by using homomorphic encryption, homomorphic decryption, and secure multi-party computation. At the same time, homomorphic encryption or secure multi-party computation technology is used to achieve efficient aggregation and calculation of multi-party encryption vectors, and collaborative computing tasks are executed on the premise of protecting data privacy. The calculation efficiency is improved by task fragmentation mapping and dynamic adjustment. The finally generated collaborative computing model has passed performance verification and can meet the business requirements of enterprise sensitive data. While protecting data privacy, efficient collaborative computing is carried out, solving the problems of data sharing and collaborative computing between enterprises, providing a new solution for the secure utilization of enterprise sensitive data, and promoting the privacy protection and collaborative computing of enterprise data.
[0041] Please refer to Figure 3 , the collaborative computing model in this method can also be trained through the following steps: S3011. Obtain the historical sensitive data of each node side, and encrypt all the historical sensitive data to obtain the historical encrypted data streams of each node side.
[0042] In this embodiment, the node side can use a preset encryption algorithm and key management module to generate a corresponding symmetric key, and use the symmetric key to encrypt the historical sensitive data to obtain the historical encrypted data stream.
[0043] Preferably, the preset encryption algorithm can adopt the Advanced Encryption Standard (AES-256) algorithm. AES-256 is a symmetric encryption algorithm with a key length of 256 bits and extremely high security. Taking enterprise financial data as an example of sensitive data, assume that it is necessary to encrypt a database table containing historical sensitive data such as employees' historical salaries and the company's historical income. The node side uses the preset key management module to generate a 256-bit symmetric key, for example, generate a random key based on the Hardware Security Module (HSM). In the subsequent encryption process, the above historical sensitive data is encrypted into a historical encrypted data stream, and the historical encrypted data stream is an unreadable ciphertext stream. This data encryption method ensures that even if the data is intercepted, it cannot be directly interpreted, significantly improving the security of data transmission and storage.
[0044] S3012. Perform feature analysis on the historical encrypted data streams of each node end, and extract the historical feature information of each node end from the historical encrypted data streams.
[0045] In this embodiment, for the encrypted historical encrypted data streams, the server uses statistical methods or a trained feature extraction model to extract the required historical feature information from the historical encrypted data streams to support subsequent analysis. For example, using a trained feature extraction model to extract statistical characteristics such as the byte distribution and entropy value of data blocks in the historical encrypted data streams to generate an initial feature set, that is, historical feature information. These feature information do not depend on the plaintext content and retain the analyzability of the ciphertext, laying a foundation for subsequent high-dimensional mapping.
[0046] S3013. Perform feature compression processing on the historical feature information of each node end, reduce the dimension of the historical feature information to a preset dimension, and map the dimension-reduced historical feature information to a vector space of the preset dimension to obtain the historical feature vectors of each node end.
[0047] Since the extracted historical feature information may contain redundant information, such as multiple features reflecting similar data patterns. In this embodiment, the principal component analysis method is used to compress the historical feature information into a high-dimensional vector of a preset dimension (for example, 1024 dimensions). The principal component analysis method reduces the dimension of highly correlated features to mutually orthogonal principal components through linear transformation, retaining the main information of the data. In this way, while reducing the computational complexity, sufficient data variance (for example, 95%) is retained. Then, the dimension-reduced historical feature information is mapped to a vector space of the preset dimension to obtain historical feature vectors. This mapping enhances the compactness and analysis efficiency of the data.
[0048] S3014. Determine whether the historical feature vectors reach the preset dimension. In the case of determining that they do not reach, perform dimension expansion on the historical feature vectors so that the historical feature vectors reach the preset dimension.
[0049] If the dimension of the high-dimensional historical feature vectors is less than the preset dimension, that is, less than 1024 dimensions, it may lead to information loss. The dimension can be expanded through ciphertext dimension expansion, such as augmenting the vector with a random projection matrix. Suppose the historical feature vector output is an 800-dimensional vector. The random projection matrix can be generated based on the Gaussian distribution to expand the vector to 1024 dimensions. In this way, the dimension missing can be filled without introducing significant noise, ensuring the completeness of the vector space.
[0050] S3015. Determine the Euclidean distance between the historical feature vectors of each node end, obtain the first distance distribution diagram of each node end according to the Euclidean distance, and determine the encryption effectiveness of the historical feature vectors of each node end according to the first distance distribution diagram.
[0051] In this embodiment, the historical sensitive data of the node end with insufficient encryption effectiveness will also be processed again through steps S3011 to S3014, and the encryption effectiveness will be determined again until the historical feature vectors in the node end have encryption effectiveness.
[0052] The above Euclidean distance is the Euclidean distance of each historical feature vector in the vector space of the preset dimension. The Euclidean distance calculation method is used to analyze the distribution uniformity of the historical feature vectors in the vector space. The mean value of the Euclidean distances of each historical feature vector in the first distance distribution diagram is stable and the variance is small, indicating that each historical feature vector is evenly distributed, indicating that the encrypted historical feature vectors have strong randomness, are difficult to be reversely cracked, and have high encryption effectiveness. In this way, by quantifying the distribution characteristics, the robustness of the encryption algorithm is verified.
[0053] It can be understood that the preset encryption algorithm and key management module ensure the confidentiality of historical sensitive data. Feature extraction and principal component analysis support ciphertext analysis. Possible dimension expansion ensures vector completeness. The Euclidean distance can ensure the quality of encryption. The settings from step S3011 to step S3015 together constitute a complete process from data simultaneous encryption to analysis, which is applicable to various enterprise sensitive data protection and compliance analysis scenarios, taking into account both security and practicality.
[0054] S302. Perform homomorphic encryption processing on the historical feature vectors to obtain historical homomorphic encryption vectors, and upload the historical homomorphic encryption vectors to the server end. For specific content, refer to step S202.
[0055] S303. Obtain the historical shard-encrypted data and local tasks sent by the server end, decrypt the historical shard-encrypted data according to the local tasks to obtain historical local decryption vectors, and send the historical local decryption vectors to the server end. For specific content, refer to step S203.
[0056] Please refer to Figure 4 , the collaborative computing model in this method can also be trained through the following steps: S401. Obtain historical sensitive data, encrypt the historical sensitive data to obtain the historical encrypted data stream at the node end, extract historical feature information from the encrypted data stream, and map the historical feature information to the vector space of the preset dimension to obtain the historical feature vectors at the node end. For specific content, refer to step S201.
[0057] S4021. Each node end negotiates to obtain a homomorphic encryption key, uses the homomorphic encryption key to perform homomorphic encryption processing on the historical feature vectors, and obtains the corresponding historical homomorphic encryption vectors of each node end according to the secure multi-party computing protocol.
[0058] In this embodiment, the node side can negotiate with the preset homomorphic encryption algorithm and the key management module to generate a corresponding homomorphic encryption key, and use the homomorphic encryption key to encrypt the historical feature vector to obtain a historical homomorphic encryption vector. This encryption is a homomorphic encryption operation for the high-dimensional historical feature vector and is also the second encryption operation performed by the node side. The vector processing flow based on homomorphic encryption can effectively support data analysis in a distributed collaborative environment.
[0059] Each mutually cooperative node side transmits data through a physically secure channel to ensure the confidentiality of the data during transmission, including uploading their respective historical feature vectors to a trusted third party (which can be a central server) and the trusted third party distributing the historical homomorphic encryption vectors to the corresponding node sides.
[0060] For example, the key management module adopts a Diffie-Hellman-based protocol, and each node side jointly negotiates to generate a homomorphic encryption key to avoid a single node side mastering the complete key. Specifically, this secondary encryption also enhances the security of data in multi-party computing through an additional homomorphic encryption layer.
[0061] The secure multi-party computing protocol is used to distribute the historical homomorphic encryption vectors, so that each mutually cooperative node side can receive the corresponding historical homomorphic encryption vectors without disclosing their respective inputs. For example, node side A and node side B each receive a part of the historical homomorphic encryption vectors, and the secure multi-party computing protocol ensures that a certain node side cannot infer the vector content of other node sides.
[0062] During this process, each node side also generates a digital signature based on the ECDSA algorithm. The digital signature is used to verify the identity of the node side. Each node side submits the public key and the digital signature to the trusted third party, and the trusted third party verifies the validity of the signature to ensure that only the authenticated node sides participate in the calculation.
[0063] S4022. Determine whether the historical homomorphic encryption vector reaches the preset dimension. If it is determined that it does not reach, expand the dimension of the historical homomorphic encryption vector so that the historical feature vector reaches the preset dimension.
[0064] This step is used to perform vector consistency verification on the historical homomorphic encryption vector. If the dimension of the high-dimensional historical homomorphic encryption vector is less than the preset dimension, that is, less than 1024 dimensions, it may cause metadata loss, and the dimension can be expanded by the zero-padding method.
[0065] Assume that the historical homomorphic encryption vector is output as an 800-dimensional vector. The zero-padding method expands the historical homomorphic encryption vector to 1024 dimensions by padding 224 zero values at the end of the vector. This method can maintain the integrity of the vector structure and facilitate subsequent analysis.
[0066] S4023. Determine the Euclidean distances between the historical homomorphic encryption vectors in each node end, obtain the second first distance distribution diagrams of each node end according to the Euclidean distances, determine the historical homomorphic encryption vectors of the historical feature vectors of each node end according to the second distance distribution diagrams, and upload the historical homomorphic encryption vectors to the server end.
[0067] In this embodiment, the historical feature vectors of the node ends with insufficient encryption effectiveness will also be re - processed in steps S4021 to S4022, and the encryption effectiveness will be determined again until the historical homomorphic encryption vectors in the node ends have encryption effectiveness.
[0068] Similarly, the above - mentioned Euclidean distance is the Euclidean distance of each historical homomorphic encryption vector in the vector space of the preset dimension. The Euclidean distance calculation method is used to analyze the distribution uniformity of the historical homomorphic encryption vectors in the vector space. The mean value of the Euclidean distances of each historical homomorphic encryption vector in the second distance distribution diagram is stable and the variance is small, indicating that each historical homomorphic encryption vector is evenly distributed, indicating that the encrypted historical homomorphic encryption vectors have strong randomness, are difficult to be reverse - cracked, and have high encryption effectiveness. In this way, by quantifying the distribution characteristics, the robustness of the encryption algorithm is verified.
[0069] Through the processing of steps S4021 to S4023, the data security and analysis efficiency are jointly ensured.
[0070] S403. Obtain the historical shard - encrypted data and local tasks sent by the server end, decrypt the historical shard - encrypted data according to the local tasks to obtain historical local decryption vectors, and send the historical local decryption vectors to the server end. For specific content, refer to step S203.
[0071] Please refer to Figure 5 and Figure 6 , Figure 5 shows the schematic flowchart of the enterprise data encryption method based on federated learning according to the embodiment of the present invention. Figure 6 shows the training schematic diagram of the collaborative computing model in federated learning according to the embodiment of the present invention. This method is applied to the server end, such as the central server in a distributed system. This method may include the following steps: S501. Obtain the current aggregation coefficients of each node end and the enterprise - sensitive data uploaded by the node end, such as the enterprise financial data of the enterprise uploaded by the node end. Shard all the enterprise - sensitive data according to the current aggregation coefficients to obtain a task shard mapping rule, local tasks, and shard - encrypted data corresponding to the local tasks, and issue the local tasks and shard - encrypted data to each node end according to the task shard mapping rule.
[0072] The server side (such as a central server) is connected to several nodes through a secure communication channel. Some or all of these nodes have some collaborative working relationships. Enterprise sensitive data can be pre-stored in each node, or can be obtained by each node from the outside world. No restrictions are imposed on the specific acquisition form of enterprise sensitive data here, as long as it is ensured that the node side can obtain enterprise sensitive data.
[0073] In this embodiment, the server side will allocate a current aggregation coefficient corresponding to the real-time task for each node side according to the current data volume and the current computing power of the node side. The current computing power of the node side specifically includes the current allocable hardware resources of the node side (such as the available CPU resources and available memory resources at the current moment). The current aggregation coefficient reflects the task processing ability of the node side.
[0074] It can be understood that after all the sharded encrypted data is merged according to the task sharding mapping rule, the above-mentioned enterprise sensitive data will be obtained. The task sharding mapping rule includes the local tasks of each node side, the types of local tasks, the computational complexity, and the computing resources.
[0075] S502. Obtain the local calculation results uploaded by each node side, and aggregate the local calculation results of each node side to obtain the global calculation result. Among them, the node side is used to process the sharded encrypted data according to the local task and the local calculation model in the collaborative calculation model to obtain the local calculation result. The collaborative calculation model is jointly composed of the local calculation models of each node side. Each local calculation model has its corresponding local task parameters. The final collaborative calculation model is composed of the local calculation models of each node side and the corresponding local task parameters. The local calculation model is obtained according to the local task.
[0076] The global calculation result can assist enterprise decision-making. For example, if the enterprise sensitive data is enterprise financial data, the corresponding global calculation result can be further used to dynamically monitor cost changes, and accordingly adjust the budget allocation for financial planning to meet strict business requirements.
[0077] In this embodiment, specifically, the collaborative calculation model is trained through the following steps: S601. Obtain the historical homomorphic encryption vectors uploaded by each node side. Among them, the node side is used to perform homomorphic encryption processing on the historical feature vector to obtain the historical homomorphic encryption vector. The historical feature vector is obtained after the node side maps the historical feature information to a vector space of a preset dimension. The historical feature information is obtained after the node side extracts features from the encrypted historical sensitive data.
[0078] Similarly, the historical sensitive data can be pre-stored in each node or obtained by each node from the outside world. No specific restrictions are imposed on the specific acquisition form of the historical sensitive data here, as long as it is ensured that the historical sensitive data can be obtained at the node side.
[0079] S602. Perform weighted aggregation processing on the historical homomorphic encryption vectors obtained from each node side according to the historical aggregation coefficient of the node side to obtain a historical global encryption vector. Shard the historical global encryption vector according to the historical task requirements and the historical aggregation coefficients of each node side to obtain a historical task sharding mapping rule and the historical sharded encryption data of each node side, and distribute the historical sharded encryption data and the local task to each node side according to the historical task sharding mapping rule.
[0080] It can be understood that after all the historical sharded encryption data are merged according to the historical task sharding mapping rule, the above-mentioned complete historical global encryption vector will be obtained, and the historical task sharding mapping rule includes the local tasks of each node side, the types of local tasks, the computational complexity, and the computing resources.
[0081] In this embodiment, the server side will allocate corresponding historical aggregation coefficients for each node side according to the historical data volume and historical computing power of the node side, and the historical computing power of the node side specifically includes the historical allocable hardware resources of the node side (such as the available CPU resources and available memory resources at a certain historical moment).
[0082] Each mutually cooperative node side sends the historical homomorphic encryption vector to the server side through a physically secure channel. Taking the enterprise financial data as an example of sensitive data, assume that the sensitive data includes indicators such as the monthly income and cost of the enterprise and has been homomorphically encrypted into a 1024-dimensional vector, and each node, that is, the node side, holds 100 vectors. The node side performs transmission through the Transport Layer Security (TLS) protocol during the data transmission to the server side to ensure the confidentiality during the data upload process.
[0083] Preferably, after receiving the historical homomorphic encryption vector, the server side will verify the data integrity of the historical homomorphic encryption vector to avoid tampering during the transmission process. Then the server performs weighted aggregation processing through methods such as the ciphertext aggregation algorithm.
[0084] S603. Obtain the historical local decryption vectors uploaded by each node end, perform consistency verification on the historical local decryption vectors, perform distributed training on the historical local decryption vectors that pass the consistency verification in a federated learning manner, and encrypt the gradient data generated during the training process to obtain the historical local model parameters of each local computing model. Among them, the node end is used to decrypt the historical shard-encrypted data according to the local task to obtain the historical local decryption vector.
[0085] For the local decryption vector, the server end uses decryption consistency verification to ensure the accuracy of the vector, verifies the integrity of the local decryption vector through a multi-party signature mechanism, determines the accuracy of the local decryption vector, and obtains a set of verified local decryption vectors. S604. Perform weighted aggregation processing on the historical local model parameters according to the historical aggregation coefficients of the node ends to obtain the historical global model parameters, and determine whether the historical global model parameters meet the global convergence. When it is determined that the historical global model parameters meet the global convergence, decrypt and perform consistency verification on the historical global model parameters to obtain the local task parameters that pass the consistency, and send the local task parameters to the local computing models of each node end.
[0086] The enterprise data encryption method based on federated learning of the present invention encrypts enterprise sensitive data at the node end and extracts the feature information in the data, maps the feature information to a high-dimensional vector space to obtain feature vectors, then performs homomorphic encryption processing on the feature vectors to obtain homomorphic encryption vectors, and then performs weighted aggregation processing on the homomorphic encryption vectors by the server end according to the task processing capabilities of each node end, and performs sharding and task allocation on the weighted aggregation processing result. Decrypt the shard-encrypted data according to the local task to obtain the local decryption vector, and the server end uses the federated learning method to perform distributed training on the local decryption vector to obtain the local task parameters. In this way, through multiple encryptions of enterprise sensitive data, and using homomorphic encryption, homomorphic decryption and secure multi-party computing to achieve data collaboration, and at the same time using homomorphic encryption or secure multi-party computing technology to achieve efficient aggregation and calculation of multi-party encryption vectors, perform collaborative computing tasks under the premise of protecting data privacy, and improve the computing efficiency through task sharding mapping and dynamic adjustment. The finally generated collaborative computing model has passed performance verification and can meet the business requirements of enterprise sensitive data. While protecting data privacy, perform efficient collaborative computing, solve the problems of data sharing and collaborative computing between enterprises, provide a new solution for the secure utilization of enterprise sensitive data, and promote the privacy protection and collaborative computing of enterprise data.
[0087] Please refer to Figure 7 , the collaborative computing model in this method can also be trained through the following steps: S701. Obtain the historical homomorphic encryption vectors uploaded by each node end. For specific content, refer to step S601.
[0088] S7021. Allocate corresponding historical aggregation coefficients for each node end according to the historical data volume and historical computing power of the node end.
[0089] S7022. Perform weighted aggregation processing on the historical homomorphic encryption vectors obtained from each node end according to the historical aggregation coefficients of the node ends to obtain a historical global encryption vector, and perform consistency verification on the historical global encryption vector.
[0090] In this embodiment, the server end performs consistency verification of the historical global encryption vector through a ciphertext verification protocol. The ciphertext verification protocol determines whether there is consistency by comparing metadata of the aggregation result, such as vector dimension or checksum. For example, the ciphertext verification protocol checks whether the aggregated historical global encryption vector is still of a preset dimension to ensure no data loss.
[0091] S7023. Generate a historical task sharding mapping rule according to the historical task requirements and the historical aggregation coefficients of each node end, and shard the historical global encryption vector according to the historical task sharding mapping rule to obtain the historical sharded encrypted data of each node end.
[0092] In this embodiment, the server end extracts the historical task requirements of distributed computing. This process involves the identification of local tasks, the types of local tasks, computational complexity, and computing resources. Assume that the local tasks include financial forecasting tasks and risk analysis tasks. Then, the decision tree algorithm generates a historical task sharding mapping rule according to the obtained historical task requirements. For example, if the financial forecasting task has a higher priority, 60% of the vector data is allocated, and the risk analysis task is allocated 40% of the vector data accordingly. The decision tree algorithm also allocates tasks according to the historical aggregation coefficients of each node end and ensures the accuracy of task allocation based on the load balancing principle during the allocation process. For example, if the historical aggregation coefficient of node A is higher, the task is preferentially allocated to node A.
[0093] S7024. Distribute the historical sharded encrypted data and local tasks to each node end according to the historical task sharding mapping rule. Among them, the node end is used to perform homomorphic encryption processing on the historical sharded encrypted data to obtain a historical encrypted calculation result.
[0094] In this embodiment, the homomorphic encryption process performed at the node end executes distributed matrix operations, that is, the homomorphic encryption process at the node end supports distributed matrix operations, addition operations, and multiplication operations. The node end uses the Paillier homomorphic encryption algorithm for homomorphic encryption processing, and the preset key is 2048 bits to ensure the encryption strength. After encryption, the node end stores the encrypted data locally to avoid the exposure of plaintext. At the same time, each node end only holds a part of the data and cannot restore the complete information alone. Specifically, assuming the data is a 1024-dimensional vector, the protocol generates 4 sub-shares, each 256-dimensional, and at least 3 shares are required to decrypt. This method ensures that even if some node data is leaked. Suppose node A and node B each hold a 512-dimensional encrypted vector. The Paillier homomorphic encryption algorithm stipulates that node A performs an addition operation and node B performs a scalar multiplication to obtain the historical encrypted calculation result.
[0095] S7025. Obtain the historical encrypted calculation results uploaded by each node, perform weighted aggregation processing on the historical encrypted calculation results according to the historical aggregation coefficients of each node end, adjust the local tasks according to the results of the weighted aggregation, and distribute the historical shard encrypted data and the adjusted local tasks to each node end according to the historical task sharding mapping rules.
[0096] During the process of distributing the sharded data and tasks to the node ends, the corresponding historical aggregation coefficients can be dynamically adjusted for each node end according to the changing historical data volume and historical computing power of the node end.
[0097] Similarly, each mutually cooperative node end sends the historical encrypted calculation results to the server end through a physically secure channel. The server end will perform weighted aggregation processing on the historical encrypted calculation results according to the historical aggregation coefficients of each node end, thereby obtaining the preliminary encrypted calculation results of the preset dimension. After that, the server end uses the gradient descent algorithm to optimize the computational complexity for the preliminary encrypted calculation results. Suppose the local task is a financial prediction task, and the initial error of the financial prediction task is 0.1. The gradient descent algorithm iteratively adjusts the parameters to reduce the error of the financial prediction task to the preset precision threshold of 0.01.
[0098] Preferably, after optimizing the local task, the server end checks the validity of the result through an encryption verification protocol to ensure that there is no data tampering.
[0099] Although traditional symmetric encryption algorithms have high security, the encrypted data is difficult to be directly used for complex calculations. Especially when data needs to be mapped to a high-dimensional vector space for operations such as machine learning, the calculation efficiency drops significantly. Moreover, in the data aggregation and calculation in multi-party collaboration, when the encrypted data is aggregated on the central server, traditional encryption methods cannot support efficient calculation operations, which easily leads to waste of computing resources or failure of privacy protection. Through the processing from step S7021 to step S7025, it ensures the efficient processing of enterprise-sensitive data by the collaborative computing model in a distributed environment. The collaborative computing model progresses step by step from data acquisition to task allocation, with strict logic, and optimally guarantees the fairness and real-time nature of task allocation, providing secure and efficient technical support for the collaborative processing of enterprise-sensitive data.
[0100] S703. Obtain the historical local decrypted vectors uploaded by each node end, perform consistency verification on the historical local decrypted vectors, perform distributed training on the historical local decrypted vectors that pass the consistency verification in the way of federated learning, and encrypt the gradient data generated during the training process to obtain the historical local model parameters of each local computing model. For specific content, refer to step S603.
[0101] S704. Perform weighted aggregation processing on the historical local model parameters according to the historical aggregation coefficients of the node ends to obtain the historical global model parameters, and determine whether the historical global model parameters meet the global convergence. In the case of determining that the historical global model parameters meet the global convergence, decrypt and perform consistency verification on the historical global model parameters to obtain the local task parameters that pass the consistency verification, and distribute the local task parameters to the local computing models of each node end. For specific content, refer to step S604.
[0102] Please refer to Figure 8 , in this method, the collaborative computing model can also be trained through the following steps: S801. Obtain the historical homomorphic encrypted vectors uploaded by each node end. For specific content, refer to step S601.
[0103] S802. Perform weighted aggregation processing on the historical homomorphic encrypted vectors obtained from each node end according to the historical aggregation coefficients of the node ends to obtain the historical global encrypted vector, slice the historical global encrypted vector according to the historical task requirements and the historical aggregation coefficients of each node end to obtain the historical task slicing mapping rules and the historical sliced encrypted data of each node end, and distribute the historical sliced encrypted data and local tasks to each node end according to the historical task slicing mapping rules. For specific content, refer to step S602.
[0104] S8031. Obtain the historical local decrypted vectors uploaded by each node end, and perform consistency verification on the historical local decrypted vectors.
[0105] Since each node processes its own historical shard encrypted data, it is necessary to ensure data consistency, security, and decryption accuracy. In this embodiment, the consistency verification protocol checks the data integrity of the historical partial decryption vector through a hash function. Assume that the data is split into 4 shards, each shard is 256-dimensional data, stored at different node ends, and the server pre-stores the SHA-256 hash values of each shard. In this way, when the node end uploads the historical partial decryption vector to the server end, the server end recalculates the hash value and compares it with the pre-stored value. If the comparison passes, it is confirmed that the shard has not been tampered with.
[0106] For example, the hash value of a certain shard is abc123, and after comparison by the server end, they are consistent, and the consistency verification passes. Through this setting, it is ensured that the data remains complete during transmission and the risk of data corruption is reduced.
[0107] S8032. Perform data signature verification on the historical partial decryption vector that passes the consistency check. It can be understood that the node end is used to add the corresponding digital signature to the historical partial decryption vector.
[0108] In this embodiment, the multi-party signature verification algorithm verifies the reliability of the shard data source. The node end can use the ECDSA algorithm to generate a digital signature for the shard. Assume that the signature of node B is incomplete due to a network interruption. In this way, the server end refuses to process this shard. This setting ensures the credibility of the data source and prevents unauthorized nodes from interfering.
[0109] Preferably, in order to improve the reliability of data processing, the server end will also perform dimension verification on the historical partial decryption vector that passes the data signature verification. Assume that node A returns a 128-dimensional vector, and node B returns a 127-dimensional vector due to an error. The server end marks the vector of node B as invalid and only adopts the result of node A. This setting avoids the influence of incorrect vectors on subsequent processing and ensures data accuracy.
[0110] S8033. Perform distributed training on the historical partial decryption vector that passes the data signature verification in a federated learning manner, and encrypt the gradient data generated during the training process to obtain the historical partial model parameters of each local computing model.
[0111] In this embodiment, the federated learning algorithm performs distributed training to train each local computing model. Assume that node D uses a 512-dimensional vector to train an expenditure prediction model and generates gradient data. Federated learning allows nodes to collaboratively train a global model while keeping the data local.
[0112] Preferably, the differential privacy mechanism is adopted to protect the gradient data, encrypt the gradient data generated during the training process, add Gaussian noise to the gradient and then encrypt and upload it. For example, node E sets the noise standard deviation to 0.01, encrypts the gradient and then uploads it to ensure the privacy of the gradient data and reduce the leakage risk.
[0113] S8034. Perform gradient detection on the historical local model parameters and delete the historical local model parameters with abnormal gradient detection.
[0114] In this embodiment, the Byzantine fault tolerance algorithm is used to detect abnormal historical local model parameters. If the gradient of a certain node deviates from the preset threshold, the Byzantine fault tolerance algorithm can mark the historical local model parameters of that node as abnormal. For example, if the gradient of node F deviates from the mean by 3 standard deviations, the server side can determine it as abnormal using the Byzantine fault tolerance algorithm, thereby improving the system robustness. Moreover, by performing gradient detection on the historical local model parameters and deleting the historical local model parameters with abnormal gradient detection, only the gradients of normal nodes can be collected to ensure that subsequent aggregation is not interfered by faulty nodes.
[0115] S804. Perform weighted aggregation processing on the historical local model parameters according to the historical aggregation coefficients of the node ends to obtain the historical global model parameters, and determine whether the historical global model parameters meet the global convergence. When it is determined that the historical global model parameters meet the global convergence, decrypt and perform consistency verification on the historical global model parameters to obtain the local task parameters that pass the consistency verification, and distribute the local task parameters to the local computing models of each node end. For specific content, refer to step S604.
[0116] The collaborative computing model in this method can also be trained through the following steps: S901. Obtain the historical homomorphic encryption vectors uploaded by each node end. For specific content, refer to step S601.
[0117] S902. Perform weighted aggregation processing on the historical homomorphic encryption vectors obtained from each node end according to the historical aggregation coefficients of the node ends to obtain the historical global encryption vector. Shard the historical global encryption vector according to the historical task requirements and the historical aggregation coefficients of each node end to obtain the historical task sharding mapping rule and the historical sharded encryption data of each node end, and distribute the historical sharded encryption data and local tasks to each node end according to the historical task sharding mapping rule. For specific content, refer to step S602.
[0118] S903. Obtain the historical local decryption vectors uploaded by each node end, perform consistency verification on the historical local decryption vectors, perform distributed training on the historical local decryption vectors that pass the consistency verification in a federated learning manner, and encrypt the gradient data generated during the training process to obtain the historical local model parameters of each local computing model. For specific content, refer to step S603.
[0119] S9041. Perform weighted aggregation processing on the historical local model parameters according to the historical aggregation coefficients of the node ends. It should be noted that the server side will only perform weighted aggregation processing on the gradients of normal nodes by the server according to the historical aggregation coefficients to generate global model parameters.
[0120] S9042. Determine whether the historical global model parameters meet global convergence. When it is determined that the historical global model parameters meet global convergence, perform homomorphic decryption on the historical global model parameters to obtain local task parameters.
[0121] In this embodiment, the server determines whether the aggregated historical global model parameters meet the requirements through a preset convergence threshold, such as 95% accuracy, to improve parameter stability; homomorphic decryption is used to decrypt the historical global model parameters.
[0122] Preferably, the server side adopts the Paillier homomorphic decryption scheme, uses a preset 256-bit decryption key to perform decryption operations on the encrypted parameters, generates a preliminary set of plaintext parameters, and the decryption process needs to verify that the parameter dimensions are consistent. For example, ensure that all vectors are 512-dimensional to avoid format errors.
[0123] S9043. Perform consistency verification on the local task parameters to obtain local task parameters that pass the consistency verification, and send the local task parameters to the local computing models of each node end.
[0124] The server side pre-stores the SHA-256 hash values of each parameter. After obtaining the local task parameters in this way, the server side recalculates the hash values and compares them with the pre-stored values. If the comparison passes, it is confirmed that the data has not been tampered with.
[0125] It should be noted that after obtaining the local task parameters of each local computing model, the server side will also use the decision tree algorithm to classify the local task parameters to generate the parameters of the final collaborative computing model.
[0126] S9044. Determine the model performance of the collaborative computing model. That is, the server side will also use a preset performance verification algorithm to evaluate the local task parameters of each local computing model in the collaborative computing model, obtain a performance evaluation result, perform a consistency verification on the performance evaluation result, and stop the model training to obtain the final global model parameters when it is determined that the performance evaluation result that passes the consistency verification meets the preset business requirements.
[0127] If the performance evaluation result indicates that it meets the preset business requirements, such as covering 80% of the cost prediction scenarios, the server can stop training the model, ensuring the efficiency and reliability of parameter generation.
[0128] The consistency verification method refers to that described in step S903 and will not be elaborated here.
[0129] The system provided by the embodiments of the present invention will be described below. The system described below can be correspondingly referred to the method described above.
[0130] Please refer to Figure 9 , Figure 9 which shows a schematic structural diagram of an enterprise data encryption system based on federated learning according to an embodiment of the present invention. The system is applied to the node side, such as each distributed node in a distributed system. The system may include: A first data acquisition module 10, configured to acquire enterprise sensitive data, such as enterprise financial data of an enterprise.
[0131] The server side (such as a central server) is connected to several nodes through a secure communication channel. Some or all of these nodes have some collaborative working relationships. The enterprise sensitive data may be stored in each node in advance, or may be obtained by each node from the outside. No specific limitation is imposed on the specific acquisition form of the enterprise sensitive data here, as long as it is ensured that the node side can acquire the enterprise sensitive data.
[0132] A first data processing module 20, configured to send the enterprise sensitive data to the server side, obtain the shard encrypted data and local tasks issued by the server side, process the shard encrypted data according to the local tasks and the local computing model in the collaborative computing model to obtain a local computing result, and send the local computing result to the server side. Among them, the server side aggregates the local computing results of each node side to obtain a global computing result. The collaborative computing model is jointly composed of the local computing models of each node side, and each local computing model has its corresponding local task parameters.
[0133] The global computing result can assist enterprise decision-making. For example, if the enterprise sensitive data is enterprise financial data, the corresponding global computing result can be further used for dynamically monitoring cost changes, and accordingly adjusting the budget allocation for financial planning to meet strict business requirements.
[0134] Please refer to Figure 10 , Figure 10 which shows a schematic structural diagram of an enterprise data encryption system based on federated learning according to an embodiment of the present invention. This system is applied to the server side, such as a central server in a distributed system. The system may include: A second data acquisition module 30, configured to acquire the current aggregation coefficient of each node end and the enterprise sensitive data uploaded by the node end, slice all the enterprise sensitive data according to the current aggregation coefficient to obtain a task slice mapping rule, local tasks, and slice encryption data corresponding to the local tasks, and send the local tasks and the slice encryption data to each node end according to the task slice mapping rule; the server side allocates the current aggregation coefficient to each node end according to the current data volume and the current computing power of the node end, and the current computing power of the node end is the current allocable hardware resources of the node end.
[0135] The server side (such as a central server) is connected to several nodes through a secure communication channel. Some or all of these nodes have some cooperative working relationships. The enterprise sensitive data can be stored in each node in advance, or can be obtained by each node from the outside. No specific limitation is imposed on the specific acquisition form of the enterprise sensitive data here, as long as it is ensured that the node end can obtain the enterprise sensitive data.
[0136] A second data processing module 40, configured to acquire the local calculation results uploaded by each node end, and aggregate the local calculation results of each node end to obtain a global calculation result; the node end is configured to process the slice encryption data according to the local tasks and the local calculation model in the cooperative calculation model to obtain a local calculation result, and the cooperative calculation model is jointly composed of the local calculation models of each node end, and each local calculation model has corresponding local task parameters The global calculation result can assist enterprise decision-making. For example, if the enterprise sensitive data is enterprise financial data, the corresponding global calculation result can be further used for dynamically monitoring cost changes, and accordingly adjusting budget allocation for financial planning to meet strict business requirements.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An enterprise data encryption method based on federated learning, characterized in that: The method is applied to the node side, and the method includes: Obtain enterprise sensitive data; Send the enterprise sensitive data to the server side, obtain the sharded encrypted data and local tasks issued by the server side, process the sharded encrypted data according to the local tasks and the local computing model in the collaborative computing model to obtain local computing results, and send the local computing results to the server side; The server side aggregates the local computing results of each node side to obtain the global computing result. The collaborative computing model is jointly composed of the local computing models of each node side, and each local computing model has corresponding local task parameters; The collaborative computing model is obtained through the following steps: Obtain historical sensitive data, encrypt the historical sensitive data to obtain the historical encrypted data stream of the node side, extract historical feature information from the encrypted data stream, and map the historical feature information to a vector space of a preset dimension to obtain the historical feature vector of the node side; Perform homomorphic encryption processing on the historical feature vector to obtain a historical homomorphic encrypted vector, and upload the historical homomorphic encrypted vector to the server side; The server side is used to perform weighted aggregation processing on the historical homomorphic encrypted vectors obtained from each node side according to the historical aggregation coefficient of the node side to obtain a historical global encrypted vector, slice the historical global encrypted vector according to the historical task requirements and the historical aggregation coefficients of each node side to obtain a historical task slicing mapping rule and the historical sharded encrypted data of each node side, and distribute the historical sharded encrypted data and local tasks to each node side according to the historical task slicing mapping rule; Obtain the historical sharded encrypted data and local tasks sent by the server side, decrypt the historical sharded encrypted data according to the local tasks to obtain a historical local decrypted vector, and send the historical local decrypted vector to the server side; The server side is used to perform distributed training on the historical local decrypted vectors in the manner of federated learning to obtain local task parameters.
2. The enterprise data encryption method based on federated learning according to claim 1, wherein: The obtaining of historical sensitive data, encrypting the historical sensitive data to obtain the historical encrypted data stream of the node side, extracting historical feature information from the encrypted data stream, and mapping the historical feature information to a vector space of a preset dimension to obtain the historical feature vector of the node side specifically includes: Obtain the historical sensitive data of each node side, and encrypt all the historical sensitive data to obtain the historical encrypted data streams of each node; Perform feature analysis on the historical encrypted data streams of each node side, and extract the historical feature information of each node from the historical encrypted data stream; Perform feature compression processing on the historical feature information of each node side, reduce the dimension of the historical feature information to a preset dimension, and map the dimension-reduced historical feature information to a vector space of a preset dimension to obtain the historical feature vectors of each node side; Determine whether the historical feature vector reaches the preset dimension. If it is determined that it does not reach, perform dimension expansion on the historical feature vector so that the historical feature vector reaches the preset dimension; Determine the Euclidean distance between each historical feature vector in each node end, obtain the first distance distribution map of each node according to the Euclidean distance, and determine the encryption effectiveness of the historical feature vector of each node end according to the first distance distribution map.
3. The enterprise data encryption method based on federated learning according to claim 2, wherein: The homomorphic encryption process for the historical feature vector is performed to obtain a historical homomorphic encryption vector, and the historical homomorphic encryption vector is uploaded to the server end. Specifically, it includes: Each node end negotiates to obtain a homomorphic encryption key, uses the homomorphic encryption key to perform homomorphic encryption processing on the historical feature vector, and obtains the corresponding historical homomorphic encryption vector of each node end according to the secure multi-party computation protocol; Determine whether the historical homomorphic encryption vector reaches the preset dimension. In the case of determining that it does not reach, perform dimension expansion on the historical homomorphic encryption vector so that the historical feature vector reaches the preset dimension; Determine the Euclidean distance between each historical homomorphic encryption vector in each node end, obtain the second first distance distribution map of each node end according to the Euclidean distance, and determine the historical homomorphic encryption vector of the historical feature vector of each node end according to the second distance distribution map, and upload the historical homomorphic encryption vector to the server end.
4. The enterprise data encryption method based on federated learning according to claim 1, characterized in that: The local task parameters are obtained through the following steps: Obtain the local task parameters of the local computing model sent by the server end; the server end is used to perform consistency verification on the historical local decryption vectors obtained from each node end, perform distributed training on the historical local decryption vectors that pass the consistency verification in a federated learning manner, and perform encryption processing on the gradient data generated during the training process to obtain the historical local model parameters of the node end. Perform weighted aggregation processing on the historical local model parameters according to the historical aggregation coefficient of the node end to obtain the historical global model parameters, and determine whether the historical global model parameters meet the global convergence. In the case of determining that the historical global model parameters meet the global convergence, perform decryption and consistency verification on the historical global model parameters to obtain the local task parameters that pass the consistency.
5. An enterprise data encryption method based on federated learning, characterized in that: The method is applied to the server end. The method includes: Obtain the current aggregation coefficient of each node end and the enterprise sensitive data uploaded by the node end, slice all the enterprise sensitive data according to the current aggregation coefficient to obtain a task slice mapping rule, local tasks, and the slice encrypted data corresponding to the local tasks, and issue the local tasks and the slice encrypted data to each node end according to the task slice mapping rule; the server end allocates the current aggregation coefficient for each node end according to the current data volume and the current computing power of the node end, and the current computing power of the node end is the current available hardware resources of the node end; Obtain the local computing results uploaded by each node end, and aggregate the local computing results of each node end to obtain the global computing result; the node end is used to process the slice encrypted data according to the local task and the local computing model in the collaborative computing model to obtain the local computing result, and the collaborative computing model is jointly composed of the local computing models of each node end, and each local computing model has corresponding local task parameters.
6. The enterprise data encryption method based on federated learning according to claim 5, characterized in that: The collaborative computing model is trained through the following steps: Obtain the historical homomorphic encrypted vectors uploaded by each node end; the node end is used to perform homomorphic encryption processing on the historical feature vectors to obtain historical homomorphic encrypted vectors. The historical feature vectors are obtained after the node end maps the historical feature information to a vector space of a preset dimension, and the historical feature information is obtained after the node end extracts features from the encrypted historical sensitive data; Perform weighted aggregation processing on the historical homomorphic encrypted vectors obtained from each node end according to the historical aggregation coefficients of the node ends to obtain a historical global encrypted vector. Shard the historical global encrypted vector according to the historical task requirements and the historical aggregation coefficients of each node end to obtain a historical task sharding mapping rule and the historical sharded encrypted data of each node end, and distribute the historical sharded encrypted data and local tasks to each node end according to the historical task sharding mapping rule; Obtain the historical local decrypted vectors uploaded by each node end, perform consistency verification on the historical local decrypted vectors, perform distributed training on the historical local decrypted vectors that pass the consistency verification in a federated learning manner, and encrypt the gradient data generated during the training process to obtain the historical local model parameters of each local computing model; the node end is used to decrypt the historical sharded encrypted data according to the local task to obtain the historical local decrypted vectors; Perform weighted aggregation processing on the historical local model parameters according to the historical aggregation coefficients of the node ends to obtain historical global model parameters, and determine whether the historical global model parameters meet the global convergence. When it is determined that the historical global model parameters meet the global convergence, decrypt and perform consistency verification on the historical global model parameters to obtain local task parameters that pass the consistency, and distribute the local task parameters to the local computing models of each node end.
7. The enterprise data encryption method based on federated learning according to claim 6, wherein: The step of performing weighted aggregation processing on the historical homomorphic encrypted vectors obtained from each node end according to the historical aggregation coefficients of the node ends to obtain a historical global encrypted vector, sharding the historical global encrypted vector according to the historical task requirements and the historical aggregation coefficients of each node end to obtain a historical task sharding mapping rule and the historical sharded encrypted data of each node end, and distributing the historical sharded encrypted data and local tasks to each node end according to the historical task sharding mapping rule specifically includes: Allocate corresponding historical aggregation coefficients for each node end according to the historical data volume and historical computing power of the node end; Perform weighted aggregation processing on the historical homomorphic encrypted vectors obtained from each node end according to the historical aggregation coefficients of the node ends to obtain a historical global encrypted vector, and perform consistency verification on the historical global encrypted vector; Generate a historical task sharding mapping rule according to the historical task requirements and the historical aggregation coefficients of each node end and using a decision tree algorithm, and shard the historical global encrypted vector according to the historical task sharding mapping rule to obtain the historical sharded encrypted data of each node end; According to the historical task sharding mapping rule, distribute the historical sharded encrypted data and local tasks to each node end; the node end is used to perform homomorphic encryption processing on the historical sharded encrypted data to obtain a historical encrypted calculation result; Obtain the historical encrypted calculation results uploaded by each node, perform weighted aggregation processing on the historical encrypted calculation results according to the historical aggregation coefficients of each node, adjust the local tasks according to the results of the weighted aggregation, and distribute the historical shard encrypted data and the adjusted local tasks to each node according to the historical task shard mapping rules.
8. The enterprise data encryption method based on federated learning according to claim 6, wherein: Obtain the historical local decryption vectors uploaded by each node, perform consistency verification on the historical local decryption vectors, perform distributed training on the historical local decryption vectors that pass the consistency verification in a federated learning manner, and encrypt the gradient data generated during the training process to obtain the historical local model parameters of each local calculation model, specifically including: Obtain the historical local decryption vectors uploaded by each node, and perform consistency verification on the historical local decryption vectors; Perform digital signature verification on the historical local decryption vectors that pass the consistency verification; the node is used to add corresponding digital signatures to the historical local decryption vectors; Perform distributed training on the historical local decryption vectors that pass the digital signature verification in a federated learning manner, and encrypt the gradient data generated during the training process to obtain the historical local model parameters of each local calculation model; Perform gradient detection on the historical local model parameters, and delete the historical local model parameters with abnormal gradient detection.
9. An enterprise data encryption system based on federated learning, characterized in that: The system is applied to the node, and the system includes: The first data acquisition module is used to acquire enterprise sensitive data; The second data processing module is used to send the enterprise sensitive data to the server, obtain the shard encrypted data and local tasks sent by the server, process the shard encrypted data according to the local tasks and the local calculation model in the collaborative calculation model to obtain local calculation results, and send the local calculation results to the server; the server aggregates the local calculation results of each node to obtain the global calculation result, and the collaborative calculation model is jointly composed of the local calculation models of each node, and each local calculation model has corresponding local task parameters; The collaborative calculation model is trained through the following steps: Obtain historical sensitive data, encrypt the historical sensitive data to obtain the historical encrypted data stream of the node, extract historical feature information from the encrypted data stream, and map the historical feature information to a vector space of a preset dimension to obtain the historical feature vector of the node; Perform homomorphic encryption processing on the historical feature vector to obtain a historical homomorphic encryption vector, and upload the historical homomorphic encryption vector to the server; the server is used to perform weighted aggregation processing on the historical homomorphic encryption vectors obtained from each node according to the historical aggregation coefficients of the nodes to obtain a historical global encryption vector, shard the historical global encryption vector according to the historical task requirements and the historical aggregation coefficients of each node to obtain the historical task shard mapping rules and the historical shard encrypted data of each node, and distribute the historical shard encrypted data and local tasks to each node according to the historical task shard mapping rules; Obtain the historical shard encrypted data and local tasks sent by the server side, decrypt the historical shard encrypted data according to the local tasks to obtain the historical local decryption vectors, and send the historical local decryption vectors to the server side; the server side is used to perform distributed training on the historical local decryption vectors in the way of federated learning to obtain local task parameters.
10. An enterprise data encryption system based on federated learning, characterized in that: The system is applied to the server side, and the system includes: A second data acquisition module, configured to acquire the current aggregation coefficients of each node side and the enterprise sensitive data uploaded by the node side, shard all the enterprise sensitive data according to the current aggregation coefficients to obtain a task shard mapping rule, local tasks, and shard encrypted data corresponding to the local tasks, and send the local tasks and the shard encrypted data to each node side according to the task shard mapping rule; the server side allocates the current aggregation coefficient for each node side according to the current data volume and the current computing power of the node side, and the current computing power of the node side is the currently allocable hardware resources of the node side; A second data processing module, configured to acquire the local calculation results uploaded by each node side, and aggregate the local calculation results of each node side to obtain a global calculation result; the node side is used to process the shard encrypted data according to the local tasks and the local calculation model in the collaborative calculation model to obtain a local calculation result, and the collaborative calculation model is jointly composed of the local calculation models of each node side, and each local calculation model has corresponding local task parameters.