CN-122021964-A - Power grid federal learning block chain safety management method, system, equipment and storage medium
Abstract
The invention relates to the technical field of blockchain safety, in particular to a method, a system, equipment and a storage medium for managing the safety of a federal learning blockchain of a power grid. The method comprises the steps of obtaining local power data of each node of a power grid, deploying local training strategy contracts to record key parameters in a training process and generate a local model hash value, introducing multidimensional anomaly detection to monitor gradient anomalies, loss function anomalies and model similarity anomalies in real time, executing local model training on each node, verifying the integrity of the local model, performing multi-level verification through hash value comparison, training parameter normalization verification, model precision verification and node reputation scoring calculation, deploying aggregation strategy contracts to manage a global model aggregation process, distributing aggregation weights based on node data quantity and data quality factors, executing a weighted federal average algorithm to generate a global model, and distributing the global model to each power grid node after block chain consensus verification. The method has the advantages of realizing identifiable abnormal nodes, complete verifiable model, adjustment of aggregation weight and tamper-proof storage of the global model.
Inventors
- LI QINMAN
- ZHANG XIXIANG
- LI JIN
- LIAO WEIMING
- QIN NING
- JIANG YUJIN
Assignees
- 广西电网有限责任公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251216
Claims (10)
- 1. The power grid federal learning blockchain safety management method is characterized by comprising the steps of obtaining local power data of each node of a power grid, deploying local training strategy contracts to each power grid node, recording key parameters in a training process and generating a local model hash value; Introducing multidimensional anomaly detection, monitoring gradient anomalies, loss function anomalies and model similarity anomalies in the training process in real time, performing local model training by each power grid node based on local power data, and generating a local model through dynamic learning rate adjustment; Verifying the integrity of the local model, calculating a hash value of the local model and comparing the hash value with a contract record value of the local training strategy, verifying the normalization of training parameters and the standard reaching of model precision, and calculating the credit score of the node; And deploying an aggregation policy contract, managing a global model aggregation process, recording participation node information, distributing aggregation weight based on the node data quantity and the data quality factor, and distributing a global model to each power grid node according to a participation node list in the aggregation policy contract.
- 2. A method of grid federal learning blockchain security management in accordance with claim 1, wherein the local power data includes grid operational status data, power quality monitoring data, load prediction data, and fault diagnosis data, and the local training policy contracts include record node identification, model architecture, training rounds, cycles numbers, model accuracy, local model hash values, gradient norms, loss function values, and training time stamps.
- 3. The method for managing the safety of the federal learning blockchain of the power grid according to claim 2, wherein the multi-dimensional anomaly detection comprises the steps of calculating the deviation degree of gradient update of each node from the gradient mean value of all nodes, and judging gradient anomaly when the deviation degree exceeds an anomaly threshold value; Calculating the difference and the loss change rate of the loss function value and the average loss value of each node, and judging that the loss function is abnormal when the difference or the change rate exceeds a threshold value; And calculating the similarity between the model parameters of each node and the global model, and judging that the model similarity is abnormal when the similarity is lower than a threshold value.
- 4. The method for managing power grid federal learning blockchain security of claim 3, further comprising, prior to verifying the integrity of the local model, encrypted transmission of power grid data: Each power grid node encrypts the local model, and establishes a secure communication key through key exchange; each power grid node carries out digital signature on the local model, and the digital signature is verified.
- 5. The method for grid federal learning blockchain security management of claim 4, wherein verifying local model integrity includes receiving an encrypted local model and a local training policy contract; Calculating a hash value of the local model and comparing the hash value with the hash value recorded in the local training strategy contract; checking whether the training parameters meet preset specifications or not, and checking whether the model precision meets the power grid application requirement or not; Checking whether the gradient norm is in a preset interval or not; Node reputation scores are calculated based on the historical performance and the current round performance.
- 6. The method for managing the safety of the federal learning blockchain of the power grid according to claim 5, wherein the aggregation policy contract comprises the steps of recording a unique identifier of a global model, recording a training round of current federal learning, recording a power grid node ID list participating in aggregation of the round, recording an accuracy index of the global model, recording an integrity hash value of the global model, recording an aggregation weight coefficient of each participating node, recording a node ID list detected as abnormal, and recording a result state of consensus verification.
- 7. The method for managing power grid federal learning blockchain safety of claim 6, wherein the assigning aggregate weights based on node data amounts and data quality factors comprises obtaining data amounts of nodes of each power grid; The method comprises the steps of calculating data quality factors of all nodes, comprehensively considering security scores of historical rounds, dynamically calculating aggregation weights of all nodes in current rounds based on the data quantity and the data quality factors, and reducing or removing the aggregation weights of abnormal nodes.
- 8. The power grid federation learning blockchain safety management system is based on the power grid federation learning blockchain safety management method according to any one of claims 1-7, and is characterized by further comprising a data acquisition module, a local training strategy contract is deployed to each power grid node, key parameters in the training process are recorded, and a local model hash value is generated; The model training module is used for introducing multidimensional anomaly detection, monitoring gradient anomalies, loss function anomalies and model similarity anomalies in the training process in real time, executing local model training by each power grid node based on local power data, and generating a local model through dynamic learning rate adjustment; The data comparison module is used for verifying the integrity of the local model, calculating a hash value of the local model and comparing the hash value with a contract record value of the local training strategy, verifying the normalization of training parameters and the standard reaching of model precision, and calculating a node reputation score; The data distribution module is used for deploying an aggregation policy contract, managing the global model aggregation process, recording the information of the participating nodes, distributing aggregation weight based on the data quantity and the data quality factor of the nodes, and distributing the global model to each power grid node according to the list of the participating nodes in the aggregation policy contract.
- 9. The computer equipment comprises a memory and a processor, wherein the memory stores a computer program, and the computer program is characterized in that the processor realizes the steps of the power grid federal learning block chain safety management method according to any one of claims 1-7 when executing the computer program.
- 10. A computer readable storage medium having a computer program stored thereon, wherein the computer program when executed by a processor implements the steps of the power grid federal learning blockchain security management method of any of claims 1-7.
Description
Power grid federal learning block chain safety management method, system, equipment and storage medium Technical Field The invention relates to the technical field of blockchain safety, in particular to a method, a system, equipment and a storage medium for managing the safety of a federal learning blockchain of a power grid. Background The intelligent ammeter, the transformer substation monitoring equipment, the distribution automation terminal and the power grid dispatching system which are deployed in the power grid system generate massive power data, the data are mainly analyzed through a machine learning model, and power grid state monitoring, fault prediction, load prediction and power quality analysis data are output. However, the existing federal learning architecture has some problems in power grid application, each power grid node lacks unified supervision and audit when performing local model training, the training process cannot be ensured to be standardized, a power grid dispatching center lacks a verification means when receiving the local model of each node, the power grid dispatching center is easy to be subjected to model poisoning attack of malicious nodes, each power grid node cannot verify whether the received global model is tampered, and the risk of misoperation of the power grid caused by receiving an error model exists. Transparent collaboration mechanisms are lacking among power grid operators, which nodes participate in model training is unclear, and traceability is lacking. In addition, the data quality difference and the historical performance of different power grid nodes are not fully considered in the existing scheme when the models are polymerized, so that an aggregation result is influenced by low-quality nodes, and the accuracy of the global model is reduced. Disclosure of Invention The present invention has been made in view of the problems occurring in the prior art. Therefore, the problems to be solved by the invention are how to solve the problems of insufficient model integrity verification, missing audit in the training process, unable guarantee of global model credibility, insufficient abnormal node detection capability, lack of self-adaptability in node weight distribution and the like in the federal learning architecture under the power grid environment. In order to solve the technical problems, the invention provides the following technical scheme: In a first aspect, an embodiment of the present invention provides a method for managing power grid federal learning blockchain security, including obtaining local power data of each node of a power grid, deploying a local training policy contract to each power grid node, recording key parameters in a training process, and generating a local model hash value; Introducing multidimensional anomaly detection, monitoring gradient anomalies, loss function anomalies and model similarity anomalies in the training process in real time, performing local model training by each power grid node based on local power data, and generating a local model through dynamic learning rate adjustment; Verifying the integrity of the local model, calculating a hash value of the local model and comparing the hash value with a contract record value of the local training strategy, verifying the normalization of training parameters and the standard reaching of model precision, and calculating the credit score of the node; And deploying an aggregation policy contract, managing a global model aggregation process, recording participation node information, distributing aggregation weight based on the node data quantity and the data quality factor, and distributing a global model to each power grid node according to a participation node list in the aggregation policy contract. As a preferable scheme of the power grid federal learning blockchain safety management method, the local power data comprises power grid running state data, power quality monitoring data, load prediction data and fault diagnosis data, and the local training strategy contracts comprise record node identification, model architecture, training rounds, cycle numbers, model precision, local model hash values, gradient norms, loss function values and training time stamps. The multi-dimensional anomaly detection comprises the steps of calculating the deviation degree of gradient updating of each node and gradient mean values of all nodes, and judging gradient anomaly when the deviation degree exceeds an anomaly threshold value; Calculating the difference and the loss change rate of the loss function value and the average loss value of each node, and judging that the loss function is abnormal when the difference or the change rate exceeds a threshold value; And calculating the similarity between the model parameters of each node and the global model, and judging that the model similarity is abnormal when the similarity is lower than a threshold value. The optimization method has the advan