Data processing method, device and equipment, readable storage medium and program product
By reordering the sample data after iterative training in the longitudinal federated deep learning model, the overfitting problem caused by fixed order training is solved, and the generalization and training effect of the model are improved.
Patent Information
- Application Number
- CN202310270267.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2024-09-20
AI Technical Summary
The existing longitudinal federated deep learning model is trained in a fixed order after the sample data is aligned, which leads to a reduction in the selectivity of the gradient optimization direction, prone to overfitting, and affects the training effect of the model.
By reordering the sample data according to the preset sorting strategy after each iteration of training, the randomness of the data arrangement is increased, and the feature training module and the rearrangement module are used to generate and transmit index sequence number information to ensure that the sample data of the participants are aligned and avoid noise. Generation of data.
It improves the generalization and training effect of the federated learning model, reduces the risk of over-fitting, and improves the applicability of the model.
Smart Images

Figure CN118674060A
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a data processing method, device, equipment, readable storage medium and program product. Background Art
[0002] Federated learning uses a central server as the central node and exchanges data information with multiple local servers participating in training to update and iterate the artificial intelligence model. Federated learning can establish a virtual federated learning model through data exchange under an encryption mechanism, without leaving the domain of each local server and violating data privacy regulations, so as to make full use of multi-party data to train deep learning models, thereby improving the model effect while ensuring the security of data exchange. Among them, the vertical federated deep learning model can expand the data feature dimension or obtain data label information by combining sample data from multiple local servers, so as to train a model with higher output accuracy.
[0003] The inventors of the present application discovered during the research and practice that in the prior art, before training the vertical federated deep learning model, the sample data of different participants (local servers) can be aligned to obtain a sample data set, and the vertical federated deep learning model can be trained with the sample data set. However, the sample data set generated after the sample data alignment is in a fixed order, that is, the sample data of different participants are arranged in a fixed order. When the vertical federated deep learning model is trained based on the sample data set in this fixed order, the selectivity of the gradient optimization direction will be limited, resulting in a smaller convergence point selection space for model training, which will cause the vertical federated deep learning model to overfit, affecting the training effect of the model. Summary of the invention
[0004] The embodiments of the present application provide a data processing method, apparatus, device, readable storage medium and program product, which can improve the generalization of federated learning, enhance the training effect of the federated learning machine model, and have high applicability.
[0005] In a first aspect, the present application provides a data processing method, the method comprising:
[0006] The first participant obtains a plurality of first sample data sorted in a first arrangement order, and iteratively trains a first feature network of a federated learning machine model based on the plurality of first sample data to obtain first network feature data output by the iterative training of the first feature network;
[0007] The first participant obtains the second network feature data returned by the second participant after iteratively training the second feature network of the federated learning machine model based on the plurality of second sample data sorted in the first arrangement order, so as to iteratively train the top-level feature network of the federated learning machine model based on the first network feature data and the second network feature data;
[0008] The first participant generates index sequence number information of each first sample data in the plurality of first sample data based on a preset sorting strategy, re-sorts the plurality of first sample data according to the index sequence number information of each first sample data, and sends the sorting strategy and the index sequence number information of each re-sorted first sample data to the second participant, triggering the second participant to re-sort the plurality of second sample data based on the sorting strategy and the index sequence number information of each re-sorted first sample data;
[0009] The first participant iteratively trains the first feature network based on the reordered multiple first sample data to obtain third network feature data output by the iterative training of the first feature network, and obtains fourth network feature data returned by the second participant after iterative training of the second feature network based on the reordered multiple second sample data, so as to iteratively train the top-level feature network based on the third network feature data and the fourth network feature data.
[0010] In a possible implementation, the preset sorting strategy is sorting according to data granularity, the first participant generates index sequence number information of each first sample data in the multiple first sample data based on the preset sorting strategy, and re-sorts the multiple first sample data according to the index sequence number information of each first sample data, including:
[0011] The first participant determines the sorting position of each first sample data in the plurality of first sample data according to the data granularity, and generates first index sequence number information of each first sample data based on the sorting position of each first sample data in the plurality of first sample data, wherein one first index sequence number information is used to index one first sample data;
[0012] The first participant randomly scatters the plurality of first index number information of the plurality of first sample data, and reorders the plurality of first sample data based on the arrangement order of the first index number information of each of the first sample data after random scattering.
[0013] In a possible implementation, the preset sorting strategy is sorting according to data block granularity, the first participant generates index sequence number information of each first sample data in the plurality of first sample data based on the preset sorting strategy, and re-sorts the plurality of first sample data according to the index sequence number information of each first sample data, including:
[0014] The first participant divides the plurality of first sample data into a plurality of first sample data blocks according to data block granularity based on the sorting position of each first sample data in the plurality of first sample data, wherein a first sample data block includes at least one first sample data;
[0015] The first participant generates second index sequence number information of each first sample data block based on the sorting position of each first sample data block in the plurality of first sample data blocks to obtain index sequence number information of each first sample data, wherein one second index sequence number information is used to index each first sample data in one first sample data block;
[0016] The first participant randomly scatters the plurality of second index sequence number information of the plurality of first sample data blocks, and reorders the plurality of first sample data blocks based on the arrangement order of the second index sequence number information of the randomly scattered first sample data blocks, so as to reorder the plurality of first sample data.
[0017] In a possible implementation, the preset sorting strategy is to sort according to the granularity of the data file, the first participant generates index sequence number information of each first sample data based on the preset sorting strategy, and re-sorts the plurality of first sample data according to the index sequence number information of each first sample data, including:
[0018] The first participant generates a plurality of first sample characteristic data files arranged in sequence according to the data file granularity based on the sorting position of each first sample data in the plurality of first sample data, wherein one first sample characteristic data file includes at least one first sample data;
[0019] The first participant generates third index serial number information of each first sample feature data file based on the sorting position of each first sample feature data file in the plurality of first sample feature data files, wherein one third index serial number information is used to index each first sample data in one first sample feature data file;
[0020] The first participant randomly scatters the multiple third index serial number information of the multiple first sample feature data files, and reorders the multiple first sample feature data files based on the arrangement order of the third index serial number information of the randomly scattered first sample feature data files, so as to reorder the multiple first sample data.
[0021] In a possible implementation, the method further includes:
[0022] Inputting the first network feature data and the second network feature data into the top-level feature network, and performing feature fusion and learning on the first network feature data and the second network feature data through the top-level feature network to implement iterative training of the top-level feature network;
[0023] The third network feature data and the fourth network feature data are input into the top-level feature network, and the third network feature data and the fourth network feature data are feature-fused and learned through the top-level feature network to implement iterative training of the top-level feature network.
[0024] In a second aspect, the present application also provides a data processing method, the method comprising:
[0025] The second participant obtains a plurality of second sample data sorted in the first arrangement order, iteratively trains a second feature network of the federated learning machine model based on the plurality of second sample data, and sends the second network feature data output by the iterative training of the second feature network to the first participant, wherein the first arrangement order is the arrangement order of the plurality of first sample data used by the first participant to iteratively train the first feature network of the federated learning machine model;
[0026] The second participant obtains the sorting strategy sent by the first participant and the index sequence number information of each first sample data in the plurality of first sample data, generates the index sequence number information of the plurality of second sample data based on the sorting strategy, and re-sorts the plurality of second sample data according to the index sequence number information of each first sample data and the index sequence number information of the plurality of second sample data;
[0027] The second participant iteratively trains the second feature network pair based on the reordered plurality of second sample data, and sends fourth network feature data output by the iterative training of the second feature network to the first participant.
[0028] In a possible implementation, the sorting strategy is to sort according to data granularity; the index sequence number information of the plurality of second sample data is generated based on the sorting strategy, and the plurality of second sample data are re-sorted according to the index sequence number information of each of the first sample data and the index sequence number information of the plurality of second sample data, including:
[0029] Determine the sorting position of each second sample data in the plurality of second sample data according to the data granularity, and generate first index sequence number information of each second sample data based on the sorting position of each second sample data in the plurality of second sample data, wherein one first index sequence number information is used to index one second sample data;
[0030] The first index sequence number information of each of the second sample data is aligned with the index sequence number information of each of the first sample data to achieve reordering of the plurality of second sample data.
[0031] In a possible implementation, the sorting strategy is to sort according to the data block granularity, and the index sequence number information of each of the first sample data is the index sequence number information of the data block to which the each of the first sample data belongs; the index sequence number information of the plurality of second sample data is generated based on the sorting strategy, and the plurality of second sample data are re-sorted according to the index sequence number information of each of the first sample data and the index sequence number information of the plurality of second sample data, including:
[0032] Dividing the plurality of second sample data into a plurality of second sample data blocks according to data block granularity based on the sorting position of each second sample data in the plurality of second sample data, wherein a second sample data block includes at least one second sample data;
[0033] generating second index sequence number information of each second sample data block based on the sorting position of each second sample data block in the plurality of second sample data blocks to obtain index sequence number information of each second sample data, wherein one second index sequence number information is used to index each second sample data in one first sample data block;
[0034] The second index sequence number information of each of the second sample data blocks is aligned with the index sequence number information of the data block to which each of the first sample data belongs, so as to reorder the plurality of second sample data.
[0035] In a possible implementation, the sorting strategy is to sort according to the granularity of the data file, and the index sequence number information of each of the first sample data is the index sequence number information of the data file to which the each of the first sample data belongs; the index sequence number information of the plurality of second sample data is generated based on the sorting strategy, and the plurality of second sample data are re-sorted according to the index sequence number information of each of the first sample data and the index sequence number information of the plurality of second sample data, including:
[0036] Generate a plurality of second sample characteristic data files arranged in sequence according to the data file granularity based on the sorting position of each second sample data in the plurality of second sample data, wherein one second sample characteristic data file includes at least one second sample data;
[0037] Generating third index serial number information of each second sample feature data file based on the sorting position of each second sample feature data file in the plurality of second sample feature data files, wherein one third index serial number information is used to index each second sample data in one second sample feature data file;
[0038] The third index number information of each of the second sample characteristic data files is aligned with the index number information of the data file to which each of the first sample data belongs, so as to reorder the plurality of second sample data.
[0039] In a third aspect, the present application further provides a data processing device, the device comprising:
[0040] A feature training module, used to obtain a plurality of first sample data sorted in a first arrangement order, and iteratively train a first feature network of a federated learning machine model based on the plurality of first sample data to obtain first network feature data output by iterative training of the first feature network;
[0041] A top-level training module, used to obtain second network feature data returned after the second participant iteratively trains the second feature network of the federated learning machine model based on the plurality of second sample data sorted in the first arrangement order, so as to iteratively train the top-level feature network of the federated learning machine model based on the first network feature data and the second network feature data;
[0042] a reordering module, configured to generate index sequence number information of each first sample data in the plurality of first sample data based on a preset sorting strategy, reorder the plurality of first sample data according to the index sequence number information of each first sample data, and send the sorting strategy and the index sequence number information of each reordered first sample data to the second participant, triggering the second participant to reorder the plurality of second sample data based on the sorting strategy and the index sequence number information of each reordered first sample data;
[0043] Among them, the above feature training module is also used for:
[0044] The first feature network is iteratively trained based on the reordered plurality of first sample data to obtain third network feature data output by the iterative training of the first feature network.
[0045] Among them, the above top-level training module is also used for:
[0046] The fourth network feature data returned by the second participant after iterative training of the second feature network according to the reordered plurality of second sample data is obtained, so as to iteratively train the top-level feature network based on the third network feature data and the fourth network feature data.
[0047] Wherein, the above rearrangement module includes:
[0048] an index determination unit, configured to determine, according to data granularity, a sorting position of each first sample data in the plurality of first sample data, and generate first index sequence number information of each first sample data based on the sorting position of each first sample data in the plurality of first sample data, wherein one first index sequence number information is used to index one first sample data;
[0049] The rearrangement unit is used to randomly scatter the plurality of first index sequence number information of the plurality of first sample data, and reorder the plurality of first sample data based on the arrangement order of the first index sequence number information of each of the first sample data after random scattering.
[0050] The index determination unit is further used for:
[0051] Based on the sorting position of each first sample data in the multiple first sample data, the multiple first sample data are divided into multiple first sample data blocks according to the data block granularity, and one first sample data block includes at least one first sample data; based on the sorting position of each first sample data block in the multiple first sample data blocks, second index sequence number information of each first sample data block is generated to obtain index sequence number information of each first sample data, wherein one second index sequence number information is used to index each first sample data in one first sample data block.
[0052] Wherein, the above rearrangement unit is also used for:
[0053] The plurality of second index sequence number information of the plurality of first sample data blocks are randomly scattered, and the plurality of first sample data blocks are reordered based on the arrangement order of the second index sequence number information of the first sample data blocks after the random scattering, so as to achieve the reordering of the plurality of first sample data.
[0054] The index determination unit is further used for:
[0055] Based on the sorting position of each first sample data in the plurality of first sample data, a plurality of first sample feature data files are generated in sequence according to the data file granularity, wherein one first sample feature data file includes at least one first sample data; based on the sorting position of each first sample feature data file in the plurality of first sample feature data files, third index sequence number information is generated for indexing each first sample data in one first sample feature data file;
[0056] Wherein, the above rearrangement unit is also used for:
[0057] The multiple third index serial number information of the above-mentioned multiple first sample feature data files are randomly scattered, and the above-mentioned multiple first sample feature data files are reordered based on the arrangement order of the third index serial number information of each of the above-mentioned randomly scattered first sample feature data files, so as to achieve reordering of the above-mentioned multiple first sample data.
[0058] Among them, the above top-level training module is also used for:
[0059] The first network feature data and the second network feature data are input into the top-level feature network, and the first network feature data and the second network feature data are feature-fused and learned through the top-level feature network to implement iterative training of the top-level feature network.
[0060] Among them, the above top-level training module is also used for:
[0061] The third network feature data and the fourth network feature data are input into the top-level feature network, and the third network feature data and the fourth network feature data are feature-fused and learned through the top-level feature network to implement iterative training of the top-level feature network.
[0062] In a fourth aspect, the present application further provides a data processing device, the device comprising:
[0063] A feature training module, used to obtain a plurality of second sample data sorted according to a first arrangement order, iteratively train a second feature network of the federated learning machine model based on the plurality of second sample data, and send the second network feature data output by the iterative training of the second feature network to the first participant, wherein the first arrangement order is the arrangement order of the plurality of first sample data used by the first participant to iteratively train the first feature network of the federated learning machine model;
[0064] a reordering module, configured to obtain the sorting strategy sent by the first participant and the index sequence number information of each first sample data in the plurality of first sample data, generate the index sequence number information of the plurality of second sample data based on the sorting strategy, and reorder the plurality of second sample data according to the index sequence number information of each first sample data and the index sequence number information of the plurality of second sample data;
[0065] Among them, the above feature training module is also used for:
[0066] The feature network pair is iteratively trained based on the reordered multiple second sample data, and fourth network feature data output by the iterative training of the second feature network is sent to the first participant.
[0067] Wherein, the above rearrangement module includes:
[0068] an index determination unit, configured to determine, according to data granularity, a sorting position of each second sample data in the plurality of second sample data, and generate first index sequence number information of each second sample data based on the sorting position of each second sample data in the plurality of second sample data, wherein one first index sequence number information is used to index one second sample data;
[0069] The rearrangement unit is used to align the first index sequence number information of each of the second sample data with the index sequence number information of each of the first sample data, so as to reorder the plurality of second sample data.
[0070] The index determination unit is further used for:
[0071] The plurality of second sample data are divided into a plurality of second sample data blocks according to a data block granularity based on a sorting position of each second sample data in the plurality of second sample data, wherein one second sample data block includes at least one second sample data; and second index sequence number information of each second sample data block is generated based on a sorting position of each second sample data block in the plurality of second sample data blocks to obtain index sequence number information of each second sample data, wherein one second index sequence number information is used to index each second sample data in one first sample data block.
[0072] Wherein, the above rearrangement unit is also used for:
[0073] The second index sequence number information of each of the second sample data blocks is aligned with the index sequence number information of the data block to which each of the first sample data belongs, so as to reorder the plurality of second sample data.
[0074] The index determination unit is further used for:
[0075] Based on the sorting position of each second sample data in the above-mentioned multiple second sample data, multiple second sample feature data files arranged in sequence are generated according to the data file granularity, and one second sample feature data file includes at least one second sample data; based on the sorting position of each second sample feature data file in the above-mentioned multiple second sample feature data files, third index sequence number information of each second sample feature data file is generated, wherein one third index sequence number information is used to index each second sample data in one second sample feature data file.
[0076] The rearrangement unit is further used to align the third index number information of each of the second sample feature data files with the index number information of the data files to which each of the first sample data belongs, so as to reorder the plurality of second sample data.
[0077] In a fifth aspect, the present application further provides a computer device, including: a processor, a memory, and a network interface;
[0078] The above-mentioned processor is connected to the memory and the network interface, wherein the network interface is used to provide data communication function, the above-mentioned memory is used to store program code, and the above-mentioned processor is used to call the above-mentioned program code to execute the method provided in the first aspect of this application.
[0079] In a sixth aspect, the present application further provides a computer device, the computer device comprising: a processor, a memory, and a network interface;
[0080] The above-mentioned processor is connected to the memory and the network interface, wherein the network interface is used to provide data communication function, the above-mentioned memory is used to store program code, and the above-mentioned processor is used to call the above-mentioned program code to execute the method provided in the second aspect of this application.
[0081] In a seventh aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the processor executes the program instructions, the method provided in the first aspect of the present application is executed.
[0082] In an eighth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the processor executes the program instructions, the method provided in the second aspect of the present application is executed.
[0083] In the ninth aspect, the present application also provides a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; the processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the first and second aspects of the present application.
[0084] In the data processing method provided in the embodiment of the present application, after the longitudinal federated learning model is iteratively trained based on the multiple first sample data and the multiple second sample data arranged based on the first arrangement order, the first participant obtains the index sequence number information of the multiple first sample data based on the preset sorting strategy, and reorders the multiple first sample data according to the index sequence number information of the above-mentioned each first sample data. At the same time, the first participant can send the above-mentioned sorting strategy and the index sequence number information of each first sample data after reordering to the second participant, triggering the above-mentioned second participant to reorder the above-mentioned multiple second sample data based on the above-mentioned sorting strategy and the index sequence number information of each first sample data after reordering, so as to align the sample data of the first participant and the second participant to avoid generating noise data. Further, the longitudinal federated learning model of the embodiment of the present application can be iteratively trained based on the multiple first sample data and the multiple second sample data after reordering, and the longitudinal federated learning model. The processing method based on federated learning provided in the embodiment of the present application increases the randomness of the sample data arrangement by reordering the order of the sample data after each iterative training of the longitudinal federated learning model, improves the generalization of federated learning, and improves the training effect of the federated learning machine model, and has high applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0086] Figure 1 It is a schematic diagram of a system architecture provided by an embodiment of the present application;
[0087] Figure 2 It is a schematic diagram of a framework of the data processing method provided in the embodiment of the present application;
[0088] Figure 3 It is a flow chart of a data processing method provided in an embodiment of the present application;
[0089] Figure 4 It is a principle schematic diagram of the data processing method provided in the embodiment of the present application;
[0090] Figure 5 It is another principle schematic diagram of the data processing method provided in the embodiment of the present application;
[0091] Figure 6 It is another principle schematic diagram of the data processing method provided in the embodiment of the present application;
[0092] Figure 7 It is another schematic diagram of the framework of the data processing method provided in the embodiment of the present application;
[0093] Figure 8 is another flow chart of the data processing device provided in the embodiment of the present application;
[0094] Fig. 9 It is another principle schematic diagram of the data processing method provided in the embodiment of the present application;
[0095] Fig.10 It is another principle schematic diagram of the data processing method provided in the embodiment of the present application;
[0096] Fig.11 It is another principle schematic diagram of the data processing method provided in the embodiment of the present application;
[0097] Fig.12 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0098] Fig.13 is another structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0099] Fig.14It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0100] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0101] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0102] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning usually includes artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by teaching.
[0103] Deep Learning (DL) is a new research direction in the field of machine learning. It is introduced into machine learning to make it closer to its original goal - artificial intelligence. Deep learning is the inherent laws and representation levels of learning sample data. The information obtained in the learning process is of great help in the interpretation of data such as text, images and sounds. Its ultimate goal is to enable machines to have analytical learning capabilities like humans and to recognize data such as text, images and sounds. Deep learning has achieved many results in search technology, data mining, machine learning, machine translation, natural language processing, multimedia learning, speech, recommendation and personalization technology, and other related fields. Deep learning enables machines to imitate human activities such as seeing, hearing and thinking, solves many complex pattern recognition problems, and makes great progress in artificial intelligence related technologies.
[0104] It should be understood that artificial intelligence technology is playing a huge role in all walks of life, and its development is inseparable from the support of massive data. In recent years, data privacy protection and data compliance have also received more and more attention. Various countries and regions have introduced laws and regulations to protect data security, which makes data unable to communicate with each other, resulting in data islands. The data island phenomenon hinders the development of data potential and the development of artificial intelligence technology. For example, in some application scenarios, the sample data used for training artificial intelligence models are often distributed among different participants, where the participants can be understood as servers or terminal devices. In order to fully explore the value of different data, the sample data distributed among different participants can be connected and connected to collect the sample data of each participant and build a sample data set as complete as possible. When training the artificial intelligence model through the above sample data set, since the sample data set includes sample data of multiple participants, a better training effect can be obtained. However, it can be seen from the above content that under the premise of the basic legal framework of data compliance, the data flow of different participants is strictly restricted, that is, the collection of sample data of multiple participants is restricted.
[0105] In order to solve this problem, the concept of federated learning came into being. Federated learning aims to establish a federated learning machine model based on distributed data sets, which can enable the data of multiple participants to be jointly modeled without leaving the local area, ensuring data privacy while stimulating the data potential of each participant. Specifically, as an emerging basic technology of artificial intelligence, federated learning is a distributed machine learning training method based on privacy protection. Its goal is to protect the privacy of client data while training a high-quality prediction model when the training data is scattered on a large number of unreliable application clients with high network latency. Through federated learning, efficient machine learning can be carried out between multiple participants or multiple computing nodes under the premise of ensuring information security during big data exchange, protecting terminal data and personal data privacy, and ensuring legality and compliance.
[0106] It should be understood that the application scenarios of federated learning can be divided into horizontal federated learning and vertical federated learning. Among them, the characteristic of horizontal federated learning is that each participant has different sample data with the same characteristics, and the horizontal federated learning machine model improves the model performance by increasing the number of sample data. The characteristic of vertical federated learning is that each participant has different feature dimension information of the same sample, that is, multiple participants have the same sample, but the samples of different participants each have different feature information. The vertical federated learning machine model increases the feature information of the same sample data so that the model can generate more accurate prediction results based on multi-dimensional features.
[0107] Based on the above-mentioned description of the vertical federated learning, the embodiment of the present application proposes a data processing method, which can support two or more participants to jointly participate in the model training or model reasoning of the federated learning machine model, and in the process of model reasoning or model training, increase the randomness of multiple sample data in the sample data set, improve the generalization of the federated learning machine model, and improve the training effect. Among them, the above-mentioned federated learning machine model can be any neural network model built based on the vertical federated learning technology; for example, a vertical federated linear regression (LinearRegression, LR) model, a logistic regression (Logistic Regression, LogR) model, a support vector machine (Support Vector Machine, SVM) model, a category prediction model, an object recognition model, an expression recognition model, a risk assessment model, an information recommendation model, and the like. For ease of understanding, the embodiment of the present application takes the federated learning machine model as an example of a category prediction model built based on the vertical federated learning technology and is explained in the following content.
[0108] The solution provided in the embodiments of the present application involves technologies such as deep learning and federated learning of artificial intelligence, which are specifically described by the following embodiments. Figure 1 , Figure 1 Schematic diagram of a system architecture provided by an embodiment of the present application. Figure 1 As shown, the system architecture may include a business server 100 and a terminal cluster, and the terminal cluster may include: terminal devices 200a, terminal devices 200b, terminal devices 200c, ..., terminal devices 200n and the like. Among them, the above-mentioned business server 100 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud database, cloud service, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform. The terminal device (including terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n) may be a handheld computer, a smart phone, a laptop computer, a desktop computer, a tablet computer, a mobile internet device (mobile internet device, MID), a wearable device (such as a smart watch, a smart bracelet, etc.), a smart computer, a smart car and the like, but is not limited thereto.
[0109] Among them, the business server 100 can establish a communication connection with each terminal device in the terminal cluster, and a communication connection can also be established between each terminal device in the terminal cluster. In other words, the business server 100 can establish a communication connection with each terminal device in the terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n. For example, a communication connection can be established between the terminal device 200a and the business server 100. A communication connection can be established between the terminal device 200a and the terminal device 200b, and a communication connection can also be established between the terminal device 200a and the terminal device 200c. Among them, the above-mentioned communication connection does not limit the connection method, and can be directly or indirectly connected through a wired communication method, or can be directly or indirectly connected through a wireless communication method, etc., which can be determined according to the actual application scenario, and this application is not limited here.
[0110] It should be understood that Figure 1 Each terminal device in the terminal cluster shown in the figure may be installed with an application client. When the application client runs in each terminal device, it can be respectively connected to the above Figure 1The business servers 100 shown in the figure interact with each other, so that the business server 100 can receive business data from each terminal device, or the business server 100 can push business data to each terminal device. Among them, the above-mentioned application client can be a browser application, a news application, a learning application, a social application, an instant messaging application, a live broadcast application, a short video application, a video application, a music application, a shopping application, a novel application, a payment application, and other application clients with data processing functions, which can be determined according to the actual application scenario requirements and are not limited here. Among them, the application client can be an independent client or an embedded sub-client integrated in a client (such as a browser client, a social client, etc.), which can be determined according to the actual application scenario and are not limited here.
[0111] It should be understood that the number of application clients integrated into each terminal device can be one or more, just as different application clients can be integrated into one terminal device, and different application clients can hold different multimedia data (sample data), and the multimedia data held by different clients can all be used to train the above-mentioned category prediction model. Since training the category prediction model requires a large amount of sample data, and the multimedia data held by different clients may involve personal data or confidential information, that is, the multimedia data held by each client cannot be made public, the training of the category prediction model can be completed by using federated learning training. In other words, each client can use the multimedia data it holds as sample data for training the category prediction model, and each trains the prediction sub-model (the prediction sub-model can be understood as part of the category prediction model) based on the sample data it holds. Different clients can perform iterative training on their respective prediction sub-models to update their respective model parameters (the updated model parameters at this time can be called local model parameters), that is, each client can upload the model parameters obtained in each iterative training to the business server 100, and the business server 100 can collect the local model parameters uploaded by each client, and perform parameter fusion on the local model parameters uploaded by each client, and obtain the global gradient information in an iterative training process, and then obtain the local gradient information of the prediction sub-model of each client based on the global gradient information, and send the corresponding local gradient information to each client, and each client can continue to train the local model parameters according to the local gradient information until the training termination condition is met (for example, the convergence condition is reached or the number of training iterations reaches the preset maximum number of iterations), and obtain the trained category prediction model. The category prediction model can be used to output the category prediction result of the operation object based on the multimedia data of different operation objects. For example, the category prediction model can predict the advertising category that the operation object may be interested in based on the static tags of different operation objects (for example, the age, gender, education level, etc. of the operation object), historical behavior records (for example, the behavior records of the operation object sharing and clicking on advertisements), etc., and recommend advertisements with high interest to the operation object to achieve personalized advertising recommendation.
[0112] For ease of understanding, the present application embodiment uses the federated learning machine model as an example for explaining the advertisement recommendation model (category prediction model) to be trained. Figure 2 , Figure 2 Schematic diagram of a data processing method provided in the embodiment of the present application. Figure 2 The first client shown can be the above Figure 1 The client with the federated learning advertising recommendation model authority integrated in the terminal device 200a shown in the figure can be the above-mentioned Figure 1The client with the federated learning advertising recommendation model authority integrated in the terminal device 200b shown in the figure can be the above-mentioned Figure 1 The business server 100 shown. Among them, the first client may hold a first sample data set of multiple sample objects for training an advertising recommendation model, and the first sample data set may include static labels of different sample objects, such as age, gender, region, and education level of the sample objects. The second client may hold a second sample data set of multiple sample objects for training an advertising recommendation model (the multiple sample objects of the first client and the multiple sample objects of the second client are the same), and the second sample data set may include click information of different sample objects for advertisements or commodities. The first sample data set held by the first client and the second sample data set held by the second client are independent of each other. For example, in order to ensure the privacy of the data, the first client will not share the static labels of the sample objects held by itself with the second client. Similarly, the second client will not share the historical behavior records of the sample objects held by itself with the first client. It can be understood that since the first client and the second client only hold a part of the sample data set, only by combining the sample data of the two clients through federated learning can a complete sample data set for training an advertising recommendation model be formed. For example, it is assumed that the first sample data set held by the first client includes 40-dimensional data features, and the second sample data set held by the second client has another part of 60-dimensional data features. By combining the first client and the second client, the 100-dimensional data features of the first sample data set and the second sample data set can be obtained, which can significantly expand the feature dimension of the training sample data. In addition, since the multiple first sample data in the first sample data set correspond to different sample objects, and the multiple second sample data in the second sample data set also correspond to different sample objects, in order to ensure the accuracy of model training, before the first sample data set and the second sample data set are federated, the multiple first sample data and the multiple second sample data can be aligned by the object identifier of the sample object, so as to achieve sample data alignment, and then the federated model training of the first client and the second client can be performed.
[0113] In some possible implementations, such as Figure 2As shown, in the supervised deep learning mode, the first client can hold a verification set A corresponding to the first sample data set, and the second client can hold a verification set B corresponding to the second sample data set. When the first client aligns the first sample data set with the second sample data set of the second client, a training set A can be obtained. The first client can perform model training on the local model A of the first client based on the training set A and the above verification set A, and input the first output data obtained by the training of model A into the federated learning model for processing. Similarly, when the second client aligns the second sample data set with the first sample data set of the first client, a training set B can be obtained. The second client can perform model training on the local model B of the second client based on the training set B and the above verification set B, and input the second output data obtained by the training of model B into the federated learning model (i.e., the advertising recommendation model) for processing. The advertising recommendation model can perform forward calculation on the first output data and the second output data to obtain a loss result, and perform back propagation processing on the advertising recommendation model according to the loss result to update the model parameters of model A and model B, complete the training of the advertising recommendation model, and obtain a converged advertising recommendation model. In general, by using federated learning technology, a virtual shared federated learning machine model can be established without leaving the domain of local data of multiple clients, ensuring data privacy and security.
[0114] In some feasible implementations, it can be seen from the above content that the federated learning machine model based on the vertical federated learning technology (hereinafter referred to as the vertical federated learning model) needs to align the sample data of multiple sample data sets before performing federated learning on multiple sample data sets of multiple participants (clients). Specifically, different sample data (first sample data and second sample data) of the same sample object in multiple sample data sets can be aligned so that the vertical federated learning model can perform federated learning on multiple sample data of each sample object. Assuming that the above-mentioned vertical federated learning model is an advertising recommendation model, the first sample data set of the above-mentioned first client may include first sample data a1, first sample data b1 and first sample data c1. Among them, the first sample data a1 may carry the object identification of sample object a, and the first sample data a1 may be a static label of sample object a, which is used to characterize the static labels such as age and gender of sample object a. The first sample data b1 may carry the object identification of sample object b, and the first sample data b1 may be a static label of sample object b, which is used to characterize the static labels such as age and gender of sample object b. The first sample data c1 may carry the object identification of the sample object c, and the first sample data c1 may be a static label of the sample object c, used to characterize the static labels such as the age and gender of the sample object c. Similarly, the second sample data set of the second client may include the second sample data a2, the second sample data b2, and the second sample data c2. Among them, the second sample data a2 may carry the object identification of the sample object a, and the second sample data a2 may be a historical behavior record of the sample object a, used to characterize the historical behavior characteristics of the sample object a clicking, sharing advertisements or commodities. The second sample data b2 may carry the object identification of the sample object b, and the first sample data b2 may be a historical behavior record of the sample object b, used to characterize the historical behavior characteristics of the sample object b clicking, sharing advertisements or commodities. The second sample data c2 may carry the object identification of the sample object c, and the second sample data c2 may be a historical behavior record of the sample object c, used to characterize the historical behavior characteristics of the sample object c clicking, sharing advertisements or commodities.
[0115] In some feasible implementations, the object identifier of the sample object can be understood as a unique identifier used to characterize different sample objects. For example, different operation objects (sample objects) on a social networking platform can have different identity identifiers (object identifiers). Before the advertising recommendation model performs federated learning on the first sample data set and the second sample data set, the sample data alignment can be performed on the multiple first sample data in the first sample data set and the multiple second sample data in the second sample data set based on the object identifier carried by the sample data. Specifically, assuming that the arrangement order of the multiple first sample data in the first sample data set is: first sample data b1, first sample data a1, first sample data c1, accordingly, the arrangement order of the sample objects in the first sample data set can be obtained based on the object identifiers carried by different sample data (first sample data b1, first sample data a1, first sample data c1): sample object b, sample object a, sample object c. In order to integrate different sample data of the same sample object in the process of federated learning, the first client can encrypt the above arrangement order and send it to the second client. The second client can arrange the multiple second sample data corresponding to the above multiple sample objects in the second sample data set based on the arrangement order of the multiple sample objects, so that the multiple second sample data are arranged as: second sample data b2, first sample data a2, first sample data c2, thereby completing the sample data alignment. It can be seen that in the sample data alignment stage, the first client and the second client can arrange the multiple sample data according to the object identifier carried by the sample data to ensure that in the process of federated learning, different sample data of the same sample object are integrated and learned.
[0116] In some feasible embodiments, when the advertising recommendation model performs federated learning on the first sample data set and the second sample data set, the first sample data a1 of the first sample data set and the second sample data a2 of the second sample data set corresponding to the above-mentioned sample object a can be fused to obtain complete sample data for characterizing the sample object a, and the first sample data b1 of the first sample data set and the second sample data b2 of the second sample data set corresponding to the above-mentioned sample object b can be fused to obtain complete sample data for characterizing the sample object b, and the first sample data c1 of the first sample data set and the second sample data c2 of the second sample data set corresponding to the above-mentioned sample object c can be fused to obtain complete sample data for characterizing the sample object c, thereby iteratively training the longitudinal federated learning model according to the static labels and historical behavior records of the above-mentioned multiple sample objects to improve the model training effect.
[0117] In some feasible implementations, if the sample data sets of each participant are not aligned, the sample data will become noise data, and the longitudinal federated learning model cannot learn useful information based on the noise data. However, when the sample data sets of different participants arrange multiple sample data in a fixed arrangement order, on the one hand, the fixed arrangement order of multiple sample data may cause the longitudinal federated learning model to learn the arrangement order of the data, but not learn useful information from multiple sample data, resulting in poor generalization ability. On the other hand, if the data is sorted by category, it is easy to go astray or fall into local optimality during training according to certain sorting, resulting in differences in training effects, which will cause the longitudinal federated learning model to overfit one category first and then overfit another category during training, thereby causing the loss results of the training process to oscillate periodically, limiting the selectivity of the gradient optimization direction, resulting in a serious reduction in the convergence point selection space, and then causing the longitudinal federated deep learning model to be prone to overfitting or underfitting, affecting the effect of the model. At the end of the training, the model always overfits the most recently trained data, resulting in poor generalization ability. It can be seen that the current conventional longitudinal federated learning model has poor training effects and is prone to overfitting or underfitting.
[0118] It is understandable that in the specific implementation of this application, related data such as object information is involved. When the embodiments of this application are applied to specific products or technologies, it is necessary to obtain the object's permission or consent, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0119] The data processing method provided in the embodiment of the present application is applicable to the federated learning of multiple participants based on the vertical federated learning technology. It is understandable that the terminal devices applicable to the above data processing method include but are not limited to smart phones, computers, tablet computers, personal digital assistants (PDA), mobile Internet devices (MID) and wearable devices. Optionally, the terminal device may also be a server corresponding to the above-mentioned smart phones, computers, tablet computers, PDAs, MIDs and wearable devices, etc., which can be determined according to the actual application scenario and are not limited here. Correspondingly, the data processing device provided in the embodiment of the present application includes but is not limited to smart phones, computers, tablet computers, PDAs, MIDs and wearable devices.
[0120] It is understandable that the data processing method provided in the embodiment of the present application can be implemented as follows: Figure 1 The service server 100 shown in the figure may also be executed by a terminal device (such as Figure 1The example of the present invention can be executed by any one of the terminal devices 200a, 200b, ..., 200n shown in the figure), or by the terminal device and the service server together. The specific implementation can be determined according to the actual application scenario and is not limited here. To facilitate subsequent understanding and explanation, the embodiment of the present application can be performed in Figure 1 A terminal device is selected from the terminal device cluster as a target terminal device, for example, the terminal device 200b is selected as the target terminal device.
[0121] In the data processing method provided in the embodiment of the present application, after the longitudinal federated learning model is iteratively trained based on the multiple first sample data and the multiple second sample data arranged based on the first arrangement order, the first participant obtains the index sequence number information of the multiple first sample data based on the preset sorting strategy, and reorders the multiple first sample data according to the index sequence number information of the above-mentioned each first sample data. At the same time, the first participant can send the above-mentioned sorting strategy and the index sequence number information of each first sample data after reordering to the second participant, triggering the above-mentioned second participant to reorder the above-mentioned multiple second sample data based on the above-mentioned sorting strategy and the index sequence number information of each first sample data after reordering, so as to align the sample data of the first participant and the second participant to avoid generating noise data. Further, the longitudinal federated learning model of the embodiment of the present application can be iteratively trained based on the multiple first sample data and the multiple second sample data after reordering, and the longitudinal federated learning model. The processing method based on federated learning provided in the embodiment of the present application increases the randomness of the sample data arrangement by reordering the order of the sample data after each iterative training of the longitudinal federated learning model, improves the generalization of federated learning, and improves the training effect of the federated learning machine model, and has high applicability.
[0122] For further information, see Figure 3 , Figure 3 1 is a flow chart of a data processing method provided in an embodiment of the present application. For ease of understanding, the present application embodiment is described by taking a terminal device as an example. Figure 1 The terminal device 200a and the terminal device 200b in the example are two participants in the federated learning. The server can be the above Figure 1 The business server 100 of the corresponding embodiment. The embodiment of the present application can be applied to various scenarios, including but not limited to cloud technology, cloud storage, etc. Figure 2 In the data processing method shown in FIG. 1 , each step of data processing can be performed by Figure 1 The terminal device 200a, the terminal device 200b and the service server 100 are executed, such as Figure 3 As shown, the data processing method may at least include the following steps S101 to S107.
[0123] Step S101: A first participant obtains a plurality of first sample data sorted in a first arrangement order.
[0124] In some feasible implementations, the embodiment of the present application is illustrated by taking the vertical federated learning model of the first participant and the second participant as an example. Among them, the first participant can jointly complete the iterative training of the vertical federated learning model with the second participant. For example, the first participant can be a social networking platform, the second participant can be an advertising platform, and the first participant and the second participant can jointly train one or more personalized advertising recommendation models based on deep learning. Specifically, the first participant can hold multiple first sample data, and the second participant can hold multiple second sample data. In addition, it can be seen from the above content that in the embodiment of the present application, the first participant can also hold data labels for model training (such as the above-mentioned verification set A or verification set B), then the first participant can act as the initiator of the vertical federated learning model training, establish a top-level feature network in the first participant, and perform federated learning on the multiple second sample data of the second participant and the multiple first sample data held by itself, that is, the first participant of the embodiment of the present application can directly act as the initiator of the vertical federated learning and jointly establish a vertical federated learning model with the second participant. Similarly, assuming that the second participant holds the data labels for model training (such as the above-mentioned verification set A or verification set B), the second participant can directly serve as the initiator of vertical federated learning and jointly establish a vertical federated learning model with the first participant. In addition, the first participant and the second participant can simultaneously hold the data labels for their respective model training (such as the above-mentioned verification set A and verification set B), and can select the first participant or the second participant as the initiator to conduct vertical federated learning model training according to actual conditions. For ease of understanding, the embodiments of the present application are described in the following content using the first participant as the initiator as an example.
[0125] In some feasible implementations, it can be seen from the above content that the first participant may hold multiple first sample data, and each first sample data carries the object identifier of the corresponding sample object, that is, each first sample data corresponds to a sample object. Before the first participant and the second participant are jointly trained, in order to avoid the influence of noise data on model training, the sample data of the first participant and the second participant may be aligned first. To this end, the first participant may first obtain multiple first sample data and obtain the first arrangement order of the multiple first sample data to determine whether the multiple first sample data are aligned with the multiple second sample data according to the first arrangement order of the multiple first sample data. Specifically, it is assumed that the first participant holds three first sample data, and the three first sample data are: first sample data a1, first sample data b1 and first sample data c1. When the above three first sample data are arranged based on the arrangement order of the first sample data b1, the first sample data a1, and the first sample data c1, the first participant in the embodiment of the present application can obtain multiple first sample data sorted according to the first arrangement order: first sample data b1, first sample data a1, and first sample data c1. In addition, the first participant may also include other quantities of multiple first sample data, and the multiple first sample data may also be arranged in other arrangement orders, which is not limited in this application.
[0126] For ease of understanding, the embodiments of the present application are illustrated in the following content. It can be seen from the above that in the vertical federated learning model, the sample data held by different participants (the first participant and the second participant) have different data features (such as the above-mentioned static labels and historical behavior records), and the feature holders (i.e., sample objects) corresponding to different sample data are the same. For example, in some application scenarios, a bank can be used as the first participant, and an Internet company in the same region as the bank can be used as the second participant. Since the two are in the same region, the customer groups served have a large overlap, so the first participant and the second participant have a large part of overlapping customers (sample objects). At the same time, since the services provided by banks and Internet companies are different, the feature information of the sample data held by the two is different, wherein the Internet company can hold the online history of multiple customers, i.e., the above-mentioned multiple second sample data, and the bank can hold the deposit situation of multiple customers and the credit rating of the customer, wherein the deposit situation of multiple customers can be used as the multiple first sample data of the bank, and the credit rating of multiple customers can be used as the label information of the customer held by the bank. Therefore, a more powerful vertical federated learning model for identifying customer credit risk can be trained by combining multiple second sample data of Internet companies and multiple first sample data and label information of banks through vertical federated learning. Specifically, since banks hold corresponding label information, banks can act as initiators to jointly conduct federated learning with Internet companies. Among them, before federated learning, sample data alignment can be performed on multiple first sample data held by banks and multiple second sample data held by Internet companies. Specifically, banks can obtain the arrangement order of multiple first sample data based on multiple object identifiers carried by multiple first sample data. For example, each customer of the bank corresponds to a deposit information, and the identity identifier of the customer is the object identifier of the deposit information (first sample data). In the local database or cloud database used by the bank to store customer deposit information, the deposit information of multiple customers is arranged and stored based on a certain arrangement order. The bank can generate the arrangement order of multiple deposit information based on the identity identifier of the customer corresponding to each deposit information. For example, the local database or cloud database of the bank stores the deposit information of customer 001, the deposit information of customer 002, and the deposit information of customer 003 in sequence, and then the arrangement order of the multiple first sample data of the bank can be determined as: deposit information of customer 001, deposit information of customer 002, and deposit information of customer 003. The database of the Internet company stores the multiple second sample data as follows: online history behavior of customer 001, online history behavior of customer 002, and online history behavior of customer 003.It is understandable that the data type of the second sample data stored by the Internet company is different from the data type of the first sample data stored by the bank (deposit status and online history behavior, respectively), but the customer groups of the two are the same, so it is possible to determine whether the sample data are aligned based on the object identifier corresponding to the sample data. It is understandable that the multiple first sample data of the bank are arranged in the order of deposit status of customer 001, deposit status of customer 002, and deposit status of customer 003. In order to align the sample data, the multiple second sample data of the Internet company can be sorted into online history behavior of customer 001, online history behavior of customer 002, and online history behavior of customer 003 based on the arrangement order of the object identifiers of the multiple first sample data (customer 001, customer 002, customer 003). At this time, the sample data of the multiple first sample data of the bank and the multiple second sample data of the Internet company are aligned.
[0127] In general, in order to align the multiple first sample data of the first participant with the multiple second sample data of the second participant, before the two parties conduct federated learning, the first participant can first obtain the arrangement order (first arrangement order) of the multiple first sample data it holds, and at the same time, the second participant can obtain the arrangement order of the multiple second sample data it holds based on the same method. By comparing whether the arrangement order of the multiple second sample data of the second participant is the same as the first arrangement order of the multiple first sample data, it can be determined whether the first participant and the second participant have completed the sample data alignment. Among them, if the arrangement order of the multiple second sample data of the second participant is the same as the first arrangement order of the multiple first sample data, that is, the arrangement order of the multiple second sample data is also the first arrangement order, it can be determined that the first participant and the second participant have completed the sample data alignment. If the arrangement order of the multiple second sample data of the second participant is different from the first arrangement order of the multiple first sample data, that is, the arrangement order of the multiple second sample data is not the first arrangement order, it can be determined that the first participant and the second participant have not completed the sample data alignment. At this time, the second participant can reorder the multiple second sample data based on the first arrangement order shared by the first participant to make the arrangement order of the multiple second sample data the first arrangement order, so that the multiple first sample data of the first participant are aligned with the multiple second sample data of the second participant, avoiding the generation of noise data and affecting the training effect of the vertical federated learning model.
[0128] Step S102: The first participant iteratively trains the first feature network of the federated learning machine model based on multiple first sample data to obtain first network feature data output by the iterative training of the first feature network.
[0129] In some feasible implementations, after the first participant and the second participant align the sample data, further, the first participant and the second participant can each perform iterative training to obtain corresponding iterative training results, and then the first participant can summarize its own iterative training results and the iterative training results of the second participant, and transmit the summarized iterative training results to the top-level feature network for forward calculation to achieve federated learning. Specifically, the first participant can input multiple first sample data after sample alignment into the first feature network held by the first participant for iterative training to obtain the first network feature data output by the iterative training of the first feature network. Among them, the above-mentioned first feature network may include an embedding layer (embedding layer), and the embedding layer can map multiple first sample data to the embedding vector space during the iterative training process to reduce the dimension of multiple first sample data, thereby obtaining a first network feature vector for characterizing the degree of association of data features between different first sample data, and the first network feature vector can be understood as a feature vector characterizing the mapping of multiple first sample data in the embedding vector space. In addition, the first participant can also iteratively train the loss function of the first feature network based on the first network feature vectors of the multiple first sample data output by the above-mentioned embedding layer and the corresponding label information (i.e., the above-mentioned verification set A) to obtain the loss result. It can be understood that the loss result represents the error of the first feature network when iteratively training the multiple first sample data. The larger the loss result, the larger the error of the first feature network in iterative training of the multiple first sample data, and the worse the training effect. The smaller the loss result, the smaller the error of the first feature network in iterative training of the multiple first sample data, and the better the training effect. It can be understood that the first feature network can obtain the first network feature data output after iterative training based on the above-mentioned first network feature vectors and loss results. It can be seen from this that the first participant can iteratively train the multiple first sample data based on the local first feature network, and generate the first network feature data for characterizing the data features of the multiple first sample data and the iterative training error.
[0130] Step S103: The first participant obtains second network feature data returned by the second participant after iterative training of the second feature network of the federated learning machine model based on multiple second sample data sorted in the first arrangement order.
[0131] In some feasible implementations, it can be seen from the above content that since the first participant has the label information of the vertical federated learning model training, the first participant can be used as the initiator of the federated learning, and the second participant can be used as the follower of the federated learning. After the first participant performs iterative training on the local first feature network based on multiple first sample data and outputs the corresponding first network feature data, the first participant can further obtain the second network feature data returned by the second participant after iterative training on the second feature network of the federated learning machine model based on multiple second sample data sorted according to the first arrangement order, so as to summarize the first network feature data and the second network feature data and input them into the local top-level feature network for iterative training. Specifically, before conducting federated learning, the second participant can align the sample data of the multiple second sample data of the second participant with the multiple first sample data of the first participant based on the first arrangement order shared by the first participant. Specifically, the specific implementation method of the first participant obtaining the multiple first sample data arranged based on the first arrangement order in the above step S101 can be referred to, and the multiple second sample data arranged based on the first arrangement order in the second participant can be obtained. This application will not be repeated here. It can be understood that after data alignment of multiple second sample data of the second participant, the second participant can iteratively train the local second feature network based on the multiple second sample data to obtain second network feature data, wherein the second network feature data can be understood as the data features and iterative training errors used to characterize the second sample data. Specifically, the second participant can input the multiple second sample data after sample alignment into the second feature network held by the second participant for iterative training to obtain the second network feature data output by the iterative training of the second feature network. The above-mentioned second feature network may include an embedding layer (embedding layer), and the embedding layer can map the multiple second sample data to the embedding vector space during the iterative training process to reduce the dimension of the multiple second sample data, thereby obtaining a second network feature vector for characterizing the degree of data feature association between different second sample data, and the second network feature vector can be understood as a feature vector characterizing the mapping of multiple second sample data in the embedding vector space. In addition, the second participant can also iteratively train the loss function of the second feature network based on the second network feature vectors of the multiple second sample data output by the above-mentioned embedding layer and the corresponding label information (i.e., the above-mentioned verification set B) to obtain the loss result. It can be understood that the loss result represents the error of the second feature network when iteratively training multiple second sample data. The larger the loss result, the larger the error of the second feature network when iteratively training multiple second sample data, and the worse the training effect. The smaller the loss result, the smaller the error of the second feature network when iteratively training multiple second sample data, and the better the training effect.It is understandable that the second feature network can obtain the second network feature data output after iterative training based on the above-mentioned second network feature vector and loss result. Furthermore, the second participant, as a follower of federated learning, can send the above-mentioned second network feature data to the first participant to perform forward calculations in the top-level feature network of the first participant. Optionally, in some application scenarios, the second participant can also be used as the initiator of federated learning, and the first participant can be used as the follower of federated learning. The specific details can be determined according to the actual application scenario, and this application is not limited here.
[0132] In some feasible implementations, after the first participant and the second participant each perform iterative training based on multiple sample data, the first participant as the initiator can summarize the first network feature data and the second network feature data obtained by the iterative training, and then iteratively train the top-level feature network of the federated learning machine model. Further, the top-level feature network can include a fully connected layer, which can be used to perform feature fusion on the first network feature data and the second network feature data to obtain first fused feature data. In addition, the top-level feature network can also include a top-level neural network layer, which can iteratively train the top-level feature network based on the first fused feature data and output a loss result, and calculate the global gradient information of the vertical federated learning model based on the loss result. It can be understood that the global gradient information can be understood as the gradient information of the vertical federated learning model in the entire forward calculation process, from iterative training of the first feature network based on multiple first sample data to obtain the corresponding first network feature data, iterative training of the first feature network based on multiple second sample data to obtain the corresponding second network feature data, and then iteratively training the top feature network according to the first network feature data and the second network feature data. Therefore, the global gradient information can be used to characterize the direction of the maximum rate of change of the loss function of the vertical federated learning model (maximum directional derivative), that is, the vector in the direction in which the vertical federated learning model converges fastest. The vertical federated learning model can adjust the network parameters of each network (first feature network, second feature network, top feature network) in the vertical federated learning model based on the global gradient information, so that each network of the vertical federated learning model converges along the fastest gradient direction, so that the entire vertical federated learning model converges, that is, the training of the vertical federated learning model is completed.
[0133] In some feasible implementations, it can be seen from the above content that multiple sample data with a fixed arrangement order will result in poor generalization of model training, overfitting or underfitting, and poor training effect. Therefore, the data processing method provided in the embodiment of the present application can reorder the multiple first sample data of the first participant and the multiple second sample data of the second participant according to the sorting strategy after the longitudinal federated learning model performs one iterative training on the multiple first sample data and the multiple second sample data arranged based on the first arrangement order, so as to improve the generalization of the model and enhance the model training effect. At the same time, the generation of noise data can be avoided by keeping the arrangement order of the multiple first sample data after reordering the same as the arrangement order of the multiple second sample data after reordering.
[0134] Step S104: The first participant generates index sequence number information of each first sample data in the plurality of first sample data based on a preset sorting strategy, and re-sorts the plurality of first sample data according to the index sequence number information of each first sample data.
[0135] In some feasible implementations, in order to improve the generalization of model training and avoid the global gradient information being too extreme when the vertical federated learning model is updated due to multiple sample data with a fixed arrangement order, thereby causing the final model to be overfitted or underfitted, the data processing method provided in the embodiment of the present application can be based on the vertical federated learning model After each iterative training based on the multiple first sample data provided by the first participant and the multiple second sample data provided by the second participant, the multiple first sample data of the first participant are reordered based on a preset sorting strategy, and the second participant is made to reorder the multiple second sample data through network communication to keep the arrangement order of the multiple sample data of the two participants consistent and avoid the generation of noise data. For ease of understanding, the data processing method provided in the embodiment of the present application is briefly explained by taking the example of reordering the multiple first sample data of the first participant and the multiple second sample data of the second participant according to the sorting strategy after the vertical federated learning model is iteratively trained based on multiple first sample data and multiple second sample data arranged in the first arrangement order.
[0136] In some feasible implementations, after the top-level feature network of the first participant performs forward calculation based on the first webpage feature data and the second network feature data to obtain the global gradient information of the vertical federated learning model, the vertical federated learning model can be based on backpropagation of the global gradient information to calculate the partial derivatives (local gradient information) of the first feature network, the second feature network, and the top-level feature network of the vertical federated learning model based on the global gradient information, and update each network based on the partial derivatives of each network. After updating each network of the vertical federated learning model, the first participant can generate the index sequence number information of each of the multiple first sample data based on the preset sorting strategy, and re-sort the multiple first sample data according to the index sequence number information of each of the first sample data.
[0137] In some feasible implementations, the preset sorting strategy can be sorting according to data granularity. The data granularity can be understood as re-sorting with one sample data as the minimum sorting unit, that is, when the first participant re-sorts multiple first sample data based on the sorting strategy of data granularity, the first participant will re-sort each of the multiple first sample data. Further, the first participant determines the sorting position of each first sample data in the multiple first sample data according to the data granularity, and generates the first index serial number information of each first sample data based on the sorting position of each first sample data in the multiple first sample data, wherein one first index serial number information is used to index one first sample data. For example, refer to Figure 4 , Figure 4 Schematic diagram of a data processing method provided in the embodiment of the present application. Figure 4 As shown, assuming that the first participant's multiple first sample data are A1, A2, A3, A4, A5, A6, the multiple first sample data are arranged based on the first arrangement order: A1, A2, A3, A4, A5, A6. After completing one iteration of training of the vertical federated learning model through the above steps S101 to S103, the first participant can re-sort the multiple first sample data arranged based on the first arrangement order according to the sorting strategy of data granularity. Specifically, the first participant can generate the first index serial number information of each first sample data according to the data granularity based on the sorting position of the multiple first sample data in the multiple first sample data. As shown in FIG. Figure 4As shown, the first sample data A1 is ranked first among the multiple first sample data, and the first index sequence number information of the first sample data A1 can be generated as n1 according to the data granularity; the first sample data A2 is ranked second among the multiple first sample data, and the first index sequence number information of the first sample data A2 can be generated as n2 according to the data granularity; the first sample data A3 is ranked third among the multiple first sample data, and the first index sequence number information of the first sample data A3 can be generated as n3 according to the data granularity; the first sample data A4 is ranked fourth among the multiple first sample data, and the first index sequence number information of the first sample data A4 can be generated as n4 according to the data granularity; the first sample data A5 is ranked fifth among the multiple first sample data, and the first index sequence number information of the first sample data A5 can be generated as n5 according to the data granularity; the first sample data A6 is ranked sixth among the multiple first sample data, and the first index sequence number information of the first sample data A6 can be generated as n6 according to the data granularity. It can be understood that any of the above-mentioned first index number information can be understood as being used to index the corresponding first sample data. For example, the first participant can index the first sample data A1 among multiple first sample data based on the first index number information n1.
[0138] In some feasible implementations, after generating the first index sequence number information of each first sample data, the first participant may randomly scatter the first index sequence number information of the first sample data, and reorder the first sample data based on the arrangement order of the first index sequence number information of each first sample data after random scattering. Figure 4 ,like Figure 4 As shown, the first index number information of the first sample data arranged in the first arrangement order is: n1, n2, n3, n4, n5, n6. Assume that the first participant randomly scatters the first index number information of the first sample data arranged in the first arrangement order, and obtains the first index number information sorted in the second arrangement order: n2, n4, n1, n5, n6, n3. Further, it can be known from the above content that each first index number information can be used to index the corresponding first sample data. Therefore, the first participant can index the first index number information arranged in the second arrangement order and obtain the following: Figure 4The multiple first sample data arranged based on the second arrangement order are shown as: A2, A4, A1, A5, A6, A3, thereby completing the reordering of the multiple first sample data. It can be understood that since the second arrangement order of the multiple first index number information is obtained by randomly breaking up, the multiple first sample data obtained based on the indexes of the multiple first index number information are also randomly broken up and reordered, so the randomness of model training can be improved and the generalization of the model can be improved.
[0139] In some feasible implementations, the preset sorting strategy may be sorting according to data block granularity, and the data block granularity may be understood as re-sorting with one sample data block as the minimum sorting unit. The first participant may divide the plurality of first sample data into a plurality of first sample data blocks according to the data block granularity based on the sorting position of each first sample data in the plurality of first sample data, and a first sample data block includes at least one first sample data. For details, please refer to Figure 5 , Figure 5 FIG. 1 is another schematic diagram of the principle of the data processing method provided in the embodiment of the present application. Figure 5 As shown, assuming that the first sample data of the first participant are A1, A2, A3, A4, A5, and A6, the first sample data are arranged based on the first arrangement order as follows: A1, A2, A3, A4, A5, and A6. After completing one iteration of the vertical federated learning model through the above steps S101 to S103, as shown in FIG. Figure 5 As shown, the first participant may divide the plurality of first sample data into a plurality of first sample data blocks: B1, B2, and B3 according to the data block granularity based on the sorting position of each first sample data in the plurality of first sample data. It can be understood that when the plurality of first sample data can be evenly divided into a plurality of first sample data blocks, the number of first sample data included in each first sample data block is equal. When the plurality of first sample data cannot be evenly divided into a plurality of first sample data blocks, the first sample data block may include only one first sample data block. When the first participant reorders the plurality of first sample data based on the sorting strategy of the data block granularity, the first participant will reorder each first sample data block in the plurality of first sample data blocks. Further, the first participant generates second index sequence number information of each first sample data block based on the sorting position of each first sample data block in the plurality of first sample data blocks, wherein one second index sequence number information is used to index each first sample data in one first sample data block. As shown Figure 5As shown, the first sample data block B1 is ranked first among the multiple first sample data blocks, and the second index sequence number information of the first sample data block B1 can be generated as n1 according to the sorting strategy of data block granularity, the second sample data block B2 is ranked second among the multiple first sample data blocks, and the second index sequence number information of the first sample data block B2 can be generated as n2 according to the sorting strategy of data granularity, and the first sample data block B3 is ranked third among the multiple first sample data blocks, and the second index sequence number information of the first sample data block B3 can be generated as n3 according to the data block granularity. It can be understood that any of the above second index sequence number information can be understood as being used to index the corresponding first sample data block. For example, the first participant can index the first sample data block B1 among the multiple first sample data blocks based on the second index sequence number information n1.
[0140] In some feasible implementations, after generating the second index sequence number information of each first sample data block, the first participant may randomly scatter the second index sequence number information of the first sample data blocks, and reorder the first sample data blocks based on the arrangement order of the second index sequence number information of each first sample data block after the random scattering. For details, please refer to Figure 5 ,like Figure 5 As shown, the multiple second index sequence number information of the multiple first sample data blocks arranged based on the first arrangement order is: n1, n2, n3. Assume that the first participant randomly scatters the multiple second index sequence number information of the multiple first sample data blocks arranged based on the first arrangement order, and obtains the multiple second index sequence number information sorted based on the second arrangement order as: n2, n3, n1. Further, it can be known from the above content that each second index sequence number information can be used to index the corresponding first sample data block. Therefore, the first participant can index the multiple second index sequence number information sorted based on the second arrangement order, and obtain the following: Figure 5 The multiple first sample data blocks sorted based on the second arrangement order are shown as: B2, B3, B1, thereby completing the reordering of multiple first sample data in the multiple first sample data blocks as: A3, A4, A5, A6, A1, A2. It can be understood that, since the second arrangement order of the multiple second index sequence number information is obtained by randomly breaking up, the multiple first sample data blocks obtained based on the indexes of the multiple second index sequence number information are also randomly broken up and reordered, thus, the randomness of model training can be improved and the generalization of the model can be improved.
[0141] In some feasible implementations, the preset sorting strategy may be sorting according to the data file granularity, and the data file granularity may be understood as re-sorting with one sample feature data file as the minimum sorting unit. Among them, the first participant may divide the multiple first sample data into multiple first sample feature data files according to the data file granularity based on the sorting position of each first sample data in the multiple first sample data, and one first sample feature data file includes at least one first sample data. It is understandable that each first sample data included in a first sample feature data file has the same data feature, that is, the first participant may divide at least one first sample data with the same data feature among multiple first sample data into one first sample feature data file based on the sorting strategy of the data file granularity. Optionally, in some application scenarios, the first participant may generate multiple first sample feature data files after aligning the multiple first sample data. For details, please refer to Figure 6 , Figure 6 FIG. 1 is another schematic diagram of the principle of the data processing method provided in the embodiment of the present application. Figure 6 As shown, assuming that the first sample data of the first participant are A1, A2, A3, A4, A5, and A6, the first sample data are arranged based on the first arrangement order as follows: A1, A2, A3, A4, A5, and A6. After completing one iteration of the vertical federated learning model through the above steps S101 to S103, as shown in FIG. Figure 6 As shown, the first participant can divide the multiple first sample data into multiple first sample feature data files: C1, C2 according to the data file granularity based on the sorting position of each first sample data in the multiple first sample data. When the first participant reorders the multiple first sample data based on the sorting strategy of the data file granularity, the first participant will reorder each first sample feature data file in the multiple first sample feature data files. Furthermore, the first participant generates third index serial number information of each first sample feature data file based on the sorting position of each first sample feature data file in the multiple first sample feature data files, wherein one third index serial number information is used to index each first sample data in a first sample feature data file. As shown Figure 6As shown, the first sample characteristic data file C1 is ranked first among multiple first sample characteristic data files, and the third index serial number information of the first sample characteristic data file C1 can be generated as n1 according to the sorting strategy of data file granularity, and the second sample data block C2 is ranked second among multiple first sample characteristic data files, and the third index serial number information of the first sample characteristic data file C2 can be generated as n2 according to the sorting strategy of data granularity. It can be understood that any of the above third index serial number information can be understood as being used to index the corresponding first sample characteristic data file. For example, the first participant can index the first sample characteristic data file C1 among multiple first sample characteristic data files based on the third index serial number information n1.
[0142] In some feasible implementations, after generating the third index serial number information of each first sample feature data file, the first participant may randomly scatter the third index serial number information of the first sample feature data files, and re-order the first sample feature data files based on the arrangement order of the third index serial number information of each first sample feature data file after random scattering. Figure 6 ,like Figure 6 As shown, the third index number information of the multiple first sample feature data files arranged based on the first arrangement order is: n1, n2. Assume that the first participant randomly scatters the multiple third index number information of the multiple first sample feature data files arranged based on the first arrangement order, and obtains the multiple third index number information arranged based on the second arrangement order: n2, n1. Further, it can be known from the above content that each third index number information can be used to index the corresponding first sample feature data file. Therefore, the first participant can index the multiple third index number information sorted based on the second arrangement order, and obtain the following: Figure 6 The multiple first sample feature data files sorted based on the second arrangement order are shown as: C2, C1, thereby completing the re-ordering of multiple first sample data in the multiple first sample feature data files as: A4, A5, A6, A1, A2, A3. It can be understood that, since the second arrangement order of the multiple third index number information is obtained by randomly breaking up, the multiple first sample feature data files obtained based on the indexes of the multiple third index number information are also randomly broken up and re-ordered, thus, the randomness of model training can be improved and the generalization of the model can be improved.
[0143] Step S105: The first participant sends the sorting strategy and the index number information of each reordered first sample data to the second participant, triggering the second participant to reorder the multiple second sample data based on the sorting strategy and the index number information of each reordered first sample data.
[0144] In some feasible implementations, after the first participant reorders the plurality of first sample data based on any of the above preset sorting strategies, the sorting strategy and the index sequence number information of each reordered first sample data can be sent to the second participant to trigger the second participant to reorder the plurality of second sample data based on the sorting strategy and the index sequence number information of each reordered first sample data. Specifically, if the arrangement order of the plurality of first sample data of the first participant after reordering is the above Figure 4 When the second party receives the sorting strategy of the first party and the index number information of each reordered first sample data, the second party can, based on the specific implementation of the above step S104, reorder the multiple second sample data based on the sorting strategy and the index number information of each reordered first sample data, so that the arrangement order of the multiple second sample data is also the second arrangement order, so that after one iterative training, the longitudinal federated learning model reorders the multiple first sample data and performs sample data alignment with the multiple second sample data.
[0145] Step S106: The first participant iteratively trains the first feature network based on the reordered plurality of first sample data to obtain third network feature data output by the iterative training of the first feature network.
[0146] In some feasible implementations, after the first participant and the second participant reorder the multiple first sample data, the first participant may further input the multiple reordered first sample data into the first feature network held by the first participant for iterative training to obtain the third network feature data output by the iterative training of the first feature network. Among them, the embedding layer of the above-mentioned first feature network can map the multiple first sample data to the embedding vector space during the iterative training process to reduce the dimension of the multiple first sample data, thereby obtaining a third network feature vector for characterizing the degree of association of data features between different first sample data. The third network feature vector can be understood as a feature vector that characterizes the mapping of the multiple reordered first sample data in the embedding vector space. In addition, the first participant can also iteratively train the loss function of the first feature network based on the third network feature vector of the multiple first sample data output by the above-mentioned embedding layer and the corresponding label information (i.e., the above-mentioned verification set A) to obtain the loss result. It is understandable that the loss result characterizes the error of the first feature network when iteratively training multiple first sample data. The larger the loss result, the larger the error of the first feature network when iteratively training multiple first sample data, and the worse the training effect. The smaller the loss result, the smaller the error of the first feature network when iteratively training multiple first sample data, and the better the training effect. It is understandable that the first feature network can obtain the third network feature data output after iterative training based on the above-mentioned third network feature vector and loss result. It can be seen that the first participant can iteratively train multiple first sample data based on the local first feature network, and generate third network feature data for characterizing the data features of the reordered multiple first sample data and the iterative training error.
[0147] Step S107: The first participant obtains fourth network feature data returned by the second participant after iterative training of the second feature network according to the reordered plurality of second sample data.
[0148] In some feasible implementations, after reordering the multiple second sample data, the second participant can iteratively train the first feature network based on the multiple reordered first sample data in the above content to obtain the third network feature data output by the iterative training of the first feature network. Similarly, the second feature network is iteratively trained according to the multiple reordered second sample data to obtain the fourth network feature data, and sent to the first participant for federated learning. Specifically, the specific implementation method of the second participant iteratively training the second feature network based on the multiple second sample data to obtain the fourth network feature data can refer to the description of the above step S103, and this application will not repeat it here.
[0149] In some feasible implementations, after obtaining the third network feature data and the fourth network feature data, the first participant may iteratively train the top-level feature network based on the third network feature data and the fourth network feature data. Specifically, the specific implementation method of the first participant iteratively training the top-level feature network based on the third network feature data and the fourth network feature data can refer to the description of the above step S103, and this application will not elaborate on it here.
[0150] For ease of understanding, this application is illustrated in the following content. Figure 7 , Figure 7 is another schematic diagram of the framework of the data processing method provided in the embodiment of the present application. Figure 7 As shown, the first participant obtains multiple first sample data through the first terminal, and transmits the multiple first sample data to the underlying model A (i.e., the above-mentioned first feature network) of the first participant for iterative training to obtain the above-mentioned first network feature data. In addition, the second participant can obtain multiple second sample data through the second terminal, and transmit the multiple second sample data to the underlying model B (i.e., the above-mentioned second feature network) of the second participant for iterative training to obtain the above-mentioned second network feature data, and send it to the first participant for forward calculation. Specifically, the first participant can connect the first network feature data and the second network feature data in series through the interaction layer (i.e., the above-mentioned fully connected layer) to obtain the first fused feature data. Further, the first participant can transmit the first fused feature data to the top model (i.e., the above-mentioned top neural network layer), and the top model can perform iterative training based on the first fused feature data and output the loss result, and calculate the global gradient information of the vertical federated learning model based on the loss result, so as to update each model of the first participant and the second participant based on the global gradient information, and the vertical federated learning model completes an iterative training. It is understandable that after completing an iterative training, it can be known from the above content that the first participant can reorder multiple first sample data based on a preset sorting strategy, and broadcast the sorting strategy and the arrangement of the multiple first sample data after reordering to the second participant, so that the multiple second sample data of the second participant can be aligned with the multiple first sample data of the first participant. Furthermore, the vertical federated learning model can be iteratively trained on the reordered multiple first sample data and the multiple second sample data based on the above content again until the vertical federated learning model converges, which is not repeated in this application. In addition, it is understandable that the first participant, as the initiator, can also cooperate with more participants to conduct federated learning, that is, the number of the above-mentioned second participants can be multiple, which is not limited in this application.
[0151] In the data processing method provided in the embodiment of the present application, after the longitudinal federated learning model is iteratively trained based on multiple first sample data and multiple second sample data arranged based on the first arrangement order, the first participant obtains the index sequence number information of the multiple first sample data based on the preset sorting strategy, and reorders the multiple first sample data according to the index sequence number information of the above-mentioned each first sample data. At the same time, the first participant can send the above-mentioned sorting strategy and the index sequence number information of each first sample data after reordering to the second participant, triggering the above-mentioned second participant to reorder the above-mentioned multiple second sample data based on the above-mentioned sorting strategy and the index sequence number information of each first sample data after reordering, so as to align the sample data of the first participant and the second participant to avoid generating noise data. At the same time, by increasing the randomness of the sample data reordering, the generalization of the model training can be improved and the model training effect can be improved.
[0152] See also Figure 8 , Figure 8 FIG. 1 is another flow chart of the data processing method provided in the embodiment of the present application. Figure 8 As shown, the data processing method may at least include the following steps S201-S204.
[0153] Step S201: The second participant obtains a plurality of second sample data sorted in a first arrangement order.
[0154] In some feasible implementations, it can be known from the above content that in order to align the multiple first sample data of the first participant with the multiple second sample data of the second participant, before the two parties conduct federated learning, the first participant can first obtain the arrangement order (first arrangement order) of the multiple first sample data held by itself, and at the same time, the second participant can obtain the arrangement order of the multiple second sample data held by itself based on the same method. By comparing whether the arrangement order of the multiple second sample data of the second participant is the same as the first arrangement order of the multiple first sample data, it can be determined whether the first participant and the second participant have completed the sample data alignment. Specifically, when the first participant obtains the multiple first sample data arranged based on the first arrangement order, the first participant can broadcast the first arrangement order of the multiple first sample data to the second participant. The second participant can arrange the multiple second sample data based on the first arrangement order to obtain the multiple second sample data arranged based on the first arrangement order, thereby completing the sample data alignment of the first participant and the second participant.
[0155] Step S202: The second participant iteratively trains the second feature network of the federated learning machine model based on the above-mentioned multiple second sample data, and sends the second network feature data output by the above-mentioned second feature network iterative training to the first participant.
[0156] In some feasible implementations, it can be understood that after data alignment of multiple second sample data of the second participant, the second participant can iteratively train the local second feature network based on the multiple second sample data to obtain second network feature data, wherein the second network feature data can be understood as data features and iterative training errors used to characterize the second sample data. Specifically, the second participant can input the multiple second sample data after sample alignment into the second feature network held by the second participant for iterative training to obtain the second network feature data output by iterative training of the second feature network. Among them, the above-mentioned second feature network may include an embedding layer (embedding layer), and the embedding layer can map multiple second sample data to the embedding vector space during the iterative training process to reduce the dimension of the multiple second sample data, thereby obtaining a second network feature vector used to characterize the degree of correlation of data features between different second sample data, and the second network feature vector can be understood as a feature vector characterizing the mapping of multiple second sample data in the embedding vector space. In addition, the second participant can also iteratively train the loss function of the second feature network based on the second network feature vector of the multiple second sample data output by the above embedding layer and the corresponding label information (i.e., the above verification set B) to obtain the loss result. It can be understood that the loss result represents the error of the second feature network when iteratively training the multiple second sample data. The larger the loss result, the larger the error of the second feature network in iterative training of the multiple second sample data, and the worse the training effect. The smaller the loss result, the smaller the error of the second feature network in iterative training of the multiple second sample data, and the better the training effect. It can be understood that the second feature network can obtain the second network feature data output after iterative training based on the above second network feature vector and loss result. Furthermore, the second participant, as a follower of federated learning, can send the above second network feature data to the first participant to perform forward calculation in the top-level feature network of the first participant.
[0157] Step S203: The second party obtains the sorting strategy sent by the first party and the index sequence number information of each first sample data in the multiple first sample data, generates the index sequence number information of the multiple second sample data based on the sorting strategy, and reorders the multiple second sample data according to the index sequence number information of each first sample data and the index sequence number information of the multiple second sample data.
[0158] In some feasible implementations, after the first participant reorders the plurality of first sample data, it is understandable that in order to align the plurality of first sample data with the plurality of second sample data and avoid generating noise data, the first participant may send the index sequence number information and the sorting strategy of each of the plurality of reordered first sample data to the second participant. The second participant may reorder the plurality of second sample data based on the index sequence number information and the sorting strategy of each of the plurality of first sample data.
[0159] In some feasible implementations, assuming that the first participant sorts according to the sorting strategy of data granularity, the second participant can re-sort according to the received sorting strategy of sorting according to data granularity. Fig. 9 , Fig. 9 FIG. 1 is another schematic diagram of the principle of the data processing method provided in the embodiment of the present application. Fig. 9 As shown, multiple first sample data are arranged based on the first arrangement order as: A1, A2, A3, A4, A5, A6. When re-sorted according to the data granularity, multiple first sample data are arranged based on the second arrangement order as: A2, A4, A1, A5, A6, A3. At this time, the first participant can send multiple first index serial number information of multiple first sample data arranged based on the second arrangement order: n2, n4, n1, n5, n6, n3, and the sorting strategy for sorting according to the data granularity to the second participant. At this time, multiple second sample data of the second participant are arranged based on the first arrangement order as: E1, E2, E3, E4, E5, E6. The second participant can generate the first index serial number information of multiple second sample data based on the sorting strategy for sorting according to the data granularity and the sorting position of each second sample data at this time. Specifically, as Fig. 9As shown, the second sample data E1 is ranked first among the multiple second sample data, and the first index sequence number information of the second sample data E1 can be generated as n1 according to the data granularity; the second sample data E2 is ranked second among the multiple second sample data, and the first index sequence number information of the second sample data E2 can be generated as n2 according to the data granularity; the second sample data E3 is ranked third among the multiple second sample data, and the first index sequence number information of the second sample data E3 can be generated as n3 according to the data granularity; the second sample data E4 is ranked fourth among the multiple second sample data, and the first index sequence number information of the second sample data E4 can be generated as n4 according to the data granularity; the second sample data E5 is ranked fifth among the multiple second sample data, and the first index sequence number information of the second sample data E5 can be generated as n5 according to the data granularity; the second sample data E6 is ranked sixth among the multiple second sample data, and the first index sequence number information of the second sample data E6 can be generated as n6 according to the data granularity. It can be understood that any of the above-mentioned first index number information can be understood as being used to index the corresponding second sample data. For example, the second participant can index the second sample data E1 among multiple second sample data based on the first index number information n1.
[0160] In some feasible implementations, after generating the first index sequence number information of each second sample data, the second participant may reorder the first index sequence number information of the plurality of second sample data based on the plurality of first index sequence number information of the plurality of first sample data, and reorder the plurality of second sample data based on the arrangement order of the first index sequence number information of each reordered second sample data. Specifically, Fig. 9As shown, multiple first index sequence number information of multiple second sample data arranged based on the first arrangement order is: n1, n2, n3, n4, n5, n6, and the first participant sends multiple first index sequence number information of multiple first sample data arranged based on the second arrangement order: n2, n4, n1, n5, n6, n3. Then, the second participant can reorder the multiple first index sequence number information of the multiple second sample data based on the second arrangement order of the multiple first index sequence number information of the multiple first sample data to obtain multiple first index sequence number information of the multiple second sample data arranged based on the second arrangement order: n2, n4, n1, n5, n6, n3. It can be seen from the above content that the first index number information of each second sample data can be used to index the corresponding second sample data. Therefore, the second party can index the multiple second sample data based on the multiple first index number information of the multiple second sample data arranged in the above-mentioned second arrangement order to obtain the multiple second sample data arranged based on the second arrangement order: E2, E4, E1, E5, E6, E3, thereby completing the reordering of the multiple second sample data, and the reordered multiple second sample data are aligned with the multiple first sample data to avoid generating noise data.
[0161] In some feasible implementations, assuming that the first participant sorts according to the sorting strategy of data block granularity, the second participant can re-sort according to the received sorting strategy of sorting according to the data block granularity. Fig.10 , Fig.10 FIG. 1 is another schematic diagram of the principle of the data processing method provided in the embodiment of the present application. Fig.10 As shown, after re-sorting according to the data block granularity, the multiple first sample data blocks are arranged based on the second arrangement order as: B2, B3, B1. At this time, the first participant can send the multiple second index serial number information of the multiple first sample data blocks arranged based on the second arrangement order: n2, n3, n1, and the sorting strategy for sorting according to the data block granularity to the second participant. At this time, the multiple second sample data of the second participant are arranged based on the first arrangement order as: E1, E2, E3, E4, E5, E6. The second participant can generate multiple second sample data blocks F1, F2, F3 based on the sorting strategy for sorting according to the data block granularity and the sorting position of each second sample data at this time, and generate second index serial number information for multiple second sample data blocks. Specifically, as Fig.10As shown, the second sample data block F1 is ranked first among the plurality of second sample data blocks, and the second index sequence number information of the second sample data block F1 can be generated as n1 according to the data block granularity, the second sample data block F2 is ranked second among the plurality of second sample data blocks, and the second index sequence number information of the second sample data F2 can be generated as n2 according to the data block granularity, and the second sample data block F3 is ranked third among the plurality of second sample data blocks, and the second index sequence number information of the second sample data block F3 can be generated as n3 according to the data block granularity. It can be understood that any of the above second index sequence number information can be understood as being used to index the corresponding second sample data block, for example, the second participant can index the second sample data block F1 among the plurality of second sample data blocks based on the second index sequence number information n1.
[0162] In some feasible implementations, after generating the second index sequence number information of each second sample data block, the second participant may reorder the second index sequence number information of the plurality of second sample data blocks based on the plurality of second index sequence number information of the plurality of first sample data blocks, and reorder the plurality of second sample data blocks based on the arrangement order of the second index sequence number information of each reordered second sample data block. For details, please refer to Fig.10 ,like Fig.10 As shown, the multiple second index sequence number information of the multiple second sample data blocks arranged based on the first arrangement order is: n1, n2, n3, and the first participant sends the multiple second index sequence number information of the multiple first sample data blocks arranged based on the second arrangement order: n2, n3, n1. Then, the second participant may reorder the multiple second index sequence number information of the multiple second sample data blocks based on the second arrangement order of the multiple second index sequence number information of the multiple first sample data blocks to obtain the multiple second index sequence number information of the multiple second sample data blocks arranged based on the second arrangement order: n2, n3, n1. It can be known from the above content that the second index sequence number information of each second sample data block can be used to index the corresponding second sample data block. Therefore, the second participant can index the multiple second sample data blocks based on the multiple second index sequence number information of the multiple second sample data blocks arranged in the second arrangement order to obtain the multiple second sample data blocks arranged in the second arrangement order: F2, F3, F1, so as to obtain the multiple second sample data after reordering: E3, E4, E5, E6, E1, E2, thereby completing the reordering of the multiple second sample data, and the multiple second sample data after reordering are aligned with the multiple first sample data, which can avoid generating noise data.
[0163] In some feasible implementations, assuming that the first participant sorts according to the sorting strategy of the data file granularity, the second participant can re-sort according to the received sorting strategy of sorting according to the data file granularity. Fig.11 , Fig.11 FIG. 1 is another schematic diagram of the principle of the data processing method provided in the embodiment of the present application. Fig.11 As shown, after re-sorting according to the data file granularity, the multiple first sample feature data files are arranged based on the second arrangement order as: C2, C1. At this time, the first participant can send the multiple third index serial number information of the multiple first sample feature data files arranged based on the second arrangement order: n2, n1, and the sorting strategy for sorting according to the data file granularity to the second participant. At this time, the multiple second sample data of the second participant are arranged based on the first arrangement order as: E1, E2, E3, E4, E5, E6. The second participant can generate multiple second sample feature data files G1, G2 based on the sorting strategy for sorting according to the data file granularity and the sorting position of each second sample data at this time, and generate the third index serial number information of multiple second sample feature data files. Specifically, as Fig.11 As shown, the second sample characteristic data file G1 is ranked first among multiple second sample characteristic data files, and the third index serial number information of the second sample characteristic data file G1 can be generated as n1 according to the data file granularity, and the second sample characteristic data file G2 is ranked second among multiple second sample data, and the third index serial number information of the second sample data G2 can be generated as n2 according to the data file granularity. It can be understood that any of the above third index serial number information can be understood as being used to index the corresponding second sample characteristic data file. For example, the second participant can index the second sample characteristic data file G1 among multiple second sample characteristic data files based on the third index serial number information n1.
[0164] In some feasible implementations, after generating the third index serial number information of each second sample feature data file, the second participant may reorder the third index serial number information of the plurality of second sample feature data files based on the plurality of third index serial number information of the plurality of first sample feature data files, and reorder the plurality of second sample feature data files based on the arrangement order of the third index serial number information of each reordered second sample feature data file. For details, please refer to Fig.11 ,like Fig.11As shown, the multiple third index number information of the multiple second sample feature data files arranged based on the first arrangement order is: n1, n2, and the first participant sends the multiple third index number information of the multiple first sample feature data files arranged based on the second arrangement order: n2, n1. Then the second participant can reorder the multiple third index number information of the multiple second sample feature data files based on the second arrangement order of the multiple third index number information of the multiple first sample feature data files to obtain the multiple third index number information of the multiple second sample feature data files arranged based on the second arrangement order: n2, n1. It can be seen from the above content that the third index serial number information of each second sample feature data file can be used to index the corresponding second sample feature data file. Therefore, the second party can index the multiple second sample feature data files based on the multiple third index serial number information of the multiple second sample feature data files arranged in the above-mentioned second arrangement order to obtain the multiple second sample feature data files arranged based on the second arrangement order: G2, G1, to obtain the multiple second sample data after reordering: E4, E5, E6, E1, E2, E3, thereby completing the reordering of the multiple second sample data, and the multiple second sample data after reordering are aligned with the multiple first sample data, which can avoid the generation of noise data.
[0165] In some feasible implementations, when the first participant or the second participant indexes multiple sample data based on the above-mentioned index sequence number information, a multi-threaded or multi-process approach may be used so that each participant reads sample data each time or reads sample data from a sample data block or a sample feature data file, and the order of reading operations through different threads or processes is consistent, thereby ensuring that the arrangement order of multiple sample data of multiple participants is consistent after reordering.
[0166] Step S204: The second participant iteratively trains the second feature network pair based on the reordered plurality of second sample data, and sends fourth network feature data output by the iterative training of the second feature network to the first participant.
[0167] In some feasible implementations, it is understood that after reordering the multiple second sample data of the second participant, the second participant can iteratively train the local second feature network based on the reordered multiple second sample data to obtain fourth network feature data, wherein the fourth network feature data can be understood as data features and iterative training errors used to characterize the multiple second sample data. Specifically, the specific implementation of the second feature network iteratively training and outputting the fourth network feature data based on the reordered multiple second sample data can refer to the specific implementation of the second feature network iteratively training and outputting the second network feature data based on the multiple second sample data in step S202, which will not be repeated in this application.
[0168] The vertical federated learning model of the embodiment of the present application can be iteratively trained based on the reordered multiple first sample data and multiple second sample data. The processing method based on federated learning provided by the embodiment of the present application increases the randomness of the arrangement of sample data, improves the generalization of federated learning, and enhances the training effect of the federated learning machine model by reordering the order of sample data after each iterative training of the vertical federated learning model, and has high applicability.
[0169] Based on the description of the above data processing method embodiment, the present application embodiment also discloses a data processing device. The data processing device can be applied to Figures 1 to 11 In the data processing method of the embodiment shown, the data processing device is used to execute the steps in the data processing method. The data processing device here can be the above Figures 1 to 11 The service server or terminal device in the embodiment shown, that is, the data processing device can be the above Figures 1 to 11 The execution subject of the data processing method in the embodiment shown. Fig.12 , Fig.12 : is a structural diagram of a data processing device provided in an embodiment of the present application. In an embodiment of the present application, the device can run the following modules:
[0170] The feature training module 11 is used to obtain a plurality of first sample data sorted in a first arrangement order, and iteratively train a first feature network of the federated learning machine model based on the plurality of first sample data to obtain first network feature data output by the iterative training of the first feature network;
[0171] The top-level training module 12 is used to obtain the second network feature data returned by the second participant after iteratively training the second feature network of the federated learning machine model based on the plurality of second sample data sorted in the first arrangement order, so as to iteratively train the top-level feature network of the federated learning machine model based on the first network feature data and the second network feature data;
[0172] a reordering module 13, configured to generate index sequence number information of each first sample data in the plurality of first sample data based on a preset sorting strategy, reorder the plurality of first sample data according to the index sequence number information of each first sample data, and send the sorting strategy and the index sequence number information of each reordered first sample data to the second participant, triggering the second participant to reorder the plurality of second sample data based on the sorting strategy and the index sequence number information of each reordered first sample data;
[0173] Among them, the above-mentioned feature training module 11 is also used to iteratively train the above-mentioned first feature network based on the reordered multiple first sample data to obtain the third network feature data output by the iterative training of the above-mentioned first feature network; the above-mentioned top-level training module 12 is also used to obtain the fourth network feature data returned by the above-mentioned second participant after iteratively training the above-mentioned second feature network according to the reordered multiple second sample data, so as to iteratively train the above-mentioned top-level feature network based on the above-mentioned third network feature data and the above-mentioned fourth network feature data.
[0174] Wherein, the above-mentioned rearrangement module 13 comprises:
[0175] An index determination unit 131 is used to determine the sorting position of each first sample data in the plurality of first sample data according to data granularity, and generate first index sequence number information of each first sample data based on the sorting position of each first sample data in the plurality of first sample data, wherein one first index sequence number information is used to index one first sample data;
[0176] The rearrangement unit 132 is configured to randomly scatter the plurality of first index sequence number information of the plurality of first sample data, and reorder the plurality of first sample data based on the arrangement order of the first index sequence number information of each of the first sample data after random scattering.
[0177] The index determination unit 131 is further configured to:
[0178] Based on the sorting position of each first sample data in the multiple first sample data, the multiple first sample data are divided into multiple first sample data blocks according to the data block granularity, and one first sample data block includes at least one first sample data; based on the sorting position of each first sample data block in the multiple first sample data blocks, second index sequence number information of each first sample data block is generated to obtain index sequence number information of each first sample data, wherein one second index sequence number information is used to index each first sample data in one first sample data block.
[0179] The above-mentioned rearrangement unit 132 is also used for:
[0180] The plurality of second index sequence number information of the plurality of first sample data blocks are randomly scattered, and the plurality of first sample data blocks are reordered based on the arrangement order of the second index sequence number information of the first sample data blocks after the random scattering, so as to achieve the reordering of the plurality of first sample data.
[0181] The index determination unit 131 is further configured to:
[0182] Based on the sorting position of each first sample data in the above-mentioned multiple first sample data, multiple first sample feature data files arranged in sequence are generated according to the data file granularity, and one first sample feature data file includes at least one first sample data; based on the sorting position of each first sample feature data file in the above-mentioned multiple first sample feature data files, third index sequence number information of each first sample feature data file is generated, wherein one third index sequence number information is used to index each first sample data in one first sample feature data file.
[0183] The above-mentioned rearrangement unit 132 is also used for:
[0184] The multiple third index serial number information of the above-mentioned multiple first sample feature data files are randomly scattered, and the above-mentioned multiple first sample feature data files are reordered based on the arrangement order of the third index serial number information of each of the above-mentioned randomly scattered first sample feature data files, so as to achieve reordering of the above-mentioned multiple first sample data.
[0185] The top-level training module 12 is also used for:
[0186] The first network feature data and the second network feature data are input into the top-level feature network, and the first network feature data and the second network feature data are feature-fused and learned through the top-level feature network to implement iterative training of the top-level feature network.
[0187] The top-level training module 12 is also used for:
[0188] The third network feature data and the fourth network feature data are input into the top-level feature network, and the third network feature data and the fourth network feature data are feature-fused and learned through the top-level feature network to implement iterative training of the top-level feature network.
[0189] In an embodiment of the present application, each module in the device shown in the above figure can be separately or all merged into one or several other modules to constitute, or a certain module (or modules) thereof can also be split into multiple smaller modules in function to constitute, which can achieve the same operation without affecting the realization of the technical effect of the embodiment of the present application. The above modules are divided based on logical functions. In practical applications, the function of a module can also be realized by multiple modules, or the function of multiple modules is realized by one module. In other feasible implementations of the present application, the above device can also include other modules. In practical applications, these functions can also be implemented with the assistance of other modules, and can be implemented by the collaboration of multiple modules, which is not limited here.
[0190] In the data processing device provided by the embodiment of the present application, after the longitudinal federated learning model is iteratively trained according to the multiple first sample data and the multiple second sample data arranged based on the first arrangement order, the first participant obtains the index sequence number information of the multiple first sample data based on the preset sorting strategy, and reorders the multiple first sample data according to the index sequence number information of the above-mentioned each first sample data. At the same time, the first participant can send the above-mentioned sorting strategy and the index sequence number information of each first sample data after reordering to the second participant, triggering the above-mentioned second participant to reorder the above-mentioned multiple second sample data based on the above-mentioned sorting strategy and the index sequence number information of each first sample data after reordering, so as to align the sample data of the first participant and the second participant to avoid generating noise data. At the same time, by increasing the randomness of the sample data reordering, the generalization of the model training can be improved and the model training effect can be improved.
[0191] For further information, see Fig.13 , Fig.13 is another structural diagram of the data processing device provided in the embodiment of the present application. The above-mentioned data processing device may be a computer program (including program code) running in a computer device, for example, the data processing device is an application software; the device may be used to execute the corresponding steps in the method provided in the embodiment of the present application. Fig.13 As shown, the above device comprises:
[0192] The feature training module 21 is used to obtain a plurality of second sample data sorted according to a first arrangement order, iteratively train a second feature network of the federated learning machine model based on the plurality of second sample data, and send the second network feature data output by the iterative training of the second feature network to the first participant, wherein the first arrangement order is the arrangement order of the plurality of first sample data used by the first participant to iteratively train the first feature network of the federated learning machine model;
[0193] a reordering module 22, configured to obtain the sorting strategy sent by the first participant and the index sequence number information of each first sample data in the plurality of first sample data, generate the index sequence number information of the plurality of second sample data based on the sorting strategy, and reorder the plurality of second sample data according to the index sequence number information of each first sample data and the index sequence number information of the plurality of second sample data;
[0194] The feature training module 21 is further used to iteratively train the second feature network pair based on the reordered multiple second sample data, and send fourth network feature data output by the iterative training of the second feature network to the first participant.
[0195] Wherein, the above-mentioned rearrangement module 22 comprises:
[0196] An index determination unit 221 is used to determine the sorting position of each second sample data in the plurality of second sample data according to the data granularity, and generate first index sequence number information of each second sample data based on the sorting position of each second sample data in the plurality of second sample data, wherein one first index sequence number information is used to index one second sample data;
[0197] The reordering unit 222 is used to align the first index sequence number information of each of the second sample data with the index sequence number information of each of the first sample data, so as to reorder the plurality of second sample data.
[0198] The index determination unit 221 is further configured to:
[0199] The plurality of second sample data are divided into a plurality of second sample data blocks according to a data block granularity based on a sorting position of each second sample data in the plurality of second sample data, wherein one second sample data block includes at least one second sample data; and second index sequence number information of each second sample data block is generated based on a sorting position of each second sample data block in the plurality of second sample data blocks to obtain index sequence number information of each second sample data, wherein one second index sequence number information is used to index each second sample data in one first sample data block.
[0200] The above rearrangement unit 222 is also used for:
[0201] The second index sequence number information of each of the second sample data blocks is aligned with the index sequence number information of the data block to which each of the first sample data belongs, so as to reorder the plurality of second sample data.
[0202] The index determination unit 221 is further configured to:
[0203] Based on the sorting position of each second sample data in the above-mentioned multiple second sample data, multiple second sample feature data files arranged in sequence are generated according to the data file granularity, and one second sample feature data file includes at least one second sample data; based on the sorting position of each second sample feature data file in the above-mentioned multiple second sample feature data files, third index sequence number information of each second sample feature data file is generated, wherein one third index sequence number information is used to index each second sample data in one second sample feature data file.
[0204] The above rearrangement unit 222 is also used for:
[0205] The third index number information of each of the second sample characteristic data files is aligned with the index number information of the data file to which each of the first sample data belongs, so as to reorder the plurality of second sample data.
[0206] The data processing device of the embodiment of the present application can perform iterative training based on the reordered multiple first sample data and multiple second sample data, and the vertical federated learning model. The processing method based on federated learning provided by the embodiment of the present application increases the randomness of the arrangement of sample data, improves the generalization of federated learning, and improves the training effect of the federated learning machine model by reordering the order of sample data after each iterative training of the vertical federated learning model, and has high applicability.
[0207] See also Fig.14 , Fig.14 Schematic diagram of a computer device provided in an embodiment of the present application. Fig.14 As shown, the computer device 1000 may be the above Figure 1-Figure 11 The terminal device in the corresponding embodiment. The computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally be at least one storage device located away from the aforementioned processor 1001. Fig.14As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
[0208] The network interface 1004 in the computer device 1000 can also be connected to the above Figure 1 The terminal 200b in the corresponding embodiment is connected to the network, and the optional user interface 1003 may also include a display screen (Display) and a keyboard (Keyboard). Fig.14 In the computer device 1000 shown in the figure, the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface for developers; and the processor 1001 can be used to call the device control application stored in the memory 1005 to implement the above Figure 3 The data processing method in the corresponding embodiment.
[0209] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 3 The description of the data processing method in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here either.
[0210] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, Figure 3 For details on the data processing methods provided in each step, please refer to the above Figure 3 The implementation methods provided by each step will not be repeated here.
[0211] The computer-readable storage medium may be the data processing device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0212] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but optionally includes steps or modules that are not listed, or optionally includes other step units inherent to these processes, methods, devices, products, or equipment.
[0213] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0214] The method and related apparatus provided by the embodiment of the present application are described with reference to the method flow chart and / or structural diagram provided by the embodiment of the present application. Specifically, each process and / or box in the method flow chart and / or structural diagram, as well as the combination of the processes and / or boxes in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.
[0215] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A data processing method, characterized in that: The method comprises: The first participant obtains a plurality of first sample data sorted in a first arrangement order, and iteratively trains a first feature network of a federated learning machine model based on the plurality of first sample data to obtain first network feature data output by iterative training of the first feature network; The first participant obtains second network feature data returned by the second participant after iteratively training the second feature network of the federated learning machine model based on the plurality of second sample data sorted in the first arrangement order, so as to iteratively train the top-level feature network of the federated learning machine model based on the first network feature data and the second network feature data; The first participant generates index sequence number information of each first sample data in the plurality of first sample data based on a preset sorting strategy, re-sorts the plurality of first sample data according to the index sequence number information of each first sample data, and sends the sorting strategy and the index sequence number information of each re-sorted first sample data to the second participant, triggering the second participant to re-sort the plurality of second sample data based on the sorting strategy and the index sequence number information of each re-sorted first sample data; The first participant iteratively trains the first feature network based on the reordered multiple first sample data to obtain third network feature data output by the iterative training of the first feature network, and obtains fourth network feature data returned by the second participant after iterative training of the second feature network according to the reordered multiple second sample data, so as to iteratively train the top-level feature network based on the third network feature data and the fourth network feature data.
2. The method according to claim 1, characterized in that The preset sorting strategy is sorting according to data granularity, the first participant generates index sequence number information of each first sample data in the plurality of first sample data based on the preset sorting strategy, and re-sorts the plurality of first sample data according to the index sequence number information of each first sample data, including: The first participant determines the sorting position of each first sample data in the plurality of first sample data according to the data granularity, and generates first index sequence number information of each first sample data based on the sorting position of each first sample data in the plurality of first sample data, wherein one first index sequence number information is used to index one first sample data; The first participant randomly scatters the plurality of first index sequence number information of the plurality of first sample data, and reorders the plurality of first sample data based on the arrangement order of the first index sequence number information of each first sample data after the random scattering.
3. The method according to claim 1, characterized in that The preset sorting strategy is sorting according to the data block granularity, the first participant generates index sequence number information of each first sample data in the plurality of first sample data based on the preset sorting strategy, and re-sorts the plurality of first sample data according to the index sequence number information of each first sample data, including: The first participant divides the plurality of first sample data into a plurality of first sample data blocks according to the data block granularity based on the sorting position of each first sample data in the plurality of first sample data, wherein a first sample data block includes at least one first sample data; The first participant generates, based on the sorting position of each first sample data chunk in the plurality of first sample data chunks, second index sequence number information of each first sample data chunk to obtain index sequence number information of each first sample data, wherein one second index sequence number information is used to index each first sample data in one first sample data chunk; The first participant randomly scatters the multiple second index sequence number information of the multiple first sample data blocks, and reorders the multiple first sample data blocks based on the arrangement order of the second index sequence number information of each of the randomly scattered first sample data blocks, so as to achieve reordering of the multiple first sample data.
4. The method according to claim 1, characterized in that: The preset sorting strategy is to sort according to the granularity of the data file, the first participant generates index sequence number information of each first sample data based on the preset sorting strategy, and re-sorts the plurality of first sample data according to the index sequence number information of each first sample data, including: The first participant generates a plurality of first sample characteristic data files arranged in sequence according to the data file granularity based on the sorting position of each first sample data in the plurality of first sample data, wherein one first sample characteristic data file includes at least one first sample data; The first participant generates third index serial number information of each first sample feature data file based on the sorting position of each first sample feature data file in the plurality of first sample feature data files, wherein one third index serial number information is used to index each first sample data in one first sample feature data file; The first participant randomly scatters the multiple third index serial number information of the multiple first sample feature data files, and reorders the multiple first sample feature data files based on the arrangement order of the third index serial number information of each of the randomly scattered first sample feature data files, so as to reorder the multiple first sample data.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Inputting the first network feature data and the second network feature data into the top-level feature network, and performing feature fusion and learning on the first network feature data and the second network feature data through the top-level feature network to implement iterative training of the top-level feature network; The third network feature data and the fourth network feature data are input into the top-level feature network, and the third network feature data and the fourth network feature data are feature-fused and learned through the top-level feature network to implement iterative training of the top-level feature network.
6. A data processing method, characterized in that: include: The second participant obtains a plurality of second sample data sorted in a first arrangement order, iteratively trains a second feature network of the federated learning machine model based on the plurality of second sample data, and sends the second network feature data output by the iterative training of the second feature network to the first participant, wherein the first arrangement order is the arrangement order of the plurality of first sample data used by the first participant to iteratively train the first feature network of the federated learning machine model; The second participant obtains the sorting strategy sent by the first participant and the index sequence number information of each first sample data in the plurality of first sample data, generates the index sequence number information of the plurality of second sample data based on the sorting strategy, and re-sorts the plurality of second sample data according to the index sequence number information of each first sample data and the index sequence number information of the plurality of second sample data; The second participant iteratively trains the second feature network pair based on the reordered plurality of second sample data, and sends fourth network feature data output by the iterative training of the second feature network to the first participant.
7. The method according to claim 6, characterized in that The sorting strategy is to sort according to data granularity; the generating index sequence number information of the plurality of second sample data based on the sorting strategy, and re-sorting the plurality of second sample data according to the index sequence number information of each first sample data and the index sequence number information of the plurality of second sample data, including: Determine the sorting position of each second sample data in the plurality of second sample data according to the data granularity, and generate first index sequence number information of each second sample data based on the sorting position of each second sample data in the plurality of second sample data, wherein one first index sequence number information is used to index one second sample data; The first index sequence number information of each of the second sample data is aligned with the index sequence number information of each of the first sample data to achieve reordering of the plurality of second sample data.
8. The method according to claim 6, characterized in that The sorting strategy is to sort according to the data block granularity, and the index sequence number information of each first sample data is the index sequence number information of the data block to which the each first sample data belongs; the index sequence number information of the plurality of second sample data is generated based on the sorting strategy, and the plurality of second sample data are re-sorted according to the index sequence number information of each first sample data and the index sequence number information of the plurality of second sample data, including: Dividing the plurality of second sample data into a plurality of second sample data blocks according to data block granularity based on the sorting position of each second sample data in the plurality of second sample data, wherein a second sample data block includes at least one second sample data; generating second index sequence number information of each second sample data block based on the sorting position of each second sample data block in the plurality of second sample data blocks to obtain index sequence number information of each second sample data, wherein one second index sequence number information is used to index each second sample data in one first sample data block; The second index sequence number information of each of the second sample data blocks is aligned with the index sequence number information of the data block to which each of the first sample data belongs, so as to reorder the plurality of second sample data.
9. The method according to claim 6, characterized in that The sorting strategy is to sort according to the granularity of the data file, and the index sequence number information of each first sample data is the index sequence number information of the data file to which each first sample data belongs; the index sequence number information of the plurality of second sample data is generated based on the sorting strategy, and the plurality of second sample data are re-sorted according to the index sequence number information of each first sample data and the index sequence number information of the plurality of second sample data, including: Generate a plurality of second sample characteristic data files arranged in sequence according to the data file granularity based on the sorting position of each second sample data in the plurality of second sample data, wherein one second sample characteristic data file includes at least one second sample data; Generating third index serial number information of each second sample feature data file based on the sorting position of each second sample feature data file in the plurality of second sample feature data files, wherein one third index serial number information is used to index each second sample data in one second sample feature data file; The third index number information of each second sample characteristic data file is aligned with the index number information of the data file to which each first sample data belongs, so as to reorder the plurality of second sample data.
10. A data processing device, characterized in that: The data processing device is applicable to the first participant, and the data processing device includes: A feature training module, used to obtain a plurality of first sample data sorted in a first arrangement order, and iteratively train a first feature network of a federated learning machine model based on the plurality of first sample data to obtain first network feature data output by iterative training of the first feature network; a top-level training module, configured to obtain second network feature data returned after the second participant iteratively trains the second feature network of the federated learning machine model based on the plurality of second sample data sorted in the first arrangement order, so as to iteratively train the top-level feature network of the federated learning machine model based on the first network feature data and the second network feature data; a reordering module, configured to generate index sequence number information of each first sample data in the plurality of first sample data based on a preset sorting strategy, reorder the plurality of first sample data according to the index sequence number information of each first sample data, and send the sorting strategy and the index sequence number information of each reordered first sample data to the second participant, triggering the second participant to reorder the plurality of second sample data based on the sorting strategy and the index sequence number information of each reordered first sample data; The feature training module is further used to iteratively train the first feature network based on the reordered plurality of first sample data to obtain third network feature data output by iterative training of the first feature network; The top-level training module is further used to obtain fourth network feature data returned by the second participant after iterative training of the second feature network according to the reordered multiple second sample data, so as to iteratively train the top-level feature network based on the third network feature data and the fourth network feature data.
11. A data processing device, characterized in that: The data processing device is applicable to the second participant, and the data processing device comprises: a feature training module, configured to obtain a plurality of second sample data sorted in a first arrangement order, iteratively train a second feature network of the federated learning machine model based on the plurality of second sample data, and send second network feature data output by the iterative training of the second feature network to the first participant, wherein the first arrangement order is the arrangement order of the plurality of first sample data used by the first participant to iteratively train the first feature network of the federated learning machine model; a reordering module, configured to obtain the sorting strategy sent by the first participant and the index sequence number information of each first sample data in the plurality of first sample data, generate the index sequence number information of the plurality of second sample data based on the sorting strategy, and reorder the plurality of second sample data according to the index sequence number information of each first sample data and the index sequence number information of the plurality of second sample data; The feature training module is further used to iteratively train the second feature network pair based on the reordered multiple second sample data, and send fourth network feature data output by the iterative training of the second feature network to the first participant.
12. A computer device, characterized in that: include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store program code, and the processor is used to call the program code to execute the steps of the method described in any one of claims 1 to 5.
13. A computer device, characterized in that: include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store program code, and the processor is used to call the program code to execute the steps of the method described in any one of claims 6 to 9.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 9 are executed.
15. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of the method described in any one of claims 1 to 9 above.
