Pricing and incentive method for federal learning calculation task

By introducing federated learning algorithms and contribution evaluation incentive mechanisms in the process of data resource pricing and collaborative pricing, the problem of inefficient data privacy protection and collaboration in multi-platform collaborative pricing is solved, and more efficient data resource pricing and value maximization is achieved.

CN119808897AInactive Publication Date: 2025-04-11YUNNAN UNIVERSITY OF FINANCE AND ECONOMICS +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510297507.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-04-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

There is a lack of effective data resource pricing methods in the prior art, especially in the process of multi-platform collaborative pricing, where data privacy protection and multi-party collaboration are inefficient.

Method used

By introducing federated learning algorithms and incentive mechanisms based on contribution assessment, we optimize the pricing and collaborative pricing process of data resources to ensure data privacy protection and improve multi-party collaboration efficiency.

Benefits of technology

It has achieved the improvement of global model training effect and multi-party collaboration efficiency under the premise of protecting data privacy, assist in achieving balanced interests of participants, and promote fair pricing and value maximization of the data market.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808897A_ABST
    Figure CN119808897A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of federated learning, and discloses a pricing and incentive method for a federated learning calculation task, based on a central node, a server and a plurality of clients, the method comprises the following steps: initializing a system environment; the client locally constructs and trains a pricing model and uploads parameters to the server; the server obtains a global model based on a federal aggregation algorithm and issues the global model to the client; the client uses the updated global model to carry out test evaluation and uploads an evaluation value to the server; and the server distributes corresponding rewards to the client based on the incentive mechanism. According to the invention, the limitation of single subject pricing in traditional data resource pricing and the problem of low collaborative efficiency in a collaborative pricing process are solved, the accuracy of data resource pricing is improved, and more clients are indirectly attracted to join in training to obtain a better pricing model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of federated learning technology, and in particular to a pricing and incentive method for federated learning computing tasks. Background Art

[0002] Data resource pricing and circulation are of great significance in the digital economy era. In practice, there is no mature, fair, and unified data resource pricing method, and the data resource pricing model is relatively imperfect. Traditional data pricing prediction methods are mainly based on new artificial intelligence methods such as machine learning. By inputting real data into the machine learning model, the effectiveness of the constructed data resource pricing model can be tested. However, such methods often rely on the relevant data sets of a single platform for feature learning to carry out training and evaluation. They will establish their own independent models, which have been repeatedly used in daily price predictions. How to further improve the accuracy of data resource price predictions still has bottlenecks, and still faces severe challenges in terms of data source diversity, data privacy sensitivity, model development and application.

[0003] Collaborative pricing refers to the participation of multiple heterogeneous data source entities in pricing tasks and joint responsibility to make up for the limitations of single-enterprise pricing. Data trading platforms bring together disordered and multi-dimensional data from multiple fields such as public, education, and transportation. The government can cooperate with multiple data trading platforms to jointly build a full-factor value co-creation ecosystem and promote the development of the data trading market. Federal incentives, as a framework that can unite multiple parties without directly sharing the data resources of all parties, can effectively solve the problems faced by the cross-platform collaborative pricing process by designing reasonable incentive schemes to encourage all parties to actively participate in the collaborative modeling process, and provide new technical solutions for cross-enterprise and cross-platform data pricing and cooperation. However, the pricing methods in the existing technology do not involve the application of federal incentives to data resource pricing, and do not involve the application of federated learning to data owners and task initiators to build pricing models, which makes cross-platform collaborative pricing have problems with data privacy protection and low efficiency of multi-party collaboration. Summary of the invention

[0004] The present invention provides a pricing and incentive method for federated learning computing tasks. By optimizing the federated learning algorithm and introducing an incentive mechanism based on contribution evaluation, the problem of collaborative pricing among multiple participants under the premise of protecting data privacy is solved, thereby improving the training effect of the global model and the efficiency of multi-party collaboration. It can effectively assist in supporting the balance of interests among the participants in the collaborative process, and indirectly promote fair pricing and value maximization in the data market.

[0005] The present invention provides a pricing and incentive method for a federated learning computing task, based on a central node, a server, and multiple clients, the method comprising: The central node sets up the server as the requester, publishes collaborative pricing tasks and federated training requests to the clients corresponding to the target industry, and sets up smart contracts with the clients that join; Each client performs unified preprocessing on the local data set to convert the data of each client into data that can participate in training, and divide it into training set and test set; Each client builds a deep learning model framework, trains the price prediction model, calculates the loss value of the model training, evaluates the test set, obtains the local model parameters and uploads them to the server; The server aggregates the model parameters based on the federated average aggregation algorithm to generate global model parameters to update the global model, and returns the global model to each client participating in the federated training; Each client updates its local model to the global model, and performs test evaluation on its own test set based on the global model, and saves and records the results; After each round of communication, the server evaluates the contribution of each client in the model training process and distributes corresponding rewards.

[0006] Furthermore, the central node sets the server as the requester, publishes collaborative pricing task requirements and federated training requests to the clients corresponding to the target industry, and sets the smart contract according to the joined clients, including: The central node formulates a basic smart contract according to the collaborative pricing task, and publishes the collaborative pricing task and the basic smart contract to the server; wherein the basic smart contract includes a participant authentication protocol, which is used to store information for security and identity authentication of the participant after the task is published; The clients that join are regarded as participants, and the participants agree to uniformly process the smart contract, that is, store the relevant information of the data set that each participant should upload, and stipulate unified data preprocessing rules; The participants agree on a model update smart contract, which stores the model training and update rules of each participant; The server and the client determine the task reward smart contract, which stores the rewards allocated to each client in each round, so that the task reward smart contract can automatically release rewards to each client according to its contribution.

[0007] Furthermore, each client performs unified preprocessing on the local data set to convert the data of each client into data that can participate in training, and divides the training set and the test set into steps, including: The client deletes feature columns that cannot be used for model training, and uses one-hot encoding to convert discrete variables that cannot be used for model training into numerical variables; The client uses the Box-Cox transformation technology to transform the target variable column in the data set and standardize the data set; assuming that the original data is The transformed data is , The transformation formula is as follows: in, is the parameter of the transformation, and the optimal value; The client uses Lasso regression to extract key features from high-dimensional data, sorts the key features by importance, re-screens and organizes the data set, and forms a new data set suitable for federated learning training; The data set is divided into different clients for federated learning computing tasks according to the set ratio, and each client generates a training set and a test set locally according to the division ratio.

[0008] Furthermore, each client constructs a deep learning model framework, trains a price prediction model, calculates the loss value of the model training, evaluates the test set, obtains local model parameters and uploads them to the server, including: Each client builds a deep learning model framework and performs initial settings; Each client trains the price prediction model locally, saves the trained local model, and calculates and saves the evaluation indicators; In each round of communication training, each client trains its own local model and extracts model parameters and uploads them to the server for updating the global model.

[0009] Furthermore, each client constructs a deep learning model framework and performs initial settings, including: Build a deep learning model framework, use Keras to initialize the sequential model, and determine the input feature dimensions of the client; Add a fully connected layer with 200 neurons and use the ReLU activation function, whose formula is: in, is the weight matrix, is the bias vector, is the input feature matrix, is the linear transformation result, is the output after activation; For the noise and regularization layer, a Gaussian noise layer with a standard deviation of 0.25 is added, and a Dropout layer is added to randomly discard 10% of the neurons; For the hidden layer, two fully connected layers are added consecutively, each containing 100 neurons, using the ReLU activation function, and a Dropout layer is followed by each fully connected layer. This operation is performed twice; Add an output layer with 1 neuron and a linear activation function to predict continuous values. If gradient pruning is enabled, a polynomial decay strategy is used to gradually reduce unimportant weights in the model. If gradient clipping is enabled, the Adam optimizer is used and the gradient norm is clipped. Otherwise, the RMSprop optimizer is used. Compile the model, that is, use the mean square error MSE as the loss function and the mean absolute error MAE as the evaluation indicator. The formula is: . in, represents the number of samples, Indicates The actual value of the test sample is the true prediction value. Indicates The predicted value of the test sample is the value predicted by the model based on the input features.

[0010] Furthermore, the server aggregates each model parameter based on the federated average aggregation algorithm to generate a global model parameter to update the global model, and returns the global model to each client participating in the federated training, including: The server initializes the global model parameters and creates an empty array list to store the global model parameters; After the server receives the model parameters, if the model parameters are the model parameters of the first client, the client model parameters are directly copied to the global model parameter list to complete the initialization; if the model parameters are not the model parameters of the first client, the model parameters of the current client are added to the weights in the corresponding global model parameter list to gradually update the global model parameters; In each round of communication, after receiving all client model parameters, the server uses the federated aggregation algorithm FedAvg to calculate the aggregated parameters to update the global model. The global model is returned to each client participating in the federated training.

[0011] Furthermore, after receiving all client model parameters in each round of communication, the server uses the federation aggregation algorithm FedAvg to calculate the aggregated parameters to update the global model, including: Each client participates in the training to form a client set ; take over The local model parameters transmitted; Sending aggregation weight To all clients, where N is the number of clients, Represents the client In the The local parameters of the wheel, Indicates Global parameters of the wheel; Update iteration round for .

[0012] Furthermore, each client updates the local model to the global model, and performs test evaluation on the respective test sets based on the global model, and saves and records the results, including: Before each round of training, clear the client model list to ensure that each client's model is initialized based on the latest global model parameters; The client clones the current global model from the server and creates an independent model copy based on the global model; The client copies the received global model parameters to its model copy to ensure that each client local model has the same initial parameters as the global model, and adds the updated local model to the list of created client models; Reset the flag to ensure that the system starts calculation from scratch at the beginning of the next round of communication, and clear the array storing the aggregated weights to prepare for the next round of global model update; Each client uses the current round global model to make predictions, evaluate the prediction performance, and compare the optimal R 2 Value and historical best R 2 Value, if the current R 2 If the value is greater than the previously recorded optimal R² value, update the optimal R 2 The value is the current R 2 value, and save the optimal global model at the same time, where R 2 The value formula is as follows: in, Client No. The true labels of samples, Indicates The predicted labels of samples, Represents the average of all true values ​​in the test set.

[0013] Furthermore, after each round of communication, the server evaluates the contribution of each client in the model training process and distributes corresponding rewards based on the client's contribution, including: Evaluate the contribution of each client in this round of communication; Each round of communication In the client Fixed income in each round The installment reward is recorded as , whose formula is defined as follows: in, Indicated in Client in round The contribution to the entire task consists of model contribution and cost contribution.

[0014] Furthermore, the step of evaluating the contribution of each client in this round of communication includes: The client In the The model contribution in round communication is recorded as , the formula is as follows: in, Representative Client in round The evaluation value when testing with the global model, Representing the client The test evaluation value of the local model, at the same time, the training cost is recorded as , which is expressed as follows:

[0015] in, Indicates the client dataset size, Represents the client In the The iteration time of the round, and Indicates the linear relationship between the two; The contribution value of each client is calculated based on the defined indicators. The formula is: .

[0016] The present invention also provides a pricing and incentive device for federated learning computing tasks, based on a central node, a server and multiple clients, the device comprising: A request module, which is used for the central node to set up the server as the requester, publish collaborative pricing tasks and federated training requests to the client platform corresponding to the target industry, and jointly set up smart contracts with the joined clients; The processing module is used for each client to pre-process the local data set in a unified manner, so as to convert the data of each client into data that can participate in training, and divide it into training set and test set; The training module is used by each client to build a deep learning model framework, train the price prediction model, calculate the loss value of the model training, evaluate the test set, obtain the local model parameters and upload them to the server; The update module is used by the server to aggregate the model parameters based on the federated average aggregation algorithm to generate global model parameters to update the global model, and return the global model to each client participating in the federated training; The saving module is used for each client to update the local model to the global model, and to test and evaluate the respective test sets based on the global model, and to save and record the results; The contribution evaluation and reward module is used by the server to evaluate the contribution of each client and allocate corresponding rewards based on the contribution of each client in the model training process after each round of communication.

[0017] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0018] The present invention also provides a computer-readable storage medium on which a computer program is stored, and the computer program implements the steps of the above method when executed by a processor.

[0019] The beneficial effects of the present invention are: 1. In order to solve the problem of data resource sharing, federated learning modeling is implemented between clients, i.e. data holding platforms. While ensuring that the original data does not leave the domain, collaborative pricing is carried out through the historical transaction behavior data that each party has. This is suitable for data resource price prediction scenarios, thereby realizing intelligent pricing of data resources.

[0020] 2. Establishing a cross-platform collaborative pricing model for data resources can significantly improve the accuracy of the pricing model. Compared with the pricing model of local data resources on a single platform, the maximum percentage increase in accuracy is 25.43%.

[0021] 3. In the established collaborative pricing model based on federated learning, an incentive mechanism based on contribution evaluation is introduced. The designed incentive mechanism comprehensively considers the contribution made by the model in the aggregation process, and better reflects feasibility and fairness. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is a system architecture diagram for pricing and incentives in the present invention.

[0023] Figure 2 It is a flowchart of the pricing and incentive method in the present invention.

[0024] Figure 3This is a flow chart of the federation incentive between the server and the client in the present invention.

[0025] Figure 4 This is a price prediction deviation diagram between a single model of a client and a federated model in Experiment 1 of the present invention.

[0026] Figure 5 This is a comparison chart of model evaluation for local single training, centralized training, and federated training for all clients in Experiment 2 of the present invention.

[0027] Figure 6 This is a diagram showing the fairness verification effect of the incentive mechanism adopted by the client in Experiment 4 of the present invention.

[0028] Figure 7 FIG. 1 is a schematic diagram of a device structure according to an embodiment of the present invention.

[0029] Figure 8 The figure is a schematic diagram of the internal structure of a computer device according to an embodiment of the present invention.

[0030] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0031] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0032] like Figure 1 As shown, the pricing and incentive system architecture of the present invention includes four parts: Task release part: used to store cooperation rules and release federated training task requests, including setting collaborative pricing task goals, signing smart contracts, and setting reward budgets. The task release part is used by the requester to set collaborative pricing task goals and requirements, budgets and contracts, etc. The contract is formulated to escort the cross-platform collaborative process, including four smart contracts: client authentication, unified processing, model update, and task reward, which are used to store specific information and results of each operation in the collaborative process.

[0033] Federated training part: used to train the collaborative pricing task model between platforms. By building a deep learning architecture to train the pricing model, the uploaded model parameters are aggregated using a federated method to form a global pricing model. The local participating clients update the local model to the global model, and retrain the local model. The training is iterated in sequence until the training termination conditions are met. The federated training part is used to implement a cross-platform collaborative pricing model, using an optimized deep learning architecture and a federated aggregation algorithm to train the optimal local and global models applicable to all parties.

[0034] Incentive part: used to allocate corresponding rewards to clients according to their contributions. According to the training evaluation results in each round of communication, rewards are allocated to clients according to their contributions. The contribution and consumption of the client in this round of training are calculated, and corresponding rewards are allocated according to the contribution and consumption ratio. The incentive part is used to calculate the contribution of the participating platform and allocate rewards accordingly. It adopts an incentive mechanism based on contribution evaluation to reward all parties in a way that reflects collaborative fairness.

[0035] Pricing part: used to use the trained optimal local model and global model to benchmark data resources. Each client adjusts the factors of the pricing strategy according to demand and market changes to update its pricing strategy. The pricing part is used to use the trained global pricing model or local pricing model for the client to implement benchmark pricing for data resources. On this basis, all parties adjust prices appropriately according to demand and market changes, form new transaction records, continue to participate in federated training, and continuously optimize the model.

[0036] like Figure 2 , 3 As shown, the present invention provides a pricing and incentive method for federated learning computing tasks, based on the above system architecture, including a central node, a server and multiple clients. The method specifically includes: S1. System initialization. The central node sets up the server as the requester, publishes collaborative pricing tasks and federated training requests to the client platform corresponding to the target industry, and the client chooses whether to join the federated training request to determine the multiple clients that join the federated training request, and then sets up the smart contract, and the joint modeling concept is established.

[0037] Step S1 specifically includes: S1.1. The central node formulates a basic smart contract based on the collaborative pricing task, and publishes the collaborative pricing task and the basic smart contract to the federated learning server set up by the central node; wherein, the basic smart contract includes a participant authentication protocol, which is used to store information for security and identity authentication of the participants after the task is published, so as to ensure the legality and rationality of the client platform and prevent malicious participants from disrupting cooperation.

[0038] S1.2. Each client decides whether to participate in the task and complete the smart contract based on its own needs.

[0039] Step S1.2 specifically includes: S1.2.1. The clients that join are regarded as participants. After the legal participants are determined, the participants agree on a unified smart contract. The smart contract is used to store the relevant information of the data set that each participant should upload and stipulates a unified data preprocessing rule. S1.2.2. The participants agree on a model update smart contract, which is used to store the model training and update rules of each participant. The rules mainly include aggregation strategies, model performance measurement results, etc. S1.2.3. The server and the client determine the task reward smart contract, which is used to store the rewards allocated to each client in each round, so that the task reward smart contract can automatically release rewards to each client based on its contribution, mainly including the designed incentive mechanism, the model test results of each party in each round, contribution distribution, etc.

[0040] S2. Preprocessing of local data sets: crawl the transaction data sets of Guoxin Youyi platform and JD Wanxiang platform, and divide them into five client platforms according to a certain ratio. Each client performs unified preprocessing on the local data set to convert the data of each client into data that can participate in training, and divide it into training set and test set.

[0041] Step S2 specifically includes: S2.1, the client deletes feature columns that cannot be used for model training, and uses one-hot encoding to convert discrete variables that cannot be used for model training into numerical variables; S2.2. The client uses the Box-Cox transformation technology to transform the non-normal distribution data such as the target variable column of the participant in the data set to make it closer to the normal distribution, so that the analysis results are more reliable and accurate, and the data set is standardized at the same time. The transformed data is , the transformation formula is as follows:

[0042] in, is the parameter of the transformation, and the optimal value.

[0043] S2.3. The client uses Lasso regression to extract key features from high-dimensional data, sorts the key features by importance, re-screens and organizes the data set, and forms a new data set suitable for federated learning training.

[0044] Step S2.3 specifically includes: S2.3.1, divide the data set into feature matrix X and target variable y; S2.3.2. Determine the range of the regularization parameter of the Lasso model using an exponentially growing sequence As the regularization parameter of the Lasso model, and from arrive The value is taken evenly between ; S2.3.3. Regularization parameter for the value

[0045] , train the Lasso model and collect the coefficients after each training, where the objective function expression of Lasso regression is: in is the regularization parameter, which controls the sparsity of the model. is the regression coefficient.

[0046] S2.3.4. Choose an appropriate regularization parameter Train the Lasso model and obtain the final coefficients. Then, calculate the importance of each feature and sort them according to the coefficient values ​​in the Lasso model. S2.3.5. Sort the data set according to the order of feature importance to form a new data set.

[0047] S2.4. To simulate the situation in reality where the number of transaction data sets on different platforms is inconsistent, the data set is divided into different clients of the federated learning computing task according to the set ratio. Each client then generates a training set and a test set locally according to the division ratio.

[0048] S3. Each client builds a deep learning model framework, trains a price prediction model, calculates the loss value of the model training, and saves the trained model to the client model list; then, the test set is evaluated and the evaluation results are saved, and each client uploads the trained local model parameters to the server.

[0049] Step S3 specifically includes: S3.1. Each client builds a deep learning model framework and performs initial settings.

[0050] Step S3.1 specifically includes: S3.1.1. Model initialization: Use Keras to initialize the sequential model and determine the input feature dimension of the client. S3.1.2. Add a fully connected layer with 200 neurons and use the ReLU activation function, whose formula is: in, is the weight matrix, is the bias vector, is the input feature matrix, is the linear transformation result, is the output after activation; S3.1.3. For the noise and regularization layer, add a Gaussian noise layer with a standard deviation of 0.25, add a Dropout layer, and randomly discard 10% of the neurons to prevent overfitting; S3.1.4. For the hidden layer, add two fully connected layers in succession, each containing 100 neurons, and use the ReLU activation function. Follow each fully connected layer with a Dropout layer. This operation is performed twice. S3.1.5. Add an output layer containing 1 neuron and using a linear activation function to predict continuous values. S3.1.6, Gradient pruning and gradient clipping: If gradient pruning is enabled, a polynomial decay strategy is used to gradually reduce unimportant weights in the model; if gradient clipping is enabled, the Adam optimizer is used and the gradient norm is clipped to prevent gradient explosion, otherwise the RMSprop optimizer is used, and the polynomial decay formula is as follows:

[0051] in, Indicates The sparsity of the step time, represents the sparsity at the beginning of training, represents the sparsity at the end of training, Indicates the current number of steps. represents the total number of training steps, The exponent of the polynomial decay, usually defaults to 1, indicating linear decay.

[0052] S3.1.7, Model compilation: The mean square error (MSE) is used as the loss function, and the mean absolute error (MAE) is used as the evaluation index. The formula is: in, represents the number of samples, Indicates The actual value of the test sample is the true prediction value. Indicates The predicted value of the test sample is the value predicted by the model based on the input features.

[0053] S3.2. Each client trains the price prediction model locally, saves the trained local model, and calculates and saves the evaluation index; S3.3. In each round of communication training, each client trains its own local model and extracts model parameters and uploads them to the server for updating the global model.

[0054] S4. The server aggregates the model parameters based on the federated average aggregation algorithm to generate global model parameters to update the global model, and returns the global model to each client participating in the federated training.

[0055] Step S4 specifically includes: S4.1. The server receives the local model parameters uploaded by each client and performs integrity and consistency checks on them to ensure that the data is not lost or damaged.

[0056] S4.2. Generate global model parameters based on the federated average aggregation algorithm, and update the calculated global model parameters to the global model on the server.

[0057] Step S4.2 specifically includes: S4.2.1. The server initializes the global model parameters and creates an empty array list to store the global model parameters. After receiving the model parameters from the first client, the server stores them in the list to complete the initialization of the global model.

[0058] S4.2.2, after the server receives the model parameters, it is divided into the following two cases: if the model parameters are the model parameters of the first client, the client model parameters are directly copied to the global model parameter list to complete the initialization; if the model parameters are not the model parameters of the first client, the model parameters of the current client are added to the weights in the corresponding global model parameter list to gradually update the global model parameters; S4.2.3. After the server receives all the client model parameters in each round of communication, the new global model parameter list will summarize the weighted sum of all the client model parameters, and the federated aggregation algorithm FedAvg will be used to calculate the aggregated parameters to update the global model; the global model problem is expressed as follows: in, represents the loss function, Representation sample The predicted value of Representation sample The actual value of .

[0059] Step S4.2.3 includes: S4.2.3.1. Each client participates in training to form a client set ; S4.2.3.2. Receiving The local model parameters transmitted; S4.2.3.3. Sending down the aggregation weight To all clients, where N is the number of clients, Represents the client In the The local parameters of the wheel, Indicates Global parameters of the wheel; S4.2.3.4. Update iterative rounds for .

[0060] S4.4. Return the global model to each client participating in the federated training.

[0061] S5. Each client updates the local model to the global model, and performs test evaluation on its own test set based on the global model, and saves and records the results.

[0062] Step S5 specifically includes: S5.1. Before each round of training, clear the client model list to ensure that each client model is initialized based on the latest global model parameters. S5.2, after the server completes the update of the global model, the client clones the current global model from the server and creates an independent model copy based on the global model; S5.3, the client copies the received global model parameters to its model copy to ensure that each client local model has the same initial parameters as the global model, and adds the updated local model to the created client model list; S5.4, reset the flag to ensure that the system starts calculation from scratch at the beginning of the next round of communication, and clear the array storing the aggregate weights to prepare for the next round of global model update; S5.5. Each client uses the current round global model to make predictions, evaluate the prediction performance, and compare the optimal R 2 Value and historical best R 2 Value, if the current R 2 If the value is greater than the previously recorded optimal R² value, update the optimal R 2 The value is the current R 2 value, and save the optimal global model at the same time, where R 2 The value formula is as follows: in, Client No. The true labels of samples, Indicates The predicted labels of samples, Represents the average of all true values ​​in the test set.

[0063] S6. Contribution evaluation and rewards: After each round of communication, the server evaluates the contribution of each client in the model training process and distributes corresponding rewards.

[0064] Step S6 specifically includes: S6.1, evaluate the contribution of each client in this round of communication; Step S6.1 specifically includes: S6.1.1. Contribution indicator definition: record the test evaluation indicator values ​​of the local model and each round of the global model and , and and The quantitative relationship as a client platform In the The basis for the round model training effect. In the The model contribution in round communication is recorded as

[0065] , the formula is as follows: in, Representative Client platform in round The evaluation value when testing with the global model, Represents the client platform The test evaluation value of the local model. The contribution is not only related to the model evaluation effect of the platform, but also to the amount of data provided by each platform, the training time, the communication cost, etc. The training cost of the client is linearly related to the size of its data set, and k is the linear relationship between the two. In addition, the training cost can be measured by calculating the time it takes to train the local model on the client, where t represents the linear relationship between the two. The training cost is recorded as , which is expressed as follows:

[0066] in, Indicates the client dataset size, Represents the client In the The iteration time of the round, and Indicates the linear relationship between the two; S6.1.2 Contribution calculation: Calculate the contribution value of each client based on the defined indicators. The formula is: .

[0067] S6.2. Incentive Allocation and Notification: Each Round of Communication In the client Fixed income in each round The installment reward is recorded as , whose formula is defined as follows:

[0068] in, Indicated in Client in round The contribution to the entire task consists of model contribution and cost contribution.

[0069] S7. Start the next round of federal incentive process and repeat the process from S3 to S6 until the set end condition is reached.

[0070] In order to illustrate the effect of the present invention, the present invention collects transaction record data sets from different platforms and randomly divides them into multiple client platforms, and conducts the following four experiments: Experiment 1: To verify that the federated global prediction model built through multi-platform collaboration has better generalization ability, a client participating in the federated collaboration experiment was selected to explore its model generalization ability. The global model trained by all clients was used to fit the test set of client P1, and the effect of client P1 using a single model trained using its own local transaction behavior dataset to predict the price of the remaining data resources was compared. The prediction deviation results are shown in the figure below. Figure 4 As shown in the figure, it can be seen that the federated model obtained by multi-party collaborative training has better model prediction effect and shows stronger model generalization ability.

[0071] Experiment 2: This paper will explore the comparison results of the platform using a single model and a global model to predict data resource prices, in order to fully understand the advantages of federated learning in collaborative pricing. This paper compares the prediction effects of the client's local prediction model training, centralized model training, and global model training with federated learning collaborative multi-party training, and obtains the R of all clients. 2 Compared with the MSE indicator results, see Figure 5 .from Figure 5 As can be seen from the figure, the single-point training model effect of each client is lower than the model effect of federated training, especially P3, P4, and P5. The highest performance improvement is on client P5, whose R 2 The value of the proposed design increased by 25.43% and the MSE decreased by 26.86%. The experiment shows the effectiveness of the design of the present invention, and indirectly shows that it is impossible to learn the global distribution characteristics of the data through the data of only one client, and the universality of the model is also poor. At the same time, this also proves that under the premise of protecting data security, the federated learning strategy is adopted, and multiple parties are jointly trained to establish a data resource pricing model suitable for cross-platform needs. Richer and more diverse training set samples improve the accuracy of price prediction.

[0072] Experiment 3: Multi-model comparative analysis experiment. In order to verify that the model obtained through collaborative training is better than the local model and the centralized training model, multiple models including GAN, CNN, RNN, CNN_LSTM, LSTM are selected to compare with their federated model and centralized training model. The main model used is R 2 The comparison results of the indicators are shown in Table 1. From the table, we can see that the overall prediction accuracy of the model is better than the local prediction effects and centralized prediction effects of multiple existing deep learning models. The bold description is the optimal training effect of each client.

[0073] Table 1 Comparison of training effects among local, centralized and federated ends

[0074] Experiment 4: Evaluation of the effectiveness of the incentive mechanism. In order to verify the feasibility and fairness of the incentive mechanism, the Pearson correlation coefficient of contribution and reward is used to quantify the collaborative fairness of the mechanism. The closer the Pearson correlation coefficient is to 1, the stronger the positive correlation is between the two. The closer it is to -1, the stronger the negative correlation is between the two. The closer it is to 0, the weaker the correlation is. The formula for the Pearson correlation coefficient is as follows:

[0075] The correlation between the contribution and reward of each client is calculated based on a certain round of data. Figure 6 shown.

[0076] To verify the effectiveness of the incentive mechanism, the method of the present invention is compared with the LOO method and the setting method, where the setting method is a federated learning reliability incentive mechanism for electric energy data; the entire experimental results are shown in Table 2. The results show that the above-mentioned incentive mechanism comprehensively considers the contribution of the model in the aggregation process, while the setting method and the LOO method are not applicable to the data cooperation situation.

[0077] Table 2 Fairness results of incentive mechanism

[0078] The above experiments have proven the effectiveness and superiority of the present invention.

[0079] like Figure 7 As shown, the present invention also provides a pricing and incentive device for federated learning computing tasks, based on a central node, a server and multiple clients, the device includes: Request module 1, used for the central node to set the server as the requester, publish collaborative pricing tasks and federated training requests to the client platform corresponding to the target industry, and set up smart contracts according to the clients that join; Processing module 2 is used for each client to uniformly preprocess the local data set to convert the data of each client into data that can participate in training, and divide it into a training set and a test set; Training module 3 is used for each client to build a deep learning model framework, train the price prediction model, calculate the loss value of the model training, evaluate the test set, obtain the local model parameters and upload them to the server; Update module 4, used for the server to aggregate the model parameters based on the federated average aggregation algorithm to generate global model parameters to update the global model, and return the global model to each client participating in the federated training; Saving module 5 is used for each client to update the local model to the global model, and to test and evaluate the respective test sets based on the global model, and to save and record the results; The contribution evaluation and reward module 6 is used by the server to evaluate the contribution of each client and distribute corresponding rewards based on the contribution of each client in the model training process after each round of communication.

[0080] Loop module 7 is used to start the next round of federal incentive process and repeat modules 3 to 6 until the set end condition is reached.

[0081] In one embodiment, the request module 1 includes: A publishing unit is used for the central node to formulate a basic smart contract according to the collaborative pricing task, and publish the collaborative pricing task and the basic smart contract to the server; wherein the basic smart contract includes a participant authentication protocol, which is used to store information for security and identity authentication of the participant after the task is published; The first agreement unit is used to treat the joined clients as participants, and the participants agree to uniformly process the smart contract, that is, store the relevant information of the data set to be uploaded by each participant, and stipulate a unified data preprocessing rule; The second agreement unit is used for the participants to agree on the model update smart contract, that is, to store the model training and update rules of each participant; The determination unit is used for the server and the client to determine the task reward smart contract, that is, to store the rewards allocated to each client in each round, so that the task reward smart contract can automatically release rewards to each client according to its contribution.

[0082] In one embodiment, the processing module 2 includes: The conversion unit is used by the client to delete feature columns that cannot be used for model training, and convert discrete variables that cannot be used for model training into numerical variables using one-hot encoding; The transformation unit is used by the client to transform the target variable column in the data set using the Box-Cox transformation technology and standardize the data set; where the original data is The transformed data is , the transformation formula is as follows:

[0083] in, is the parameter of the transformation, and the optimal value; The extraction unit is used by the client to extract key features from high-dimensional data using Lasso regression, sort the key features by importance, re-screen and organize the data set, and form a new data set suitable for federated learning training; The partitioning unit is used to divide the data set into different clients of the federated learning computing task according to the set ratio. Each client then generates a training set and a test set locally according to the partitioning ratio.

[0084] In one embodiment, the training module 3 includes: The construction unit is used by each client to build a deep learning model framework and perform initial settings; The saving unit is used for each client to train the price prediction model locally, save the trained local model, and calculate and save the evaluation index; The upload unit is used to enable each client to train its own local model during each round of communication training, and to extract model parameters and upload them to the server for updating the global model.

[0085] In one embodiment, the building block comprises: Initialization subunit, used to build a deep learning model framework, using Keras to initialize the sequential model and determine the input feature dimension of the client; The first adding subunit is used to add a fully connected layer with 200 neurons, using the ReLU activation function, whose formula is: in, is the weight matrix, is the bias vector, is the input feature matrix, is the linear transformation result, is the output after activation; The second adding subunit is used for the noise and regularization layer, adding a Gaussian noise layer with a standard deviation of 0.25, adding a Dropout layer, and randomly discarding 10% of the neurons; The third adding subunit is used to add two layers of fully connected layers to the hidden layer, each layer contains 100 neurons, uses the ReLU activation function, and follows a Dropout layer after each fully connected layer. This operation is performed twice; The fourth adding subunit is used to add an output layer, which includes 1 neuron and uses a linear activation function to predict continuous values; The optimization subunit is used to gradually reduce the unimportant weights in the model using a polynomial decay strategy when gradient pruning is enabled, and to use the Adam optimizer and clip the gradient norm when gradient clipping is enabled, otherwise the RMSprop optimizer is used; The compilation subunit is used to compile the model, that is, the mean square error MSE is used as the loss function and the mean absolute error MAE is used as the evaluation index. The formula is: in, represents the number of samples, Indicates The actual value of the test sample is the true prediction value. Indicates The predicted value of the test sample is the value predicted by the model based on the input features.

[0086] In one embodiment, the updating module 4 includes: Create a unit to initialize global model parameters on the server side and create an empty array list to store global model parameters; A model updating unit, which is used for, after the server receives the model parameters, if the model parameters are the model parameters of the first client, directly copying the client model parameters to the global model parameter list to complete the initialization; if the model parameters are not the model parameters of the first client, adding the model parameters of the current client to the weights in the corresponding global model parameter list to gradually update the global model parameters; The parameter calculation unit is used to calculate the aggregated parameters using the federated aggregation algorithm FedAvg after the server receives all the client model parameters in each round of communication, so as to update the global model; The returning unit is used to return the global model to each client participating in the federated training.

[0087] In one embodiment, the parameter calculation unit includes: The sub-unit is used by each client to participate in the training and form a client set ; The receiving subunit is used to receive The local model parameters transmitted; Sub-unit for sending aggregation weights To all clients, where N is the number of clients, Represents the client In the The local parameters of the wheel, Indicates Global parameters of the wheel; Iterator unit, used to update the iteration round for .

[0088] In one embodiment, the storage module 5 includes: The clearing unit is used to clear the client model list before each round of training to ensure that each client model is initialized based on the latest global model parameters; The cloning unit is used by the client to clone the current global model from the server and create an independent model copy based on the global model; The parameter replication unit is used for the client to copy the received global model parameters to its model copy to ensure that each client local model has the same initial parameters as the global model, and to add the updated local model to the created client model list; The array clearing unit is used to reset the flag bit to ensure that the system starts calculation from scratch at the beginning of the next round of communication. At the same time, it clears the array storing the aggregate weights to prepare for the next round of global model update. The evaluation unit is used by each client to use the current round global model to make predictions, evaluate the prediction performance, and compare the optimal R 2 Value and historical best R 2 Value, if the current R 2 The value is greater than the previously recorded optimal R² value, and the optimal R 2 The value is the current R 2 value, and save the optimal global model at the same time, where R 2 The value formula is as follows: in, Client No. The true labels of samples, Indicates The predicted labels of samples, Represents the average of all true values ​​in the test set.

[0089] In one embodiment, the contribution evaluation and reward module 6 includes: A contribution evaluation unit is used to evaluate the contribution of each client in this round of communication; Reward unit, used for each round of communication In the client Fixed income in each round The installment reward is recorded as , whose formula is defined as follows:

[0090] in, Indicated in Client in round The contribution to the entire task consists of model contribution and cost contribution.

[0091] In one embodiment, the contribution evaluation unit includes: Contribution record subunit, used to record the client In the The model contribution in round communication is recorded as , the formula is as follows:

[0092] in, Representative Client in round The evaluation value when testing with the global model, Representing the client The test evaluation value of the local model, at the same time, the training cost is recorded as , which is expressed as follows: in, Indicates the client dataset size, Represents the client In the The iteration time of the round, and Indicates the linear relationship between the two; The contribution value calculation subunit is used to calculate the contribution value of each client according to the defined indicators. The formula is: .

[0093] The above modules, units, and sub-units are all used to correspond to the various steps in the pricing and incentive method for executing the above-mentioned federated learning computing tasks. The specific implementation method thereof is described in the above-mentioned method embodiment and will not be repeated here.

[0094] like Figure 8 As shown, the present invention also provides a computer device, which can be a server, and its internal structure can be as shown in Figure 8As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store all data required for the process of pricing and incentive methods for federated learning computing tasks. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the pricing and incentive methods for federated learning computing tasks are implemented.

[0095] Those skilled in the art will understand that Figure 8 The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.

[0096] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the pricing and incentive method for any of the above-mentioned federated learning computing tasks.

[0097] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0098] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0099] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A pricing and incentive method for federated learning computing tasks, characterized in that: Based on a central node, a server and multiple clients, the method includes: The central node sets up the server as the requester, publishes collaborative pricing tasks and federated training requests to the clients corresponding to the target industry, and sets up smart contracts with the clients that join; Each client performs unified preprocessing on the local data set to convert the data of each client into data that can participate in training, and divide it into training set and test set; Each client builds a deep learning model framework, trains the price prediction model, calculates the loss value of the model training, evaluates the test set, obtains the local model parameters and uploads them to the server; The server aggregates the model parameters based on the federated average aggregation algorithm to generate global model parameters to update the global model, and returns the global model to each client participating in the federated training; Each client updates its local model to the global model, and performs test evaluation on its own test set based on the global model, and saves and records the results; After each round of communication, the server evaluates the contribution of each client in the model training process and distributes corresponding rewards.

2. The pricing and incentive method for federated learning computing tasks according to claim 1, characterized in that: The central node sets the server as the requester, publishes collaborative pricing task requirements and federated training requests to the clients corresponding to the target industry, and sets the steps of smart contracts according to the clients that join, including: The central node formulates a basic smart contract according to the collaborative pricing task, and publishes the collaborative pricing task and the basic smart contract to the server; wherein the basic smart contract includes a participant authentication protocol, which is used to store information for security and identity authentication of the participant after the task is published; The clients that join are regarded as participants, and the participants agree to uniformly process the smart contract, that is, store the relevant information of the data set that each participant should upload, and stipulate unified data preprocessing rules; The participants agree on a model update smart contract, which stores the model training and update rules of each participant; The server and the client determine the task reward smart contract, which stores the rewards allocated to each client in each round, so that the task reward smart contract can automatically release rewards to each client according to its contribution.

3. The pricing and incentive method for federated learning computing tasks according to claim 1, characterized in that: The steps of each client performing unified preprocessing on the local data set to convert the data of each client into data that can participate in training, and dividing the training set and the test set include: the client deletes the feature columns that cannot be used for model training, and uses one-hot encoding to convert the discrete variables that cannot be put into the model training into numerical variables; The client uses the Box-Cox transformation technology to transform the target variable column in the data set and standardize the data set; assuming that the original data is The transformed data is , The transformation formula is as follows: in, is the parameter of the transformation, and the optimal value; The client uses Lasso regression to extract key features from high-dimensional data, sorts the key features by importance, re-screens and organizes the data set, and forms a new data set suitable for federated learning training; The data set is divided into different clients for federated learning computing tasks according to the set ratio, and each client generates a training set and a test set locally according to the division ratio.

4. The pricing and incentive method for federated learning computing tasks according to claim 1, characterized in that: The steps of each client building a deep learning model framework, training a price prediction model, calculating the loss value of the model training, evaluating the test set, obtaining local model parameters and uploading them to the server include: Each client builds a deep learning model framework and performs initial settings; Each client trains the price prediction model locally, saves the trained local model, and calculates and saves the evaluation indicators; In each round of communication training, each client trains its own local model and extracts model parameters and uploads them to the server for updating the global model.

5. The pricing and incentive method for federated learning computing tasks according to claim 4, characterized in that: The steps of each client building a deep learning model framework and performing initial settings include: Build a deep learning model framework, use Keras to initialize the sequential model, and determine the input feature dimensions of the client; Add a fully connected layer with 200 neurons and use the ReLU activation function, whose formula is: in, is the weight matrix, is the bias vector, is the input feature matrix, is the linear transformation result, is the output after activation; For the noise and regularization layer, a Gaussian noise layer with a standard deviation of 0.25 is added, and a Dropout layer is added to randomly discard 10% of the neurons; For the hidden layer, two fully connected layers are added consecutively, each containing 100 neurons, using the ReLU activation function, and a Dropout layer is followed by each fully connected layer. This operation is performed twice; Add an output layer with 1 neuron and a linear activation function to predict continuous values. If gradient pruning is enabled, a polynomial decay strategy is used to gradually reduce unimportant weights in the model. If gradient clipping is enabled, the Adam optimizer is used and the gradient norm is clipped. Otherwise, the RMSprop optimizer is used. Compile the model, that is, use the mean square error MSE as the loss function and the mean absolute error MAE as the evaluation indicator. The formula is: in, represents the number of samples, Indicates The actual value of the test sample is the true prediction value. Indicates The predicted value of the test sample is the value predicted by the model based on the input features.

6. The pricing and incentive method for federated learning computing tasks according to claim 1, characterized in that: The server aggregates each model parameter based on the federated average aggregation algorithm to generate a global model parameter to update the global model, and returns the global model to each client participating in the federated training, including: The server initializes the global model parameters and creates an empty array list to store the global model parameters; After the server receives the model parameters, if the model parameters are the model parameters of the first client, the client model parameters are directly copied to the global model parameter list to complete the initialization; if the model parameters are not the model parameters of the first client, the model parameters of the current client are added to the weights in the corresponding global model parameter list to gradually update the global model parameters; In each round of communication, after receiving all client model parameters, the server uses the federated aggregation algorithm FedAvg to calculate the aggregated parameters to update the global model. The global model is returned to each client participating in the federated training.

7. The pricing and incentive method for federated learning computing tasks according to claim 6, characterized in that: The step of using the federated aggregation algorithm FedAvg to calculate the aggregated parameters after receiving all client model parameters in each round of communication to update the global model includes: Each client participates in the training to form a client set ; take over The local model parameters transmitted; Sending aggregation weight To all clients, where N is the number of clients, Represents the client In the The local parameters of the wheel, Indicates Global parameters of the wheel; Update iteration round for .

8. The pricing and incentive method for federated learning computing tasks according to claim 1, characterized in that: The steps of each client updating the local model to the global model, and performing test evaluation on the respective test sets based on the global model, and saving and recording the results include: Before each round of training, clear the client model list to ensure that each client model is initialized based on the latest global model parameters; The client clones the current global model from the server and creates an independent model copy based on the global model; The client copies the received global model parameters to its model copy to ensure that each client local model has the same initial parameters as the global model, and adds the updated local model to the list of created client models; Reset the flag to ensure that the system starts calculation from scratch at the beginning of the next round of communication, and clear the array storing the aggregated weights to prepare for the next round of global model update; Each client uses the current round global model to make predictions, evaluate the prediction performance, and compare the optimal R 2 Value and historical best R 2 Value, if the current R 2 The value is greater than the previously recorded optimal R² value, and the optimal R 2 The value is the current R 2 value, and save the optimal global model at the same time, where R 2 The value formula is as follows: in, Client No. The true labels of samples, Indicates The predicted labels of samples, Represents the average of all true values ​​in the test set.

9. The pricing and incentive method for federated learning computing tasks according to claim 1, characterized in that: After each round of communication, the server evaluates the contribution of each client in the model training process and distributes corresponding rewards based on the client's contribution, including: Evaluate the contribution of each client in this round of communication; Each round of communication In the client Fixed income in each round The installment reward is recorded as , whose formula is defined as follows: in, Indicated in Client in round The contribution to the entire task consists of model contribution and cost contribution.

10. The pricing and incentive method for federated learning computing tasks according to claim 9, characterized in that: The step of evaluating the contribution of each client in this round of communication includes: The client In the The model contribution in round communication is recorded as , the formula is as follows: in, Representative Client in round The evaluation value when testing with the global model, Representing the client The test evaluation value of the local model, at the same time, the training cost is recorded as , which is expressed as follows: in, Indicates the client dataset size, Represents the client In the The iteration time of the round, and Indicates the linear relationship between the two; The contribution value of each client is calculated based on the defined indicators. The formula is: .

Citation Information

Cited By

  • Space-time compression joint optimization method, device and system for federated learning

    CN122175039A

  • Big language model pre-training method and device based on federal learning

    CN122242656A

  • Federated learning based large language model pre-training method and apparatus

    CN122242656B