A blockchain-driven federated learning system and method across water conservancy hubs
By using a blockchain-driven federated learning system, dynamically allocating node roles and employing a dual-constraint anomaly detection mechanism, the system addresses data security and compliance issues among cross-regional water conservancy hubs, enabling efficient and secure model training and consensus, and enhancing the intelligent and collaborative decision-making capabilities of the water conservancy system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIDIAN UNIV
- Filing Date
- 2026-03-25
- Publication Date
- 2026-07-14
AI Technical Summary
In cross-regional water conservancy hubs, traditional centralized learning is difficult to meet data security and legal compliance requirements. Existing federated learning methods have risks of single point of failure, centralized trust, and model tampering, making it difficult to meet the security requirements of multi-entity collaboration.
The blockchain-driven federated learning system dynamically allocates node roles through a verifiable random function, combines node equity and a dual-constraint anomaly detection mechanism, and utilizes a Byzantine fault-tolerant consensus protocol to ensure the security and trustworthy consensus of model training, thereby achieving decentralized model training and robust aggregation.
While ensuring data privacy, this approach enables efficient and secure model training, prevents data privacy leaks, defends against chronic poisoning attacks, optimizes consensus communication overhead, provides a trusted audit baseline, and enhances the intelligence and collaborative decision-making capabilities of the water conservancy system.
Smart Images

Figure CN122390108A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain technology, and more specifically to a blockchain-driven federated learning system and method across water conservancy hubs. Background Technology
[0002] Among related technologies, machine learning plays a vital role in water conservancy data analysis, early warning, and scheduling. However, in cross-regional collaborative scenarios, due to the national security and privacy implications of hydrological data, a severe "data silo" phenomenon exists between various water conservancy projects, making it difficult for traditional centralized learning methods to meet data security and legal compliance requirements.
[0003] Federated learning, as a privacy-preserving distributed machine learning paradigm, allows participating parties to train models locally using their own data, exchanging only model parameters or updates, thus avoiding the leakage of raw data and meeting the security requirement of data remaining within its domain. However, existing methods typically rely on a central server for model aggregation and scheduling, which presents single points of failure, centralized trust, and the risk of model tampering, making it difficult to meet the security requirements of multi-party collaboration across water conservancy projects. Blockchain technology, with its decentralized, tamper-proof, and trustworthy consensus characteristics, can provide a trusted infrastructure for collaborative computing.
[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] This invention provides a blockchain-driven federated learning system and method across water conservancy hubs. While ensuring the data privacy of each water conservancy hub, it achieves decentralized model training, robust aggregation, and trusted consensus, thereby improving the efficiency, security, and practicality of distributed intelligent water conservancy applications and effectively overcoming the shortcomings of existing technologies to a certain extent.
[0006] Other features and advantages of the invention will become apparent from the following detailed description, or may be learned in part by practice of the invention.
[0007] According to a first aspect of the present invention, a blockchain-driven federated learning method across water conservancy hubs is provided. The method, applied to blockchain nodes participating in federated learning, includes: The task initiator publishes a federated learning task based on water conservancy hub data in the blockchain network and initializes the federated learning task; the blockchain network includes multiple water conservancy hub nodes. Based on a verifiable random function and combined with the node rights of water conservancy hub nodes, the node roles in the current training round are dynamically allocated; among which, the dynamically allocated node roles include: training node, aggregation node, and verification node. Each training node trains the initial global model based on its local private hydrological dataset to obtain the corresponding local model update data; the training node signs the local model update data and broadcasts it to the aggregation node. The aggregation node filters the update data of each local model based on the dual-constraint anomaly detection mechanism, and constructs candidate global models and corresponding aggregation proofs based on the filtered model update data. The verification node uses the local verification dataset to evaluate the performance of the candidate global model and generates the corresponding model performance evaluation results; and reaches a consensus based on the Byzantine fault-tolerant consensus protocol with embedded quality proof to confirm the optimal global model for the current training round. Each participating node will store the final global model, along with the corresponding consensus proof and evaluation summary, on the blockchain to complete the update of the current training round; and repeat the above steps until the termination condition is met.
[0008] In some exemplary implementations, based on a verifiable random function and combined with the node rights of the water conservancy hub nodes, the node roles in the current training round are dynamically allocated, including: Before the start of the current training round, the number of verification nodes is dynamically configured based on a preset security confidence level; wherein the probability that the set of verification nodes satisfies the Byzantine fault tolerance condition is higher than the security confidence level. The aggregation nodes employ a competition mechanism with a fixed number of k nodes to generate k different candidate models in parallel for evaluation by the validation nodes.
[0009] In some exemplary implementations, the local model update data includes any one or a combination of the following: full parameter increments, subsets of key parameters, or low-dimensional adaptation weights.
[0010] In some exemplary implementations, the aggregation node filters the update data of each local model based on a dual-constraint anomaly detection mechanism, and constructs a candidate global model based on the filtered model update data, including: An outlier statistical method based on the absolute deviation of the median is used to calculate the first dynamic threshold based on the distribution of all updates in the current round. ; Get the blockchain N By analyzing the statistical characteristics of the global historical model, the deviation of the local update from the historical evolution trajectory is calculated to obtain the second historical threshold. ; The intersection of the first dynamic threshold and the second historical threshold is taken as the final filtering condition. Remove abnormal updates; The remaining eligible updates are aggregated after sampling based on node equity.
[0011] In some exemplary implementations, the validation node uses a local validation dataset to evaluate the performance of candidate global models, including: The performance of candidate global models is evaluated based on multiple objective dimension indicators, including: a categorical loss improvement indicator reflecting the model's generalization ability, and a physical consistency score reflecting the degree to which the output content follows the laws of hydraulic physics.
[0012] In some exemplary implementations, a consensus is reached based on a Byzantine fault-tolerant consensus protocol with embedded quality proofs to confirm the optimal global model for the current training epoch, including: The evaluation results are constructed into a Merkle tree, and the root hash is used. Sign as a commitment; The leader node includes a Merkle proof in the proposal message. The verification node verifies whether the model quality assessment in the proposal is consistent with the original assessment result based on the proof.
[0013] According to a second aspect of the present invention, a blockchain-driven federated learning system across water conservancy hubs is provided, the system comprising: Participating nodes are used by the task initiator to publish a federated learning task based on water conservancy hub data in the blockchain network and initialize the federated learning task; the blockchain network includes multiple water conservancy hub nodes; based on a verifiable random function and combined with the node rights of the water conservancy hub nodes, the node roles in the current training round are dynamically allocated; the dynamically allocated node roles include: training node, aggregation node, and verification node. The training node is used to train the initial global model based on the local private hydrological dataset to obtain the corresponding local model update data; and to sign the local model update data and broadcast it to the aggregation node. The aggregation node is used to filter the update data of each local model based on the dual-constraint anomaly detection mechanism, and to construct candidate global models and corresponding aggregation proofs based on the filtered model update data. The validation node is used to evaluate the performance of candidate global models using the local validation dataset and generate the corresponding model performance evaluation results; and to reach a consensus based on the Byzantine fault-tolerant consensus protocol with embedded quality proof to confirm the optimal global model for the current training round. Each participating node will store the final global model, along with the corresponding consensus proof and evaluation summary, on the blockchain to update the current training round; and repeat the above steps until the termination condition is met.
[0014] According to a third aspect of the present invention, a computer program product is provided, on which a computer program is stored, which, when executed by a processor, implements the aforementioned blockchain-driven federated learning method across water conservancy hubs.
[0015] According to a fourth aspect of the invention, a storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the aforementioned blockchain-driven federated learning method for cross-hydraulic hubs.
[0016] According to a fifth aspect of the present invention, an electronic device is provided, comprising: Processor; and Memory for storing the executable instructions of the processor; The processor is configured to implement the aforementioned blockchain-driven federated learning method across water conservancy hubs when executing the executable instructions.
[0017] The blockchain-driven federated learning method for cross-water conservancy hubs provided in the embodiments of this invention realizes a federated learning architecture for cross-water conservancy hub scenarios. This architecture enables efficient and secure learning and training in cross-water conservancy hub scenarios with clear organizational boundaries and strict data privacy requirements. Under this architecture, each water conservancy hub node can continuously participate in model training using local data without sharing original data, fundamentally avoiding data privacy leaks and compliance risks. Simultaneously, blockchain ensures the traceability and immutability of the training process, establishing a reliable audit baseline for the collaborative model. A dual-constraint anomaly detection mechanism effectively identifies and defends against chronic poisoning attacks targeting federated learning. The confidence-based dynamic committee construction and Merkle quality proof mechanism optimize consensus communication overhead and eliminate the possibility of falsifying model quality evaluation results. The finally trained model can be applied to key operations such as watershed hydrological forecasting, joint hub scheduling, and intelligent early warning of infrastructure risks, providing core technical support for improving the overall intelligence and collaborative decision-making level of the water conservancy system.
[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention. It is obvious that the drawings described below are merely some embodiments of the invention, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0020] Figure 1 This illustration schematically depicts an exemplary embodiment of the present invention: a blockchain-driven federated learning method across water conservancy hubs. Figure 2 This illustration schematically depicts a blockchain-driven federated learning system architecture in an exemplary embodiment of the present invention. Figure 3 The illustration schematically shows a timing diagram of a blockchain-driven federated learning training method in an exemplary embodiment of the present invention; Figure 4 This illustration schematically depicts a blockchain-driven federated learning execution process in an exemplary embodiment of the present invention. Figure 5 The diagram illustrates the composition of an electronic device according to an exemplary embodiment of the present invention. Detailed Implementation
[0021] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that the invention will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0022] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0023] To address the shortcomings and deficiencies of existing technologies, this example implementation provides a blockchain-driven federated learning method across water conservancy hubs. (Reference) Figure 1 As shown, the method includes: Step S11: The task initiator publishes a federated learning task based on water conservancy hub data in the blockchain network and initializes the federated learning task; wherein, the blockchain network includes multiple water conservancy hub nodes. Step S12: Based on a verifiable random function and combined with the node rights of the water conservancy hub nodes, dynamically allocate the node roles in the current training round; wherein, the dynamically allocated node roles include: training node, aggregation node, and verification node. Step S13: Each training node trains the initial global model based on its local private hydrological dataset to obtain the corresponding local model update data; the training node signs the local model update data and broadcasts it to the aggregation node. Step S14: The aggregation node filters the update data of each local model based on the dual-constraint anomaly detection mechanism, and constructs a candidate global model and the corresponding aggregation proof based on the filtered model update data. In step S15, the verification node uses the local verification dataset to evaluate the performance of the candidate global model and generates the corresponding model performance evaluation results; and reaches a consensus based on the Byzantine fault-tolerant consensus protocol with embedded quality proof to confirm the optimal global model for the current training round. Step S16: Each participating node stores the final global model, along with the corresponding consensus proof and evaluation summary, on the blockchain to complete the update of the current training round; and repeats the above steps until the termination condition is met.
[0024] The steps of the method in this exemplary embodiment will now be described in more detail with reference to the accompanying drawings and embodiments.
[0025] In step S11, the task initiator publishes a federated learning task based on water conservancy hub data in the blockchain network and initializes the federated learning task; wherein, the blockchain network includes multiple water conservancy hub nodes.
[0026] For example, the above method is applied to terminal equipment in water conservancy facilities, such as smart terminals and computing devices like servers. The terminal equipment acts as a blockchain node and maintains the blockchain through smart contracts. The blockchain node can respond to learning requests sent by any terminal device as a task initiator, providing data sharing services based on federated learning and realizing a decentralized model aggregation mechanism. Furthermore, the blockchain node can also publish the interaction process between terminal devices regarding resource allocation information and training data volume on the blockchain in the form of transactions, achieving a fair and effective federated learning incentive mechanism.
[0027] refer to Figure 2 The system architecture shown includes a training layer, an aggregation layer, and a blockchain layer. The training layer consists of local training nodes distributed across various water conservancy facilities. Each node can use its local water conservancy dataset to perform task-specific optimization or incremental training on a pre-trained global model, generating corresponding local model parameter increment information which is then sent to the aggregation layer. The aggregation layer, composed of allocated aggregation nodes, handles model updates and generates candidate models. The blockchain layer, composed of verification nodes allocated in this round, is responsible for verifying the performance of candidate models, including physical consistency, and achieving consensus based on an improved Byzantine fault-tolerant protocol, ultimately broadcasting new blocks.
[0028] Specifically, the task initiator can be any water conservancy hub node. In cross-water conservancy hub collaboration scenarios, each water conservancy hub node is independent and has equal status. Alternatively, the task initiator can also be other participating nodes in the blockchain.
[0029] During system initialization, each water conservancy hub node completes blockchain network access, identity registration, and key configuration. The task initiator can publish federated learning tasks based on water conservancy hub data within the blockchain network, and can also publish the initialization model and task configuration data to the blockchain network, generating a genesis block. The task configuration data may include model training parameters, such as training period and model structure. All participating nodes process the task publication.
[0030] In step S12, based on a verifiable random function and combined with the node rights of the water conservancy hub nodes, the node roles of the current training round are dynamically allocated; wherein, the dynamically allocated node roles include: training node, aggregation node, and verification node.
[0031] For example, step S12 described above may include: Step S21: Before the start of the current training round, dynamically configure the number of verification nodes based on a preset security confidence level; wherein, the probability that the set of verification nodes satisfies the Byzantine fault tolerance condition is higher than the security confidence level. In step S22, the aggregation node uses a fixed number of k competition mechanisms to generate k different candidate models in parallel for the verification node to evaluate.
[0032] Specifically, the roles of each node can be dynamically allocated through the following methods: Each participating node uses a verifiable random function (VRF) combined with the previous round of block hash to generate a random mapping starting point. The system constructs a hash ring and divides a continuous interval of corresponding length on the hash ring according to the node's accumulated stake ratio. Subsequently, starting from the mapping starting point, a preset number of verification nodes and aggregation nodes are selected in a clockwise direction along the hash ring, and the remaining nodes automatically become training nodes for this round.
[0033] Wherein, the number of verification nodes, v, is the smallest integer dynamically calculated based on a preset security confidence level, to ensure that, under the current network risk assessment, the probability that the selected node set satisfies the Byzantine fault tolerance condition is higher than the security confidence level; the set of verification nodes satisfies the Byzantine fault tolerance condition, expressed by the formula:
[0034] in, This represents the maximum number of malicious nodes that can be tolerated.
[0035] In step S13, each training node trains the initial global model based on its local private hydrological dataset to obtain the corresponding local model update data; the training node signs the local model update data and broadcasts it to the aggregation node.
[0036] For example, a water conservancy hub assigned as a training node obtains the global model for the current round from the blockchain, trains it using a local private hydrological dataset, obtains a local model update, and broadcasts it to all aggregation nodes after digital signature.
[0037] For example, local model update data includes any one or a combination of the following: full parameter increments, subsets of key parameters, or low-dimensional adaptation weights.
[0038] In step S14, the aggregation node filters the update data of each local model based on the dual-constraint anomaly detection mechanism, and constructs a candidate global model and the corresponding aggregation proof based on the filtered model update data.
[0039] For example, a water conservancy hub assigned as an aggregation node receives model updates, performs a dual-constraint anomaly detection mechanism, aggregates several selected model updates to generate a candidate global model, and generates an aggregation proof.
[0040] For example, the aggregation node filters the update data of each local model based on a dual-constraint anomaly detection mechanism, and constructs a candidate global model based on the filtered model update data, including: Step S31: Using an outlier statistics method based on the absolute deviation of the median, calculate the first dynamic threshold based on the distribution of all updates in the current round. ; Step S32, obtain the near-term data on the blockchain. N By analyzing the statistical characteristics of the global historical model, the deviation of the local update from the historical evolution trajectory is calculated to obtain the second historical threshold. ; Step S33: Take the intersection of the first dynamic threshold and the second historical threshold as the final filtering condition. Remove abnormal updates; Step S34: Probabilistically sample and select the remaining qualified updates based on the node equity of each node, and aggregate the selected updates.
[0041] For example, the range of values for N can be... The aforementioned node rights can refer to quantitative indicators recorded on the blockchain ledger, reflecting the comprehensive reputation and contribution of each water conservancy hub node. For example, the constituent data of node rights mainly include: basic rights assigned during system initialization based on the physical scale of the water conservancy hub and the amount of local hydrological data; contribution rewards accumulated by nodes in historical rounds for submitting valid updates or participating in consensus voting; and penalty points deducted by the system for nodes submitting abnormal model updates or engaging in malicious behavior.
[0042] In step S15, the verification node uses the local verification dataset to evaluate the performance of the candidate global model and generates the corresponding model performance evaluation results; and reaches a consensus based on the Byzantine fault-tolerant consensus protocol with embedded quality proof to confirm the optimal global model for the current training round.
[0043] For example, the validation node uses the local validation dataset to perform performance evaluation on the candidate global model, including: The performance of candidate global models is evaluated based on multiple objective dimension indicators, including: a categorical loss improvement indicator reflecting the model's generalization ability, and a physical consistency score reflecting the degree to which the output content follows the laws of hydraulic physics.
[0044] Specifically, this refers to the improvement metric of categorical loss, which reflects the model's generalization ability. For candidate global models... And the validation node, calculate the improved vector containing the loss impact value for each class. For categories The formula is expressed as:
[0045] in, L Let G be the loss function, and G be the global model from the previous round.
[0046] A physical consistency score reflects the degree to which the output conforms to the laws of hydraulic physics. The predicted output of the candidate model is substituted into the preset hydraulic physics constraint equations to calculate the theoretical residual, which is then normalized into a score to quantitatively verify whether the model output conforms to the conservation laws of hydraulic physics.
[0047] For example, the verification nodes reach consensus based on a Byzantine fault-tolerant consensus protocol with embedded quality proofs, confirming the optimal global model for this round, including: Step S41: Construct the evaluation results into a Merkle tree and hash the root. Sign as a commitment; Step S42: The leader node attaches a Merkle proof to the proposal message. The verification node verifies whether the model quality assessment in the proposal is consistent with the original assessment result based on the proof.
[0048] Specifically, the validation node uses the unique identifier (such as the model hash) of each candidate global model and its corresponding evaluation result as the bottom-level data block to form the leaf node, and performs deterministic sorting according to the unique identifier of the model; then, a Merkle tree is constructed on the bottom-level data block to obtain the root hash of the entire tree. Finally, the verification node pairs Signing constitutes an irrefutable commitment.
[0049] The leader node includes a Merkle proof in the proposal message. The verification node verifies whether the model quality assessment in the proposal is consistent with the original assessment result based on this proof. The formula is as follows:
[0050] This ensures the security and quality of global model updates, and guarantees rapid confirmation within a single consensus process. The leader node is generated deterministically from the set of validator nodes in the current round through a view-switching mechanism based on the Byzantine fault-tolerant consensus protocol.
[0051] In step S16, each participating node stores the final global model, along with the corresponding consensus proof and evaluation summary, on the blockchain to complete the update of the current training round; and repeats the above steps until the termination condition is met.
[0052] For example, after confirming the optimal global model for this round, each participating node stores the final global model confirmed by consensus, the corresponding consensus proof, and the evaluation summary on the blockchain, thus completing this round of update.
[0053] Next, each participating node checks whether the termination condition is met. If not, the above steps are repeated until the termination condition is met to complete decentralized training. For example, the training termination condition could be reaching a preset training epoch limit or the model accuracy reaching a preset threshold.
[0054] For example, the method also includes an incentive step: based on the node behavior and contributions recorded on the chain (such as successfully submitting valid updates, participating in consensus voting, etc.), rewards are automatically calculated and distributed through a smart contract after each training round or task. Nodes detected to have engaged in malicious behavior (such as submitting low-quality or conflicting updates) will be penalized. This mechanism aims to incentivize honest participation and ensure the long-term security and stable operation of the system.
[0055] In this exemplary embodiment, reference is made to Figure 3 As shown, the training method for a blockchain-based federated learning model across water conservancy hubs specifically includes the following steps: S201, the task publisher initializes the global model. Specifically, the task publisher publishes the initialized model and related task configurations to the blockchain network, generating the genesis block.
[0056] S202, participating nodes obtain the t-th round of new blocks from the blockchain network.
[0057] S203, the training node iteratively trains the model based on the local dataset to obtain model updates. The local dataset includes historical water level records, pump station operation data, and flood control plan instruction sets; the local training includes fine-tuning of prompt words or efficient parameter fine-tuning for the pre-trained large model.
[0058] To adapt to large model fine-tuning scenarios, training nodes can keep the main weights of the pre-trained model frozen and only update specific parameter vectors or structural adapters, thereby obtaining local model parameter increment information. This approach significantly reduces cross-hub communication overhead.
[0059] S204, Upload partial model update and signature; S205, receives local model updates and signatures; In step S206, the aggregation node performs dual-constraint anomaly detection and generates candidate models. The first dynamic threshold is calculated using a statistical method based on the absolute deviation of the median, determining the absolute deviation between the current update and the current global model. The second historical threshold is calculated by reading the global model records from the past N blocks on the blockchain, determining the allowable fluctuation threshold for this round. Ultimately, the aggregation node retains only updates that simultaneously satisfy both threshold constraints, thus statistically excluding outlier attacks and gradual poisoning.
[0060] S207, Broadcast candidate models and signatures; the aggregator node broadcasts the candidate models to the verification committee. The aggregator node signs the hash value of the candidate model and attaches the selected K updated aggregate signatures as proof of origin.
[0061] S208: Collect candidate models and evaluate them; the verification node constructs a Merkle tree based on the evaluation results and signs the Merkle root to form a non-repudiable commitment.
[0062] S209 executes the consensus protocol; in this protocol, the leader node selects candidate models based on the evaluation results, and after multiple stages of consensus, a final commit proof is formed. The final global model that has reached consensus, the commit proof, and other metadata (such as staking incentive records) are packaged into a new block and stored on the blockchain.
[0063] S210, broadcasting the (t+1)th round of new blocks; Repeat steps S202 to S210 until the preset number of rounds is reached or the model accuracy reaches the preset accuracy threshold.
[0064] The method provided in the embodiments of the present invention is referred to Figure 4 As shown, the process may include the following steps: S301: System initialization, each water conservancy hub node completes blockchain network access and identity registration and key configuration; S302: The task publisher publishes the learning task and the initial global model to the blockchain network; S303: All participating nodes publish processing tasks; S304: Nodes check task status. Before each training round begins, each participating node queries the blockchain for the status of the specified task. If the task status is "Terminated," the node executes S317 to end the training process. If the task status is "In Progress," it continues with S305.
[0065] S305: Nodes perform dynamic role assignment; S306: The training node acquires the model and trains it locally. It downloads the latest global model from the blockchain, trains it using its local private dataset, and obtains a local model update containing parameter increment information. S307: The training node signs the local update and broadcasts it to the aggregation node in the current round; S308-309: Aggregation nodes perform anomaly detection based on dual constraints and aggregate to generate candidate global models; S310: The aggregation node signs the candidate model and its source proof, and broadcasts it to the verification node; S311-S313: After receiving the candidate model, the verification node enters the consensus process to determine whether a consensus has been reached. If a consensus is reached, proceed to S314; otherwise, return to step S311. S314: The leader packages the finalized global model into a new block and broadcasts it to the blockchain network; S315: All participating nodes receive the new block and upload it to the chain; S316: Each participating node checks the termination condition to determine whether training should terminate. If the condition is met, proceed to S317; otherwise, the process returns to S304 to begin the next round of training. S317: Process the termination request; task complete.
[0066] This method establishes a federated learning architecture across water conservancy hubs, enabling efficient and secure learning and training in scenarios with clear organizational boundaries and strict data privacy requirements. Under this architecture, each water conservancy hub can continuously participate in model training using local data without sharing raw data, fundamentally avoiding data privacy leaks and compliance risks. Simultaneously, blockchain technology ensures the traceability and immutability of the training process, establishing a reliable audit baseline for the collaborative model. A dual-constraint anomaly detection mechanism effectively identifies and defends against chronic poisoning attacks targeting federated learning. The confidence-based dynamic committee construction and Merkle quality proof mechanism optimize consensus communication overhead and eliminate the possibility of falsifying model quality evaluation results. The final trained model can be applied to key operations such as watershed hydrological forecasting, joint hub scheduling, and intelligent early warning of infrastructure risks, providing core technical support for improving the overall intelligence and collaborative decision-making level of the water conservancy system.
[0067] It should be noted that the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may, for example, be executed synchronously or asynchronously in multiple modules.
[0068] For example, a blockchain-driven federated learning system across water conservancy hubs is provided, the system comprising: Participating nodes are used by the task initiator to publish a federated learning task based on water conservancy hub data in the blockchain network and initialize the federated learning task; the blockchain network includes multiple water conservancy hub nodes; based on a verifiable random function and combined with the node rights of the water conservancy hub nodes, the node roles in the current training round are dynamically allocated; the dynamically allocated node roles include: training node, aggregation node, and verification node. The training node is used to train the initial global model based on the local private hydrological dataset to obtain the corresponding local model update data; and to sign the local model update data and broadcast it to the aggregation node. The aggregation node is used to filter the update data of each local model based on the dual-constraint anomaly detection mechanism, and to construct candidate global models and corresponding aggregation proofs based on the filtered model update data. The validation node is used to evaluate the performance of candidate global models using the local validation dataset and generate the corresponding model performance evaluation results; and to reach a consensus based on the Byzantine fault-tolerant consensus protocol with embedded quality proof to confirm the optimal global model for the current training round. Each participating node will store the final global model, along with the corresponding consensus proof and evaluation summary, on the blockchain to update the current training round; and repeat the above steps until the termination condition is met.
[0069] It should be noted that although several modules or units of the device for performing actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0070] Figure 5 A schematic diagram of an electronic device suitable for implementing embodiments of the present invention is shown.
[0071] It should be noted that, Figure 5 The electronic device 1000 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0072] like Figure 5 As shown, the electronic device 1000 includes a Central Processing Unit (CPU) 1001, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1002 or programs loaded from storage section 1008 into Random Access Memory (RAM) 1003. The RAM 1003 also stores various programs and data required for system operation. The CPU 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An Input / Output (I / O) interface 1005 is also connected to the bus 1004. Furthermore, the electronic device 1000 also includes an FPGA device and a System-on-a-Chip (SoC) device.
[0073] The following components are connected to I / O interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to I / O interface 1005 as needed. Removable media 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1010 as needed so that computer programs read from them can be installed into storage section 1008 as needed.
[0074] In particular, according to embodiments of the present invention, the processes described below with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a storage medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by central processing unit (CPU) 1001, it performs various functions defined in the system of this application.
[0075] Specifically, the aforementioned electronic devices can be airborne intelligent electronic devices, such as airborne video processing equipment.
[0076] It should be noted that the storage medium shown in the embodiments of the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, wherein computer-readable program code is carried. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any storage medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0077] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0078] The units described in the embodiments of the present invention can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0079] It should be noted that, as another aspect, this application also provides a storage medium, which may be included in an electronic device or may exist independently without being assembled into the electronic device. The aforementioned storage medium carries one or more programs, which, when executed by an electronic device, cause the electronic device to perform the methods described in the following embodiments. For example, the electronic device may perform... Figure 1 The steps of the method shown.
[0080] In one embodiment, this application provides a computer program product including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0081] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0082] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the claims.
[0083] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A blockchain-driven federated learning method across water conservancy hubs, characterized in that, The method, applied to blockchain nodes participating in federated learning, includes: The task initiator publishes a federated learning task based on water conservancy hub data in the blockchain network and initializes the federated learning task; the blockchain network includes multiple water conservancy hub nodes. Based on a verifiable random function and combined with the node rights of water conservancy hub nodes, the node roles in the current training round are dynamically allocated; among which, the dynamically allocated node roles include: training node, aggregation node, and verification node. Each training node trains the initial global model based on its local private hydrological dataset to obtain the corresponding local model update data; the training node signs the local model update data and broadcasts it to the aggregation node. The aggregation node filters the update data of each local model based on the dual-constraint anomaly detection mechanism, and constructs candidate global models and corresponding aggregation proofs based on the filtered model update data. The verification node uses the local verification dataset to evaluate the performance of the candidate global model and generates the corresponding model performance evaluation results; and reaches a consensus based on the Byzantine fault-tolerant consensus protocol with embedded quality proof to confirm the optimal global model for the current training round. Each participating node will store the final global model, along with the corresponding consensus proof and evaluation summary, on the blockchain to complete the update of the current training round; and repeat the above steps until the termination condition is met.
2. The method according to claim 1, characterized in that, Based on a verifiable random function and considering the node rights of water conservancy hub nodes, the node roles in the current training round are dynamically allocated, including: Before the start of the current training round, the number of verification nodes is dynamically configured based on a preset security confidence level; wherein the probability that the set of verification nodes satisfies the Byzantine fault tolerance condition is higher than the security confidence level. The aggregation nodes employ a competition mechanism with a fixed number of k nodes to generate k different candidate models in parallel for evaluation by the validation nodes.
3. The method according to claim 1, characterized in that, Local model update data includes any one or a combination of the following: full parameter increments, subsets of key parameters, or low-dimensional adaptation weights.
4. The method according to claim 1, characterized in that, The aggregation node filters the update data of each local model based on a dual-constraint anomaly detection mechanism, and constructs candidate global models based on the filtered model update data, including: An outlier statistical method based on the absolute deviation of the median is used to calculate the first dynamic threshold based on the distribution of all updates in the current round. ; Get the blockchain N By analyzing the statistical characteristics of the global historical model, the deviation of the local update from the historical evolution trajectory is calculated to obtain the second historical threshold. ; The intersection of the first dynamic threshold and the second historical threshold is taken as the final filtering condition. Remove abnormal updates; The remaining eligible updates are aggregated after sampling based on node equity.
5. The method according to claim 1, characterized in that, The validation node uses the local validation dataset to evaluate the performance of candidate global models, including: The performance of candidate global models is evaluated based on multiple objective dimension indicators, including: a categorical loss improvement indicator reflecting the model's generalization ability, and a physical consistency score reflecting the degree to which the output content follows the laws of hydraulic physics.
6. The method according to claim 1, characterized in that, A consensus is reached based on a Byzantine fault-tolerant consensus protocol with embedded quality proof, confirming the optimal global model for the current training round, including: The evaluation results are constructed into a Merkle tree, and the root hash is used. Sign as a commitment; The leader node includes a Merkle proof in the proposal message. The verification node verifies whether the model quality assessment in the proposal is consistent with the original assessment result based on the proof.
7. A blockchain-driven federated learning system spanning multiple water conservancy hubs, characterized in that, The system includes: Participating nodes are used by the task initiator to publish a federated learning task based on water conservancy hub data in the blockchain network and initialize the federated learning task; the blockchain network includes multiple water conservancy hub nodes; based on a verifiable random function and combined with the node rights of the water conservancy hub nodes, the node roles in the current training round are dynamically allocated; the dynamically allocated node roles include: training node, aggregation node, and verification node. The training node is used to train the initial global model based on the local private hydrological dataset to obtain the corresponding local model update data; and to sign the local model update data and broadcast it to the aggregation node. The aggregation node is used to filter the update data of each local model based on the dual-constraint anomaly detection mechanism, and to construct candidate global models and corresponding aggregation proofs based on the filtered model update data. The validation node is used to evaluate the performance of candidate global models using the local validation dataset and generate the corresponding model performance evaluation results; and to reach a consensus based on the Byzantine fault-tolerant consensus protocol with embedded quality proof to confirm the optimal global model for the current training round. Each participating node will store the final global model, along with the corresponding consensus proof and evaluation summary, on the blockchain to update the current training round; and repeat the above steps until the termination condition is met.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the blockchain-driven federated learning method for cross-hydraulic hubs as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to implement the blockchain-driven federated learning method across water conservancy hubs as described in any one of claims 1 to 6 when executing the executable instructions.