Blockchain-based model training method and device, electronic equipment and storage medium

By deploying smart contracts and data catalogs on the blockchain, and combining smart contracts with model training for multiple data owners, the problem of data leakage was solved, and the accuracy and security of the prediction model were improved.

CN116910562BActive Publication Date: 2026-04-14SHANGHAI SILK ROAD CLOUD INFORMATION CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-04
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, when multiple data owners train models, data leakage is difficult to avoid, and the training data is limited to a single data owner, which causes the predictive performance of the predictive model to be limited by the data scenario and business.

Method used

A blockchain-based model training method is adopted. By deploying smart contracts on the blockchain and using data cataloging on the chain, the security of the trained model is ensured by combining smart contracts and consortium blockchains. The model training is completed by multiple participants executing smart contracts in sequence, which reduces computational complexity and the risk of data leakage.

Benefits of technology

It improves the accuracy of the prediction model, ensures the security of the original data of all parties involved, reduces the computational complexity caused by iterative training of the model, and avoids data leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116910562B_ABST
    Figure CN116910562B_ABST
Patent Text Reader

Abstract

The application provides a blockchain-based model training method and device, electronic equipment and storage medium, which are applied to a smart contract deployed on a blockchain. The method comprises the following steps: loading sample data in the intranet of a current participant according to the data directory uploaded to the blockchain by the device of the current participant; loading a to-be-trained model of the current participant; calling a model training interface corresponding to the current participant, and uploading the trained model of the current participant to the blockchain. In the blockchain, the on-chain data directory is used to ensure the safety of the original data of each participant. On this basis, the smart contract is combined to enable each participant to update the trained model by executing the processing of the smart contract once, thereby reducing the calculation complexity caused by model iteration training and avoiding data leakage in the training process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of model training technology, and more specifically, to a blockchain-based model training method, apparatus, electronic device, and storage medium. Background Technology

[0002] In order to ensure the accuracy of predictions during the training of prediction models, it is usually necessary to collect a sufficiently large amount of training and scoring datasets for data mining to obtain high-performance prediction models.

[0003] Existing training methods often involve collecting training data from a single data owner, and after collecting the training dataset and the scoring dataset, performing data mining to generate a predictive model.

[0004] However, the training data in this training scheme is limited to a single data owner, causing the predictive performance of the model to be constrained by the data scenario and business requirements. To improve the model's accuracy, it is necessary to collect training and scoring datasets from multiple data owners. How to avoid data leakage during the collection process from multiple data owners is a problem that this application urgently needs to solve. Summary of the Invention

[0005] The purpose of this application is to address the shortcomings of the prior art by providing a blockchain-based model training method, apparatus, electronic device, and medium to solve the problem of data leakage when multiple data owners conduct model training in the prior art.

[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:

[0007] In a first aspect, one embodiment of this application provides a blockchain-based model training method applied to smart contracts deployed on a blockchain, the method comprising:

[0008] Based on the data directory uploaded to the blockchain by the current participant's device, sample data is loaded into the intranet of the current participant, wherein the data directory is used to indicate the storage location of data related to the target business;

[0009] Load the training model of the current participant, wherein the training model of the current participant is trained by the device of the previous participant in the participant sequence;

[0010] The model training interface corresponding to the current participant is invoked to trigger the device of the current participant to train the model to be trained based on the sample data, and the trained model of the current participant is uploaded to the blockchain.

[0011] As one possible implementation, after uploading the trained model of the current participant to the blockchain, the method further includes:

[0012] The trained model is scored based on the scoring sample data uploaded by the current participants to obtain the scoring result;

[0013] Based on the scoring results and the current participant's ranking in the participant sequence, the model contribution evaluation result of the current participant is determined, wherein the participant sequence includes all participants involved in model training, and each participant is arranged in a preset order.

[0014] The evaluation results of the current participants' model contributions are stored in the blockchain.

[0015] As one possible implementation, the step of scoring the trained model based on the scoring sample data uploaded by the current participant to obtain a scoring result includes:

[0016] Obtain the scoring sample data uploaded by the current participant from the public area of ​​the blockchain;

[0017] The trained model is scored based on the scoring sample data to obtain the scoring result.

[0018] As one possible implementation, the participant sequence is pre-uploaded to the blockchain by the leading party's device, and the first participant in the participant sequence is the leading party.

[0019] As one possible implementation, uploading the trained model of the current participant to the blockchain includes:

[0020] The trained model of the current participant and the training completion identifier of the current participant are uploaded to the blockchain so that the next participant of the current participant can start the smart contract through the subscribed event and the participant sequence.

[0021] As one possible implementation, loading the training model of the current participant includes:

[0022] If the current participant is a participant in the participant sequence other than the first participant, then the trained model of the previous participant in the participant sequence is loaded as the model to be trained for the current participant.

[0023] As one possible implementation, loading sample data into the intranet of the current participant based on the data directory uploaded to the blockchain by the current participant's device includes:

[0024] Based on the data catalog, obtain the location of the current participant's sample data within the current participant's intranet;

[0025] Based on the location of the sample data of the current participant in the intranet of the current participant, load the sample data into the intranet of the current participant.

[0026] Secondly, another embodiment of this application provides a blockchain-based model training device, the device comprising:

[0027] The first loading module is used to load sample data into the intranet of the current participant based on the data directory uploaded to the blockchain by the device of the current participant, wherein the data directory is used to indicate the storage location of data related to the target business;

[0028] The second loading module is used to load the training model of the current participant, wherein the training model of the current participant is trained by the device of the previous participant in the participant sequence.

[0029] The training module is used to call the model training interface corresponding to the current participant to trigger the device of the current participant to train the model to be trained based on the sample data, and upload the trained model of the current participant to the blockchain.

[0030] As one possible implementation, after the training module, a scoring module is further included, specifically for:

[0031] The trained model is scored based on the scoring sample data uploaded by the current participants to obtain the scoring result;

[0032] Based on the scoring results and the current participant's ranking in the participant sequence, the model contribution evaluation result of the current participant is determined, wherein the participant sequence includes all participants involved in model training, and each participant is arranged in a preset order.

[0033] The evaluation results of the current participants' model contributions are stored in the blockchain.

[0034] As one possible implementation, the scoring module is specifically used for:

[0035] Obtain the scoring sample data uploaded by the current participant from the public area of ​​the blockchain;

[0036] The trained model is scored based on the scoring sample data to obtain the scoring result.

[0037] As one possible implementation, the participant sequence is pre-uploaded to the blockchain by the leading party's device, and the first participant in the participant sequence is the leading party.

[0038] As one possible implementation, the training module is specifically used for:

[0039] The trained model of the current participant and the training completion identifier of the current participant are uploaded to the blockchain so that the next participant of the current participant can start the smart contract through the subscribed event and the participant sequence.

[0040] As one possible implementation, the second loading module is specifically used for:

[0041] If the current participant is the first participant in the participant sequence, then the initial model is loaded as the training model for the current participant;

[0042] If the current participant is a participant in the participant sequence other than the first participant, then the trained model of the previous participant in the participant sequence is loaded as the model to be trained for the current participant.

[0043] As one possible implementation, the first loading module is specifically used for:

[0044] Based on the data catalog, obtain the location of the current participant's sample data within the current participant's intranet;

[0045] Based on the location of the sample data of the current participant in the intranet of the current participant, load the sample data into the intranet of the current participant.

[0046] Thirdly, another embodiment of this application provides an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of any of the methods described in the first aspect above.

[0047] Fourthly, another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, performs the steps of any of the methods described in the first aspect above.

[0048] The beneficial effects of this application are as follows: In the model training method, the introduction of sample data from multiple participants increases the richness of the original data and improves the accuracy of the prediction model. Simultaneously, the use of a data directory on the blockchain ensures the security of the original data of each participant. Furthermore, by combining this with smart contracts, each participant can update the training model by executing the smart contract once in sequence, reducing the computational complexity caused by iterative model training and avoiding data leakage issues during the training process. Attached Figure Description

[0049] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is an exemplary scenario diagram illustrating the blockchain-based model training method provided in this application embodiment;

[0051] Figure 2 A schematic flowchart illustrating the blockchain-based model training method provided in this application embodiment;

[0052] Figure 3 A flowchart illustrating the method for determining model contribution evaluation results in the blockchain-based model training method provided in this application embodiment;

[0053] Figure 4 A flowchart illustrating the method for determining model scoring results in the blockchain-based model training method provided in this application embodiment;

[0054] Figure 5 A schematic flowchart illustrating the sample data loading method in the blockchain-based model training method provided in this application embodiment;

[0055] Figure 6 A schematic diagram of the structure of a blockchain-based model training device provided in an embodiment of this application;

[0056] Figure 7 A schematic diagram of another blockchain-based model training device provided in this application embodiment;

[0057] Figure 8 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0059] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0060] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0061] Existing predictive model training schemes often collect training data from a single data participant. After collecting the training dataset and the scoring dataset, data mining is performed using model algorithms to generate the predictive model. Therefore, the training data in this approach is limited to a single data participant, causing the predictive model's performance to be constrained by the data scenario and business needs, making it difficult to achieve the expected results.

[0062] As another possible implementation, existing technologies employ federated learning to train predictive models for multiple data participants. Each participant downloads the latest model from a central aggregator, calculates its parameters locally, and then sends encrypted model parameters to the aggregator. The aggregator aggregates the encrypted parameters from multiple participants, updates the predictive model, and distributes the updated model back to each participant. Each participant then updates its local predictive model, iterating until the trained model achieves a set accuracy, at which point the training process ends. While this approach allows training on data from multiple participants, the training process is limited by the computational and communication performance of each participant, often requiring a long waiting period. Furthermore, federated learning assumes that each participant is trustworthy during training, making it difficult to avoid data leakage issues.

[0063] This application proposes a blockchain-based model training method to address the aforementioned problems. By introducing blockchain technology into the model training process involving multiple participants, and combining smart contracts and a consortium blockchain, the security of the trained model is ensured. Furthermore, each participant executes the smart contract sequentially to complete model training, reducing the impact of waiting periods caused by limitations in the computational and communication performance of each participant in federated learning. Additionally, each participant executes the smart contract only once during model training, significantly reducing the computational complexity caused by iterative training. Based on this, the use of a separate data catalog on the blockchain ensures the security of the original data of each participant and prevents data leakage.

[0064] First, the scenarios involved in the embodiments of this application will be described. Figure 1 This is an exemplary scenario diagram illustrating the blockchain-based model training method provided in the embodiments of this application, such as... Figure 1 As shown, this scenario may involve a blockchain network and participating parties. There can be multiple participating parties, including a leading party. For example, the first participating party can serve as the leading party in model training. Taking the medical field as an example, each participating party can be a hospital. A participating party's device can refer to a device belonging to the hospital, which can internally access data within the hospital's intranet and externally communicate with the blockchain to complete the functions of this embodiment.

[0065] It's worth noting that each participant's device includes their own model training platform and sample data. Each participant's model training platform is built on their respective intranet and is used to set up the model training environment and provide the interface information for initiating model training. Optionally, each participant's model training platform is used to build the model training environment according to the model algorithm and training process selected and defined by the leading party. After setup, the platform uploads the interface information for initiating model training to the blockchain for use by smart contracts. Each participant processes the content, location, structure, format, and access permissions of the sample data to obtain a data directory, which is then uploaded to the blockchain network for subsequent model training processing.

[0066] Optionally, the lead party can select a model algorithm before training begins, and all participating parties will train the model according to the chosen algorithm. The model algorithm selected by the lead party and the model training process it defines can be adjusted based on the business needs and prediction requirements of the actual application scenario. The model algorithm can be a decision tree algorithm, a time series analysis algorithm, or a support vector machine regression algorithm, etc. Correspondingly, the model training process can be a decision tree algorithm training process, a time series analysis algorithm training process, or a support vector machine regression algorithm training process, etc. Furthermore, each participating party's model training platform can be used to set up training environments for decision tree algorithms, time series analysis algorithms, and support vector machine regression algorithms, etc.

[0067] It is worth noting that the blockchain network may include a blockchain network management system, a data catalog management system, a smart contract management system, a model contribution scoring rule management system, and a model contribution scoring notarization system to execute the steps of the blockchain-based model training method provided in the embodiments of this application.

[0068] It is worth noting that the blockchain network management system creates the blockchain network provided in this application embodiment based on the creation request of the leading party. Simultaneously, it invites other participants to join the blockchain network, enabling each participant to upload their data directory to the blockchain. Furthermore, the smart contracts, models, and model contribution scores within the blockchain network are visible to all participants. Since all participants have joined the same blockchain network, they can register and subscribe to the same training status identifier event. When each participant completes their model training, they can update their training status identifier on the blockchain, allowing other participants to receive the updated status identifier event. This allows each participant to learn about the training completion status of other participants through the status identifier event, ensuring data security for all participants and guaranteeing the credibility of the model training method provided in this application embodiment.

[0069] It is worth noting that the data catalog management system is used to respond to requests from various participants, create data catalogs for all participants in the blockchain network, store data catalogs on the blockchain, and manage all data catalogs in the blockchain network. This allows each participant to quickly access their own data catalog during subsequent model training. At the same time, the data catalogs in the blockchain network are visible to all participants in the blockchain network, enabling all participants to make training adjustment suggestions to the lead party based on the business needs of model training, thus ensuring the accuracy of the trained model.

[0070] It's worth noting that the smart contract management system records the smart contracts created by the leading party on the blockchain and manages smart contracts within the blockchain network. This ensures that all participants can execute model training through smart contracts during subsequent model training, guaranteeing the security, transparency, and immutability of smart contract execution by each participant. Optionally, the leading party can create smart contracts based on the data catalog and model training interface information provided by each participant.

[0071] It is worth noting that the model contribution scoring rule management system creates and stores model contribution scoring rules based on the request of the leading party. This allows each participant to retrieve their own contribution during subsequent model training, and then calculate the contribution record of each participant's trained model based on these contributions. This reduces the impact of the training order on model training. Optionally, the model contribution scoring rules can be obtained through model scoring and the order in which the participants trained their models.

[0072] It is worth noting that the model contribution scoring and notarization system can notarize the contribution records of each participant in the above-mentioned model contribution scoring rule management system and store them in the blockchain network to archive the model contribution process of each participant.

[0073] The following detailed description of the blockchain-based model training method provided in this application, using multiple embodiments, further illustrates this method. For example, it demonstrates how hospitals A, B, and C in the medical field jointly train a model for "anesthesiologist" related business to obtain an anesthesia business prediction model. In this model, hospital A is the leading party, while hospitals B and C are participating parties.

[0074] It should be understood that before the following blockchain-based model training method is executed, the model training platform has already been built on the devices of each participant, and the interface information for starting model training has been uploaded to the blockchain network. The blockchain network already stores the data catalogs, smart contracts, interface information for starting model training, model contribution scoring rules, and the order in which each participant performs model training. Furthermore, each participant has registered for the same training status identifier event and subscribed to this event.

[0075] For example, before the execution of the following blockchain-based model training method, a consortium blockchain is newly established in the blockchain network, with only Hospital A, Hospital B, and Hospital C as members. Hospital A selects a model algorithm and formulates a model training process based on business needs and model prediction goals. Hospitals B and C complete the model training environment setup according to the model training process formulated by Hospital A. The consortium blockchain stores the data directories, model training start interface information, order of ranking in the participant sequence, training order, contribution scoring rules, etc., for Hospitals A, B, and C, respectively. Simultaneously, Hospitals A, B, and C place the scoring sample data used for model scoring in a public area accessible by the smart contract, based on business needs and the prediction model's goals. The data directories of Hospitals A, B, and C include the content, format, and storage location of data related to the "anesthesiologist" business, with the preset participant sequence being Hospitals A, B, and C. Furthermore, Hospitals A, B, and C have registered for the same training status identifier event and subscribed to this training status identifier event.

[0076] Figure 2 This is a flowchart illustrating a blockchain-based model training method provided in an embodiment of this application. The executing entity of this method can be a smart contract deployed on the blockchain. Figure 2 As shown, the method includes:

[0077] S201. Based on the data directory uploaded to the blockchain by the current participant's device, load sample data into the current participant's intranet. The data directory is used to indicate the storage location of data related to the target business.

[0078] Optionally, the aforementioned blockchain can be a consortium blockchain.

[0079] Optionally, the data catalog stores the content, format, and storage location of data related to the target business, as well as the data structure used to identify each participant. The data structure can be the field name, type, etc. of the current participant.

[0080] Optionally, taking the joint training of anesthesia business prediction models by hospitals A, B, and C, with hospital A as the leading party, as an example, this embodiment can be executed sequentially in the order of hospital A -> hospital B -> hospital C. Each time a hospital is reached, that hospital becomes the current participant. The smart contract parses the data directory uploaded to the blockchain network by the current participant's device to obtain the location information of the current participant's sample data, thereby loading the sample data used for model training by the current participant into the model training platform that the current participant has already built.

[0081] For example, when Hospital B is the current participant, the smart contract obtains the location information of Hospital B's sample data in Hospital B's device based on Hospital B's data directory on the consortium blockchain, and then loads Hospital B's sample data into Hospital B's model training platform for model training.

[0082] S202. Load the training model of the current participant, wherein the training model of the current participant is trained by the device of the previous participant in the participant sequence.

[0083] Optionally, before model training, each participant can agree on a model algorithm. This algorithm can include the training framework, spatial hierarchy, etc. The leading party can upload the agreed-upon algorithm to the blockchain network. The smart contract, based on a pre-defined participant sequence, determines the current participant. If the current participant is the first participant in the sequence (i.e., the leading party), the leading party can directly train the model according to the algorithm, and the model trained by the leading party will be used as the training model for the next participant.

[0084] For example, before model training, Hospital A, Hospital B, and Hospital C can agree on a model algorithm, and Hospital A uploads the initial model to the consortium blockchain. When Hospital A is the current participant, Hospital A's device directly trains the model according to the algorithm, and the smart contract loads Hospital A's trained model as Hospital B's model to be trained. Optionally, during the execution of the current participant's smart contract, the smart contract first determines whether the current participant has a previous participant. If the current participant has a previous participant, the model to be trained loaded by the smart contract is determined to be the model trained by the previous participant.

[0085] For example, when hospital B is the current participant, the smart contract determines the model to be loaded based on the participant sequence on the consortium blockchain, and loads the model trained by the previous participant, hospital A.

[0086] S203. Call the model training interface corresponding to the current participant to trigger the current participant's device to train the model to be trained based on the sample data, and upload the trained model of the current participant to the blockchain.

[0087] Optionally, the smart contract calls the model training interface corresponding to the current participant from the startup model training interface information, and drives the current participant's device to train the training model obtained in step S202 based on the sample data obtained in step S201.

[0088] Optionally, after the current participant's device has completed training, the current participant's device will upload the trained model and the current participant's completion status to the blockchain.

[0089] Optionally, the device of the current participant can notify other participants of the current participant's completion status through the blockchain's message notification mechanism, so as to remind the next participant of the current participant.

[0090] For example, when Hospital B is the current participant, the smart contract calls the corresponding model training interface of Hospital B from the startup model training interface information of Hospital B on the consortium blockchain, driving Hospital B's device to train the trained model of Hospital A obtained in step S202 based on the sample data of Hospital B obtained in step S201 above. Simultaneously, after Hospital B's device completes training, the trained model of Hospital B and the completion status of the current participant are updated on the consortium blockchain.

[0091] The beneficial effects of this application's embodiments are that, in the model training method, sample data from multiple participants are introduced for model training, increasing the richness of the original data and improving the accuracy of the prediction model. Simultaneously, the use of a data directory on the blockchain ensures the security of the original data of each participant. Furthermore, by combining this with smart contracts, each participant can update the training model by executing a smart contract once in sequence, reducing the computational complexity caused by iterative model training and avoiding data leakage issues during training.

[0092] Figure 3 This is a flowchart illustrating the method for determining the model contribution evaluation result in the blockchain-based model training method provided in this application embodiment.

[0093] As one possible implementation method, refer to Figure 2 As shown, after step S203 above, the following may also be included:

[0094] S301. Based on the scoring sample data uploaded by the current participants, score the trained model to obtain the scoring result.

[0095] It should be understood that before model training, each participant can divide their sample data according to a preset ratio, separating it into training sample data and scoring sample data. The location, structure, format, and access permissions of the training sample data are processed to obtain a data directory. Each participant uploads the data directory to the blockchain network. Simultaneously, each participant places the scoring sample data in a public area accessible by the smart contract for scoring. The preset ratio could be an 8:2 division of the sample data into training and scoring sample data.

[0096] Optionally, the smart contract reads the scoring sample data of the current participant from the public area, scores the model obtained in step S203 above based on the scoring sample data, and obtains the scoring result of the model trained by the current participant.

[0097] For example, when Hospital B is the current participant, the smart contract reads the scoring sample data that Hospital B has placed in advance from the public area, scores the model trained by Hospital B's equipment obtained in step S203 above, and obtains the scoring result of Hospital B's trained model.

[0098] In this embodiment, the model scoring sample data used by the current participant comes from the current participant's sample data, which eliminates the scoring result error caused by the inconsistency between the scoring sample data and the training sample data. This makes the scoring result of the model trained by the current participant more accurate, and further makes the trained model closer to the actual business application scenario.

[0099] S302. Based on the scoring results and the current participant's ranking in the participant sequence, determine the current participant's model contribution evaluation result. The participant sequence includes all participants involved in model training, and each participant is arranged in a preset order.

[0100] It should be understood that during model training by multiple participants, the contribution of a later participant to the final prediction model is often less than that of the earlier participant because the model loaded by the later participant is the model trained by the earlier participant. To mitigate the impact of the order in which participants participate in training on multiple participants, the evaluation results of each participant's model contribution should consider both the score of the model trained by each participant and the order of each participant in the participant sequence. Therefore, before model training, each participant can agree on a participant sequence and upload it to the consortium blockchain, allowing each participant to train according to the pre-defined sequence. Simultaneously, each participant can agree on a mapping relationship between the score results, the participant sequence, and the model contribution evaluation rules, and upload this mapping relationship to the consortium blockchain to determine the model contribution evaluation results for each participant.

[0101] Optionally, the smart contract determines the model contribution evaluation result of the current participant based on the score result of the model trained by the current participant obtained in step S302 above and the ranking of the current participant in the participant sequence.

[0102] For example, when Hospital B is the current participant, the smart contract queries the mapping relationship between the scoring results and the participant sequence and the model contribution evaluation rules in the consortium blockchain, based on the scoring results of Hospital B's trained model obtained in step S301 above and Hospital B's ranking in the participant sequence, to determine Hospital B's model contribution evaluation result in model training. The model contribution evaluation result of Hospital B can be numerical.

[0103] In this embodiment, by pre-agreeing on the participant sequence, the scoring results, and the mapping relationship between the participant sequence and the model contribution evaluation rules, the contributions of each participant in model training can be adjusted, ensuring that each participant plays an equal role in the model training process, which helps to obtain a more accurate prediction model. Furthermore, in practical business applications, the pre-agreeing on the participant sequence, the scoring results, and the mapping relationship between the participant sequence and the model contribution evaluation rules ensures that each participant makes an equal contribution to the final prediction model, contributing to the sustainability of cooperation and the distribution of benefits among the participants.

[0104] S303. Store the evaluation results of the current participants' model contributions in the blockchain.

[0105] Optionally, the smart contract stores the model contribution evaluation results of the current participants obtained in step S302 above in the blockchain network for storage.

[0106] For example, when Hospital B is the current participant, the smart contract saves the model contribution evaluation results of Hospital B in model training obtained in step S302 above in the consortium blockchain for storage, so that the model contribution evaluation results of each participant in the consortium blockchain in model training are transparent and reliable.

[0107] In this embodiment, the model contribution evaluation results of each participant in the model training are stored through a blockchain network, enabling each participant to supervise each other during the model training process and obtain a more accurate prediction model. At the same time, the model contribution evaluation results of each participant can also be used to determine the model contribution evaluation rules before the next round of model training, which helps to obtain a more accurate prediction model.

[0108] Figure 4 This is a flowchart illustrating the method for determining model scoring results in the blockchain-based model training method provided in this application embodiment.

[0109] As one possible implementation method, refer to Figure 4 As shown, step S301 above may further include:

[0110] S401. Obtain the scoring sample data uploaded by the current participants from the public area of ​​the blockchain.

[0111] Optionally, each participant places its scoring sample data in a public area of ​​the blockchain accessible to the smart contract, allowing the smart contract to retrieve the scoring sample data uploaded by each participant from this public area. This data is then used to score the model trained by the current participant, obtained in step S203.

[0112] For example, when Hospital B is the current participant, the smart contract reads the pre-placed rating sample data from the public area of ​​the consortium blockchain.

[0113] S402. Score the trained model based on the scoring sample data to obtain the scoring results.

[0114] Optionally, after the smart contract obtains the scoring sample data uploaded by the current participant, it scores the model trained by the current participant obtained in step S203 above, and obtains the scoring result of the model trained by the current participant.

[0115] For example, when Hospital B is the current participant, after the smart contract obtains the scoring sample data uploaded by Hospital B, it scores the model trained by Hospital B's equipment obtained in step S203 above, and obtains the scoring result of Hospital B's trained model.

[0116] As one possible implementation, the participant sequence is pre-uploaded to the blockchain by the leading party's device, and the first participant in the participant sequence is the leading party.

[0117] Optionally, before each participant trains the model, the leading party's device uploads the participant sequence agreed upon by each participant to the blockchain network, so that each participant can train according to the preset participant sequence.

[0118] As one possible implementation, step S203 above may also include:

[0119] The trained model of the current participant and the training completion identifier of the current participant are uploaded to the blockchain so that the next participant of the current participant can start the smart contract through the subscribed event and the participant sequence.

[0120] Optionally, the device of the current participant can update the training completion status identifier of the current participant to the blockchain, so that other participants can receive the status identifier update information through the blockchain subscription mechanism, which can be used to remind the next participant of the current participant.

[0121] Optionally, when each participating party's device receives the status identifier event update information, each participating party's device combines the status identifier event update information and the participating party sequence to determine the next participating party of the current participating party. When a participating party's device determines that it is the next participating party of the current participating party, the participating party's device starts the smart contract and continues to execute the above steps S201-S203.

[0122] Optionally, when each participant's device receives the status identifier event update information, each participant's device combines the status identifier event update information and the participant sequence to determine the next participant of the current participant. When none of the participants are the next participant of the current participant, the smart contract determines that all participants have completed model training. At the same time, the trained model uploaded by the last participant on the blockchain network is used as the final prediction model.

[0123] For example, when Hospital B is the current participant, after Hospital B's equipment completes training, Hospital B's equipment uploads the trained model and its completion status to the blockchain. Additionally, Hospital B's equipment can update its training completion status identifier in the blockchain, allowing other participants to receive the status identifier update information through the blockchain's subscription mechanism, thus reminding the next participant in Hospital B's ecosystem.

[0124] For example, when Hospital B is the current participant, when the devices of Hospital A and Hospital C receive the update information of the status identifier event, the devices of Hospital A and Hospital C combine the update information of the status identifier event with the participant sequence to determine the next participant of Hospital B. At this time, when the device of Hospital C determines that it is the next participant of Hospital B, the device of Hospital C starts the smart contract and continues to execute the above steps S201-S203.

[0125] For example, when hospital C is the current participant, when the devices of hospital A and hospital B receive the status identifier event update information, the devices of hospital A and hospital B combine the status identifier event update information and the participant sequence to determine the next participant of hospital C. At this time, when the devices of hospital A and hospital B determine that neither of them is the next participant of hospital C, the smart contract determines that hospital A, hospital B and hospital C have completed model training. At the same time, the trained model uploaded by the device of hospital C on the blockchain network is used as the final prediction model.

[0126] As one possible implementation, step S202 above may include:

[0127] If the current participant is a participant other than the first participant in the participant sequence, then the trained model of the previous participant in the participant sequence will be loaded as the model to be trained for the current participant.

[0128] Optionally, the smart contract can determine the current participant by combining the preset participant sequence. If the current participant is a participant other than the first participant in the participant sequence, the trained model of the previous participant in the participant sequence will be loaded as the model to be trained for the current participant.

[0129] For example, when Hospital B is the current participant, the smart contract loads the model trained by Hospital A as the model to be trained by Hospital B.

[0130] In this embodiment, the model to be trained loaded by the later participant is the model trained by the previous participant. This allows the later participant to train on the basis of the model trained by the previous participant, enabling the later participant to correct the model obtained by the previous participant and obtain a more accurate prediction model. This model is more in line with the needs of actual business applications and has better prediction results.

[0131] Figure 5 This is a flowchart illustrating the sample data loading method in the blockchain-based model training method provided in this application embodiment.

[0132] As one possible implementation method, refer to Figure 5 As shown, step S201 above may include:

[0133] S501. Based on the data catalog, obtain the location of the current participant's sample data within the current participant's intranet.

[0134] Optionally, the smart contract can parse the data directory uploaded to the blockchain network by the current participant's device to obtain the location information of the current participant's sample data in the current participant's intranet.

[0135] For example, when Hospital B is the current participant, the smart contract parses Hospital B's data directory based on the data directory uploaded by Hospital B's device to the consortium blockchain to obtain the location information of Hospital B's sample data in the intranet of Hospital B's device.

[0136] S502. Based on the location of the sample data of the current participant in the current participant's intranet, load the sample data in the current participant's intranet.

[0137] Optionally, the smart contract can load the sample data used for model training by the current participant into the model training platform that the current participant has already set up, based on the location information of the current participant's sample data in the current participant's intranet.

[0138] For example, when Hospital B is the current participant, the smart contract loads the sample data used by Hospital B for model training into the model training platform that has been pre-built on Hospital B's device, based on the location information of Hospital B's sample data in the intranet of Hospital B's device.

[0139] In this embodiment, the smart contract obtains the location information of the sample data used for training by each participant through the data directory uploaded in advance by each participant. The sample data used for model training by each participant is loaded into the model training platform of each participant for training. This avoids the process of uploading training data by each participant, reduces the computational complexity during model training, and also avoids data leakage caused by data uploading, thus ensuring the security of the sample data of each participant.

[0140] Based on the same inventive concept, this application also provides a blockchain-based model training device corresponding to the blockchain-based model training method. Since the principle of the device in this application is similar to that of the blockchain-based model training method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0141] Figure 6 A schematic diagram of a blockchain-based model training device provided in this application embodiment is shown below. Figure 6 As shown, the device includes:

[0142] The first loading module 601 is used to load sample data into the intranet of the current participant based on the data directory uploaded to the blockchain by the device of the current participant, wherein the data directory is used to indicate the storage location of data related to the target business.

[0143] The second loading module 602 is used to load the training model of the current participant, wherein the training model of the current participant is trained by the device of the previous participant in the participant sequence.

[0144] The training module 603 is used to call the model training interface corresponding to the current participant to trigger the device of the current participant to train the model to be trained based on the sample data, and upload the trained model of the current participant to the blockchain.

[0145] Figure 7 This is a schematic diagram of another blockchain-based model training device provided in an embodiment of this application.

[0146] As one possible implementation method, refer to Figure 7 As shown, after the training module 603, a scoring module 604 is further included, which is specifically used for:

[0147] The trained model is scored based on the scoring sample data uploaded by the current participants to obtain the scoring result;

[0148] Based on the scoring results and the current participant's ranking in the participant sequence, the model contribution evaluation result of the current participant is determined, wherein the participant sequence includes all participants involved in model training, and each participant is arranged in a preset order.

[0149] The evaluation results of the current participants' model contributions are stored in the blockchain.

[0150] As one possible implementation, the scoring module 604 is specifically used for:

[0151] Obtain the scoring sample data uploaded by the current participant from the public area of ​​the blockchain;

[0152] The trained model is scored based on the scoring sample data to obtain the scoring result.

[0153] As one possible implementation, the participant sequence is pre-uploaded to the blockchain by the leading party's device, and the first participant in the participant sequence is the leading party.

[0154] As one possible implementation, the training module 603 is specifically used for:

[0155] The trained model of the current participant and the training completion identifier of the current participant are uploaded to the blockchain so that the next participant of the current participant can start the smart contract through the subscribed event and the participant sequence.

[0156] As one possible implementation, the second loading module 602 is specifically used for:

[0157] If the current participant is the first participant in the participant sequence, then the initial model is loaded as the training model for the current participant;

[0158] If the current participant is a participant in the participant sequence other than the first participant, then the trained model of the previous participant in the participant sequence is loaded as the model to be trained for the current participant.

[0159] As one possible implementation, the first loading module 601 is specifically used for:

[0160] Based on the data catalog, obtain the location of the current participant's sample data within the current participant's intranet;

[0161] Based on the location of the sample data of the current participant in the intranet of the current participant, load the sample data into the intranet of the current participant.

[0162] Figure 8 This is a schematic diagram of an electronic device structure provided in an embodiment of this application.

[0163] This application also provides an electronic device 800, which is described in reference to... Figure 8 The diagram shown is a schematic representation of the structure of an electronic device 800 provided in an embodiment of this application. It includes a processor 801, a memory 802, and optionally, a bus 803. The memory 802 stores machine-readable instructions executable by the processor 801 (e.g., ...). Figure 6 The device includes a first loading module 601, a second loading module 602, and a training module 603. Figure 7 In the device (such as the scoring module 604), when the electronic device 800 is running, the processor 801 and the memory 802 communicate via the bus 803. When the machine-readable instructions are executed by the processor 801, the steps of the above-mentioned blockchain-based model training method are performed.

[0164] This application also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the steps of the blockchain-based model training method described above.

[0165] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.

[0166] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0167] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A blockchain-based model training method, characterized in that, The method, applied to smart contracts deployed on a blockchain, includes: According to the data catalog, obtain the location of the sample data of the current participant in the intranet of the current participant, wherein the data catalog is used to indicate the storage location of data related to the target business; Based on the location of the sample data of the current participant in the intranet of the current participant, load the sample data in the intranet of the current participant; Load the training model of the current participant, wherein the training model of the current participant is trained by the device of the previous participant in the participant sequence; The model training interface corresponding to the current participant is invoked to trigger the device of the current participant to train the model to be trained based on the sample data, and the trained model of the current participant is uploaded to the blockchain.

2. The blockchain-based model training method according to claim 1, characterized in that, After uploading the trained model of the current participant to the blockchain, the process further includes: The trained model is scored based on the scoring sample data uploaded by the current participants to obtain the scoring result; Based on the scoring results and the current participant's ranking in the participant sequence, the model contribution evaluation result of the current participant is determined, wherein the participant sequence includes all participants involved in model training, and each participant is arranged in a preset order. The evaluation results of the current participants' model contributions are stored in the blockchain.

3. The blockchain-based model training method according to claim 2, characterized in that, The step of scoring the trained model based on the scoring sample data uploaded by the current participant to obtain a scoring result includes: Obtain the scoring sample data uploaded by the current participant from the public area of ​​the blockchain; The trained model is scored based on the scoring sample data to obtain the scoring result.

4. The blockchain-based model training method according to claim 2, characterized in that, The participant sequence is pre-uploaded to the blockchain by the leading party's device, and the first participant in the participant sequence is the leading party.

5. The blockchain-based model training method according to claim 1, characterized in that, Uploading the trained model of the current participant to the blockchain includes: The trained model of the current participant and the training completion identifier of the current participant are uploaded to the blockchain so that the next participant of the current participant can start the smart contract through the subscribed event and the participant sequence.

6. The blockchain-based model training method according to claim 1, characterized in that, The loading of the model to be trained for the current participant includes: If the current participant is a participant other than the first participant in the participant sequence, then the trained model of the previous participant in the participant sequence is loaded as the model to be trained for the current participant.

7. A blockchain-based model training device, characterized in that, include: The first loading module is used to obtain the location of the current participant's sample data in the current participant's intranet according to the data directory; Based on the location of the sample data of the current participant in the intranet of the current participant, the sample data is loaded in the intranet of the current participant, wherein the data directory is used to indicate the storage location of data related to the target business; The second loading module is used to load the training model of the current participant, wherein the training model of the current participant is trained by the device of the previous participant in the participant sequence. The training module is used to call the model training interface corresponding to the current participant to trigger the device of the current participant to train the model to be trained based on the sample data, and upload the trained model of the current participant to the blockchain.

8. An electronic device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, which, when the electronic device is running, are executed by the processor to perform the steps of the blockchain-based model training method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the blockchain-based model training method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Federal learning method and device based on block chain, equipment and storage medium

    CN113792347A