Power data privacy protection sharing method and system and electronic equipment

By applying verification nodes and aggregation nodes in the blockchain network, combining symmetric encryption and ECDSA signature technology, the problems of privacy leakage and malicious attacks in power data sharing calculations are solved, and the secure sharing of power data and efficient model training are realized.

CN119696793APending Publication Date: 2025-03-25ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID SHANDONG ELECTRIC POWER COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411739628.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

During the power data sharing calculation process, there are data privacy security issues, including the risk of privacy leakage of user load data, the risk of malicious nodes sending inferior model updates, and the risk of privacy leakage caused by attacks on the central server.

Method used

By applying verification nodes and aggregation nodes in the blockchain network, a combined encryption strategy of symmetric encryption and elliptic curve digital signature algorithm (ECDSA) is used to verify and sign the local model to ensure the confidentiality and integrity of the model, and ensure the security of the global model through the immutability of blockchain.

Benefits of technology

It effectively prevents data from being tampered with or forged during transmission and storage, ensures the security and credibility of the model upload process, and further guarantees the security of the global model through the immutability of blockchain, reducing the risk of private information leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119696793A_ABST
    Figure CN119696793A_ABST
Patent Text Reader

Abstract

The invention discloses a power data privacy protection sharing method and system and electronic equipment, and relates to the technical field of power system security. The method is applied to a verification node in a block chain network, a target model and a first public key are obtained, the target model is a trained local model uploaded to the block chain network by a client, and the local model is signed by the client by using a first private key after being encrypted by using a symmetric key; the first public key and the first private key are generated by the client through an elliptic curve digital signature algorithm; after verifying the integrity of the local model based on the first public key, determining to-be-selected models based on a preset condition, and forming a to-be-selected model group; and based on a second private key, performing group signature on the to-be-selected model group, and uploading the to-be-selected model group to an aggregation node in the block chain network for aggregation to obtain a global model, the second private key being generated by the verification node through an elliptic curve digital signature algorithm. Therefore, the data privacy security problem existing in the electric power data sharing calculation process is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power system security technology, and more specifically, to a power data privacy protection sharing method, system and electronic equipment. Background Art

[0002] The rapid growth of society and economy is closely related to the abundant supply of natural resources, especially energy. Energy is considered to be the main engine driving economic growth and the main cause of global warming. Effective energy management can meet the demand for use while minimizing the impact on the environment, which is crucial at this stage.

[0003] Electricity accounts for an increasingly higher proportion of energy consumption, and power load data is showing a relatively rapid growth rate today. Massive amounts of power data can help power companies provide users with more sophisticated and efficient services, so making good use of power data for shared computing can maximize the value of data. Power load forecasting plays a vital role in energy management. It helps plan power infrastructure, dispatch power generation, balance supply and demand, thereby reducing the impact of fluctuations in renewable energy generation, and helps with accurate load forecasting for future time periods in energy budgets, especially short-term load forecasting (STLF) from a few minutes to a week, which directly affects the stability and efficient management of the power system.

[0004] Traditionally, individual users need to transmit local smart meter data to a data center or server to centrally store data and train the STLF model. However, this method often faces the risk of privacy leakage due to the transmission of the user's historical load data to a central server. Malicious attackers can steal the user's load data. If it is for personal household electricity use, the user's living habits, the actual number of people in the home, and other information can be inferred by analyzing the change trend of the load data. If it is industrial production-level electricity use, the production activities and operation modes of the enterprise can be stolen by analyzing the change trend of the load data. The leakage of this data may allow competitors to understand the production plan, operation time, and load peak of the enterprise, thereby inferring the production strategy and market trends of the enterprise. This may lead to the loss of competitive advantage and put the enterprise at a disadvantage in market competition. All of the above pose serious risks to citizen safety and social stability. Therefore, how to give full play to the potential value of power load data without compromising user privacy has become an important challenge.

[0005] Federated learning provides a feasible solution to the above problems. It is an emerging artificial intelligence technology that uses machine learning and distributed frameworks for model training in the context of privacy protection. In the STLF scenario, each user trains the model based on local load data and implements collaborative training of the STLF model through parameter transmission, thereby avoiding direct access to the user's private load data. However, the existence of federated learning aggregation servers and the transmission of plaintext parameters also expose users' load data to the risk of privacy leakage. Specifically, the following risks are faced in the shared computing of user power data through federated learning:

[0006] (1) In traditional federated learning load forecasting based on user power data, participants usually send model updates in plain text to a central server for aggregation. During this process, these uploaded model updates may leak some privacy information of the participants' local data.

[0007] (2) The training user nodes that hold the power load data locally may be malicious. In order to save their own resources, they may send local model updates with poor results, or forge false local model updates for upload, which greatly reduces the quality of the global load forecasting model.

[0008] (3) In the traditional federated learning data sharing computing process, there is a central server responsible for globally aggregating the local model updates uploaded by all training user nodes. If the server is attacked, there is a risk of privacy information leakage of power load data. Summary of the invention

[0009] The purpose of the present invention is to provide a power data privacy protection sharing method, system and electronic device to solve the data privacy security problem existing in the power data sharing calculation process.

[0010] In a first aspect, the present invention provides a power data privacy protection sharing method, which is applied to a verification node in a blockchain network, and the method comprises:

[0011] Obtain a target model and a first public key, wherein the target model is a trained local model uploaded by a client to the blockchain network, and the local model is encrypted by the client using a symmetric key and signed using a first private key; the first public key and the first private key are generated by the client using an elliptic curve digital signature algorithm;

[0012] Verifying the integrity of the local model based on the first public key;

[0013] After the verification is passed, the candidate models in the local model are determined based on preset conditions to form a candidate model group;

[0014] Based on the second private key, the group of selected models is group-signed and uploaded to the aggregation node in the blockchain network for aggregation to obtain a global model. The second private key is generated by the verification node through the elliptic curve digital signature algorithm.

[0015] In a preferred solution, the preset condition is that the similarity between the model feature vectors of the local models uploaded to the blockchain network by different clients satisfies a preset similarity threshold.

[0016] In a preferred solution, the similarity between the model feature vectors of the local models uploaded to the blockchain network by different clients satisfies a preset similarity threshold, including:

[0017] The Euclidean distance between the model feature vectors is less than or equal to the preset similarity threshold; or

[0018] The cosine similarity between the model feature vectors is greater than or equal to the preset similarity threshold.

[0019] In a preferred solution, the preset similarity threshold is an adaptive threshold that gradually decreases according to a preset rule as the number of training rounds of the global model increases.

[0020] In a preferred solution, the initial value of the preset similarity threshold is determined based on historical model parameter data of the global model.

[0021] In a preferred solution, the step of determining a candidate model in the local model based on a preset condition includes:

[0022] constructing the model feature vector based on the direction, size, update frequency and historical behavior of the local model, wherein the historical behavior represents a statistic of abnormal updates of the local model;

[0023] Determine whether the similarity between the model feature vectors of the local models uploaded to the blockchain network by different clients meets the preset similarity threshold;

[0024] The local model that meets the preset similarity threshold is determined as the candidate model.

[0025] In a preferred solution, after constructing the model feature vector, a weight of the model feature vector is constructed.

[0026] In a second aspect, the present invention also provides another power data privacy protection sharing method, which is applied to an aggregation node in a blockchain network, and the method includes:

[0027] Receive a candidate model group, the candidate model group is composed of candidate models uploaded by verification nodes in the blockchain network, the candidate models are local models that meet a preset condition, and the preset condition is that the similarity between model feature vectors of the local models uploaded to the blockchain network by different clients meets a preset similarity threshold;

[0028] Based on the preset contract, the candidate models are aggregated to obtain a global model.

[0029] In a preferred solution, the preset contract includes:

[0030] Determining an aggregation weight of the local model uploaded by the client based on the model feature vector and a weight of the model feature vector, wherein the model feature vector is constructed based on the direction, size, update frequency, and historical behavior of the local model;

[0031] Based on the aggregation weights, the candidate models are aggregated into the global model by weighted averaging.

[0032] In a preferred solution, determining the aggregation weight of the local model uploaded by the client based on the model feature vector and the weight of the model feature vector includes:

[0033] Determine the mixing coefficient based on the needs of the current training stage and the change in data distribution;

[0034] Based on the mixing coefficient, the data volume of the client and the model feature vector are weighed to determine the aggregation weight.

[0035] In a preferred solution, weighing the amount of data of the client and the model feature vector based on the mixing coefficient to determine the aggregation weight includes:

[0036] Based on the mixing coefficient, according to a preset formula, the amount of data of the client and the model feature vector are weighed to determine the aggregation weight;

[0037] The preset formula includes:

[0038]

[0039] Among them, n i is the data volume of the ith client, S is the set of clients used for aggregation, is the weight calculated based on the amount of data, F i [k] is the kth eigenvalue of the i-th client, α k F i The feature weight of [k], is the weight calculated based on the model feature vector, and λ is the mixing coefficient.

[0040] In a third aspect, the present invention provides another method for sharing power data with privacy protection, which is applied to a client connected to a power company through a blockchain network, and the method comprises:

[0041] Obtaining the power load forecasting task issued by the power company;

[0042] Based on the power load forecasting task, local model training is performed using local power load data;

[0043] Generate a first public key and a first private key based on an elliptic curve digital signature algorithm;

[0044] Encrypt the trained local model based on the symmetric key, and after encryption, sign it based on the first private key;

[0045] The signed local model and the first public key are uploaded to the blockchain network.

[0046] In a fourth aspect, the present invention provides a power data privacy protection sharing system, which is applied to a verification node in a blockchain network, and the system includes:

[0047] A first acquisition unit is used to obtain a target model and a first public key, wherein the target model is a trained local model uploaded by a client to the blockchain network, and the local model is encrypted by the client using a symmetric key and signed using a first private key; the first public key and the first private key are generated by the client using an elliptic curve digital signature algorithm;

[0048] A verification unit, configured to verify the integrity of the local model based on the first public key;

[0049] A selection unit, configured to determine, after verification, the candidate models in the local model based on preset conditions to form a candidate model group;

[0050] The first uploading unit is used to group-sign the candidate model group based on the second private key, and upload it to the aggregation node in the blockchain network for aggregation to obtain a global model, and the second private key is generated by the verification node through the elliptic curve digital signature algorithm.

[0051] In a fifth aspect, the present invention also provides another power data privacy protection sharing system, which is applied to an aggregation node in a blockchain network, and the system includes:

[0052] A receiving unit, configured to receive a candidate model group, wherein the candidate model group is composed of candidate models uploaded by verification nodes in the blockchain network, and the candidate models are local models determined by a preset condition that the similarity between model feature vectors of the local models uploaded to the blockchain network by different clients satisfies a preset similarity threshold;

[0053] The aggregation unit is used to aggregate the candidate models based on a preset contract to obtain a global model.

[0054] In a sixth aspect, the present invention further provides another power data privacy protection sharing system, which is applied to a client connected to a power company through a blockchain network, and the system includes:

[0055] A second acquisition unit is used to obtain the power load forecasting task issued by the power company;

[0056] A training unit, configured to perform local model training using local power load data based on the power load forecasting task;

[0057] A generating unit, configured to generate a first public key and a first private key based on an elliptic curve digital signature algorithm;

[0058] An encryption unit, used to encrypt the trained local model based on a symmetric key, and sign the encrypted model based on the first private key;

[0059] The second uploading unit is used to upload the signed local model and the first public key to the blockchain network.

[0060] In a seventh aspect, the present invention provides an electronic device, the electronic device comprising:

[0061] processor;

[0062] a memory for storing instructions executable by the processor;

[0063] The processor is used to execute the power data privacy protection sharing method provided by the first aspect, the second aspect or the third aspect of the present invention.

[0064] In order to achieve the above-mentioned purpose, the power data privacy protection sharing method, system and electronic device provided by the present invention first verify the integrity of the local model based on the first public key after obtaining the target model and the first public key, and then determine the candidate model in the local model based on the preset conditions after the verification is passed, and form a candidate model group, and then sign the candidate model group based on the second private key, and upload it to the aggregation node in the blockchain network for aggregation, and the target model is uploaded to the blockchain network by the client, and is encrypted by a symmetric key, signed by the first private key, and is a local model trained by the client, the first public key and the first private key are generated by the client through the elliptic curve digital signature algorithm, and the second private key is generated by the verification node through the elliptic curve digital signature algorithm. Thus, the confidentiality and integrity of the local model are ensured by the combined encryption strategy of symmetric encryption and ECDSA signature, that is, the data is effectively prevented from being tampered or forged during transmission and storage, and the security and credibility of the local model upload process are ensured, and the immutability of the blockchain is used to further ensure the security of the global model. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 A flowchart of a power data privacy protection sharing method provided in an embodiment of the present invention.

[0066] Figure 2 A flowchart of another power data privacy protection sharing method provided in an embodiment of the present invention.

[0067] Figure 3 A flowchart of another power data privacy protection sharing method provided in an embodiment of the present invention.

[0068] Figure 4 A structural diagram of the implementation framework of the power data privacy protection and sharing method provided in an embodiment of the present invention.

[0069] Figure 5 A structural diagram of a power data privacy protection and sharing system provided in an embodiment of the present invention.

[0070] Figure 6 A structural diagram of another power data privacy protection and sharing system provided in an embodiment of the present invention.

[0071] Figure 7 A structural diagram of another power data privacy protection and sharing system provided in an embodiment of the present invention.

[0072] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0073] The present invention is further described in detail below through the accompanying drawings and specific embodiments.

[0074] The power data privacy protection sharing method provided by the present invention is executed on an electronic device, which may be an intelligent terminal device such as a laptop, a personal computer, and a tablet computer, or may be a server on the network side.

[0075] like Figure 1 As shown, the power data privacy protection sharing method provided by the embodiment of the present invention is applied to the verification node in the blockchain network, and mainly includes the following steps:

[0076] 110. Obtain a target model and a first public key.

[0077] Among them, the target model is a trained local model uploaded by the client to the blockchain network, and the local model is encrypted by the client using a symmetric key and signed using the first private key.

[0078] The first public key and the first private key are generated by the client through the Elliptic Curve Digital Signature Algorithm (ECDSA).

[0079] 120. Based on the first public key, verify the integrity of the local model.

[0080] 130. After the verification is passed, the candidate models in the local model are determined based on the preset conditions to form a candidate model group.

[0081] 140. Based on the second private key, the model group to be selected is group-signed and uploaded to the aggregation node in the blockchain network for aggregation to obtain a global model.

[0082] The second private key is generated by the verification node through the elliptic curve digital signature algorithm.

[0083] In this embodiment, the client first uses a symmetric key K to encrypt the trained local model, and uses the ECDSA private key to sign the encrypted model, and then uploads it together with the generated ECDSA public key to the verification node of the blockchain network, so that the verification node can first verify the integrity of the uploaded local model through the ECDSA public key generated by the client, and then after confirming the qualified model, use the private key generated by itself through ECDSA to group sign the selected model, and then upload the model to the aggregation node in the blockchain network for aggregation, so as to obtain the global model.

[0084] In some possible embodiments, during the task initialization process, a trusted third party (eg, a power company) generates an initial global model W g And publish it to the blockchain network, the client generates a symmetric key K, and uses the elliptic curve digital signature algorithm (ECDSA) to generate a public key PK c and private key SK cThe client uses the symmetric key K to authenticate the local model W. i Encryption is performed to obtain CW = Encrypt (W i ,K), and then use the ECDSA private key SK c The encrypted model is signed SW = Sign (SK, CW), and finally TM = (CW, SW) is obtained, and TM is stored in the blockchain network. After that, the verification node on the blockchain network first checks the client's public key PK c To verify the integrity of the local model of each client, and then after confirming the qualified model, determine the candidate model in the qualified model based on the preset conditions to form a candidate model group, and finally verify the node using the elliptic curve digital signature algorithm (ECDSA) to generate the public key PK v and private key PK v , use your own private key PK v After the group signature is completed, it will be packaged and uploaded to the chain, and the aggregation node will run the smart contract for automatic aggregation.

[0085] Specifically, this embodiment ensures the confidentiality and integrity of the local model by using a combined encryption strategy of symmetric encryption and ECDSA signature. That is, the double-layer encryption and signature mechanism effectively prevents data from being tampered with or forged during transmission and storage, ensuring the security and credibility of the model upload process, while further ensuring the security of the global model by utilizing the immutability of the blockchain.

[0086] More specifically, by uploading the group of candidate models after group signing to the aggregation node in the blockchain network for aggregation, the central server used for model aggregation in the traditional federated learning scheme is replaced, thereby avoiding single point failure and privacy leakage on the server side.

[0087] It is understandable that when the training user node holding the local power load data is malicious, the uploaded target model may be forged, thereby greatly reducing the quality of the global load forecasting model. Based on this, in this embodiment, after verifying the integrity of the local model, the verification node determines the candidate model for aggregating the global model in the local model based on the preset conditions, thereby ensuring the quality of the global load forecasting model.

[0088] It should be noted that the preset condition can be any condition that can ensure that the verification node selects a model for aggregating the global model from the local model, and no specific limitation is made here.

[0089] Furthermore, in an optional embodiment, the preset condition is set as: the similarity between the model feature vectors of the local models uploaded to the blockchain network by different clients satisfies a preset similarity threshold.

[0090] In this embodiment, by setting the preset condition that the similarity between the model feature vectors F of the local models uploaded to the blockchain network by different clients meets the preset similarity threshold β(t), the similarity between the candidate models screened by the verification node is guaranteed, thereby improving the stability of the training process and the reliability of the obtained global model.

[0091] In an optional embodiment, the similarity between the model feature vectors of the local models uploaded to the blockchain network by different clients is further set to meet a preset similarity threshold, including:

[0092] The Euclidean distance between the model feature vectors is less than or equal to a preset similarity threshold; or

[0093] The cosine similarity between the model feature vectors is greater than or equal to a preset similarity threshold.

[0094] Specifically, the verification node calculates different client LC i ,i∈1,2,…,i,…j,…,n The similarity between the model feature vectors F uploaded is calculated using Euclidean distance or cosine similarity, that is:

[0095]

[0096]

[0097] Among them, if dist(F i ,F j )≤β(t)or cosine(F i ,F j )≥β(t), the models are considered similar, and the candidate model is determined.

[0098] Furthermore, if dist(F i ,F j )≥β(t)or cosine(F i ,F j )≤β(t), then the pair of local model parameters can be compared with the third model parameters to determine the candidate model.

[0099] In an optional embodiment, the preset similarity threshold is set as an adaptive threshold that gradually decreases according to a preset rule as the number of training rounds of the global model increases.

[0100] Specifically, β(t) is used as the threshold for model similarity detection to measure the received local models W of each client. i The similarity between them is used to select the local model parameters that meet the conditions.

[0101] More specifically, β(t) is set as an adaptive threshold that gradually decreases according to a preset rule as the number of training rounds of the global model increases, that is:

[0102] β(t)=β0·(1-γ·t) (3)

[0103] Among them, β0 is the initial value of the preset similarity threshold, γ is the decay rate, and t is the training round.

[0104] In the early stage of training, the threshold is set relatively large, allowing more local models to enter the similarity comparison, and as the training progresses, the threshold gradually decreases, making it more inclined to select more similar models to stabilize the training. At the same time, considering that as the training progresses, malicious nodes may change their attack strategies, such as changing the attack frequency or changing the size of the uploaded malicious model, by setting β(t) as an adaptive threshold that can be adjusted adaptively, it is also possible to flexibly respond to malicious nodes changing their attack strategies.

[0105] Further, in an optional embodiment, the initial value of the preset similarity threshold is determined according to the historical model parameter data of the global model.

[0106] In an optional embodiment, determining a candidate model in a local model based on a preset condition includes:

[0107] Construct a model feature vector based on the local model’s direction, size, update frequency, and historical behavior;

[0108] Among them, historical behavior represents the statistics of abnormal updates of the local model.

[0109] Determine whether the similarity between the model feature vectors of the local models uploaded to the blockchain network by different clients meets a preset similarity threshold;

[0110] The local model that meets the preset similarity threshold is determined as the candidate model.

[0111] In this embodiment, a model feature vector F = [θ, ‖W‖, f, h] is constructed based on the direction θ, size ‖W‖, update frequency f and historical behavior h of the local model. When the candidate model in the local model is determined based on preset conditions, the characteristics of the model are comprehensively considered, thereby improving the accuracy of the selected candidate model, that is, improving the reliability of the global model.

[0112] Specifically, the following can be set for the selection of the model direction θ:

[0113] For Client LC i ,i∈1,2,…,nThe local model parameters W in two consecutive training rounds t and t-1 t and W t-1In the above example, we calculate an update vector ΔW t =W t -W t-1 , and then normalize it to get the direction vector β:

[0114]

[0115] Among them, ‖Δw t ‖ is ΔW t The length of the vector is calculated as follows:

[0116]

[0117] The model size can be set as:

[0118]

[0119] You can set the update frequency to:

[0120]

[0121] Among them, ‖Δw t ‖ is the change in the model obtained above between two rounds; ‖w t-1 ‖ is the scale of the model parameters in the previous training round; ∈ is a small constant used to prevent the denominator from being zero and ensure numerical stability.

[0122] More specifically, f can reflect the significance of model parameter update if ‖Δw t ‖ relative to ‖w t-1 ‖ is larger, the f value will be higher, indicating that the model parameters have been significantly updated; if ‖Δw t ‖ relative to ‖w t-1 If ‖ is smaller, the f-value will be lower, indicating that the update of the model parameters is small or insignificant. Therefore, this method can quantify the degree of model update between different local training rounds and can be used to detect abnormal update behavior. That is, if the f-value is abnormally high, it may indicate that the model parameters have been affected by malicious attacks.

[0123] In an optional embodiment, after constructing the model feature vector, a weight of the model feature vector is constructed.

[0124] In this embodiment, by constructing the weight of the model feature vector, the weight of the direction, size, update frequency and historical behavior of the local model in determining the candidate model can be set to meet different training requirements.

[0125] In some possible embodiments, the weight of the model feature vector may be defined as: α = [α1, α2, α3, α4] and then initialized, for example, as follows: α1 = 0.4; α2 = 0.3; α3 = 0.2; α4 = 0.1.

[0126] The power data privacy protection sharing method provided by the above embodiment of the present invention effectively prevents data from being tampered or forged during transmission and storage through a double-layer encryption and signature mechanism, ensures the security and credibility of the model upload process, and further ensures the security of the global model by utilizing the immutability of the blockchain. By introducing a dynamic adjustment mechanism of the adaptive threshold β(t), the judgment criteria of model similarity can be adjusted in real time according to the process of model training and historical data, that is, the threshold is larger at the beginning of training, allowing more models to enter the similarity comparison to promote model diversity. As the training progresses, the threshold gradually decreases, so that the determined candidate model is a more similar model, ensuring the stability and convergence speed of the training. Thereby, it is possible to flexibly respond to the training needs of different stages, and effectively prevent malicious nodes from interfering with the training by frequently changing attack strategies (such as changing the attack frequency or the size of the malicious model), thereby enhancing the resistance to malicious attacks and improving robustness and security. By constructing a multidimensional feature vector and introducing feature weights, multi-dimensional features such as the direction, size, update frequency and historical behavior of the model are comprehensively considered, thereby ensuring the similarity of the determined candidate model.

[0127] like Figure 2 As shown, the embodiment of the present invention also provides another power data privacy protection sharing method, which is applied to the aggregation node in the blockchain network and mainly includes the following steps:

[0128] 210. Receive a candidate model group.

[0129] Among them, the candidate model group is composed of the candidate models uploaded by the verification nodes in the blockchain network. The candidate models are local models that meet the preset conditions. The preset conditions are that the similarity between the model feature vectors of the local models uploaded to the blockchain network by different clients meets the preset similarity threshold.

[0130] 220. Based on the preset contract, the selected models are aggregated to obtain the global model.

[0131] In this embodiment, after the verification node selects the candidate model, the candidate model is packaged and uploaded to the chain, and then the aggregation node in the blockchain runs the preset contract for automatic aggregation. This achieves the replacement of the central server in the traditional federated learning solution by introducing blockchain and preset contracts, thereby avoiding single point failures and privacy leakage on the server side, that is, further reducing the risk of privacy information leakage of power load data.

[0132] In an optional embodiment, the preset contract includes:

[0133] Based on the model feature vector and the weight of the model feature vector, the aggregation weight of the local model uploaded by the client is determined.

[0134] Among them, the model feature vector is constructed based on the direction, size, update frequency and historical behavior of the local model;

[0135] Based on the aggregation weights, the candidate models are aggregated into a global model through weighted averaging.

[0136] In this embodiment, the aggregation weight of the local model uploaded by the client is determined based on the model feature vector and the weight of the model feature vector, and then the selected models are aggregated into a global model by weighted averaging based on the aggregation weight. The model feature vector is constructed based on the direction, size, update frequency and historical behavior of the local model. Therefore, by constructing the model feature vector and introducing the weight of the model feature vector, it is achieved that multi-dimensional characteristics such as the direction, size, update frequency and historical behavior of the model are comprehensively considered when determining the aggregation weight, thereby providing the accuracy of the determined aggregation weight.

[0137] In an optional embodiment, determining the aggregation weight of the local model uploaded by the client based on the model feature vector and the weight of the model feature vector includes:

[0138] Determine the mixing coefficient based on the needs of the current training stage and the change in data distribution;

[0139] Based on the mixing coefficient, the client data volume and model feature vector are weighed to determine the aggregation weight.

[0140] In this embodiment, the aggregation weight of each client local model is comprehensively calculated based on the client data volume and the model feature vector:

[0141]

[0142] Among them, n i represents the local data volume of the i-th client, S is the client set used for aggregation, represents the weight calculated based on the amount of data, F i [k] is the kth eigenvalue of the ith client, α k is the corresponding feature weight, Represents the weight calculated based on multi-dimensional features; λ is the mixing coefficient.

[0143] Specifically, it can be seen from formula (8) that when λ is close to 1, the importance of data volume is emphasized, and when λ is close to 0, more emphasis is placed on model features. Therefore, by adjusting λ, the influence of data volume and multi-dimensional features in the final weight can be dynamically controlled to adapt to different training stages and data distributions, ensuring the stability and robustness of the global model. Finally, it is aggregated into a global model by weighted averaging. The federated learning ends when it reaches a fixed training round or the global model converges.

[0144] More specifically, a weighted aggregation mechanism based on multi-dimensional features can be used to more accurately evaluate and select candidate models, thereby improving the quality of the global model, reducing the impact of malicious updates on the system, ensuring the stability and robustness of the model, and adapting to changes in different training stages and data distribution.

[0145] In summary, the verification nodes and aggregation nodes can be trained to obtain the global model by executing the following algorithm:

[0146]

[0147]

[0148] like Figure 3 As shown, the embodiment of the present invention also provides another power data privacy protection sharing method, which is applied to a client connected to a power company through a blockchain network, and mainly includes the following steps:

[0149] 310. Obtain the power load forecasting task issued by the power company;

[0150] 320. Based on the power load forecasting task, local power load data is used for local model training;

[0151] 330. Generate a first public key and a first private key based on an elliptic curve digital signature algorithm;

[0152] 340. Encrypt the trained local model based on the symmetric key, and after encryption, sign it based on the first private key;

[0153] 350. Upload the signed local model and the first public key to the blockchain network.

[0154] It is understood that each power user, namely the local client LC i , i∈1,2,…,n Various electrical equipment used generate a large amount of power consumption data D=(Power load data) i,i∈1,2,…,n. Real-time power load data is collected through smart meters installed in homes or factory workshops. The task initiator, the power company, publishes the power load forecasting task, which requires all users to collaborate in federal training to obtain a power load forecasting model (global model) with relatively high quality.

[0155] Specifically, the power company can initialize the task parameters as: T(i) = [T N(i) ,T L(i) ,T I(i) ,T M(i) ], where i represents the task sequence number, T(i) represents the i-th task; T N(i) Indicates the task name; T L(i) represents the loss value of the federated learning target task; T I(i) represents the incentive or task reward for completing the federated learning task, in order to encourage participating users to actively use local data for federated training; T M(i) Indicates the global model identifier obtained after training.

[0156] More specifically, each client can perform data preprocessing on the collected raw power load data on the local edge device, including data cleaning, data feature normalization and other operations. The preprocessed data will be used for subsequent model training. That is, each client LC i ,i∈1,2,…,n based on its own power data (Power load data) i ,i∈1,2,…,n performs local model training.

[0157] For example, according to the power load federation forecasting task, the mean squared error (MSE) is used as the loss function, that is:

[0158]

[0159] Among them, y i represents the true value, Represents the predicted value, and the gradient is obtained by taking the partial derivative of the target task loss function Then perform the batch gradient descent algorithm to calculate W i ←W i-1 -ηg i , get the local model W i .

[0160] The specific algorithm execution process can be:

[0161]

[0162] Furthermore, the local model parameters are encrypted and decrypted by using a symmetric key. That is, during the task initialization process, the initial global model W is first generated by a trusted third party, namely the power company. g And publish it to the blockchain network, then the client generates a symmetric key K, and uses the elliptic curve digital signature algorithm (ECDSA) to generate a public key PK c and private key SK c The client uses the symmetric key K to authenticate the local model W. i Encryption is performed to obtain CW = Encrypt (W i ,K), and use the ECDSA private key SK to sign the encrypted model, sign it SW = Sign (SK, CW), TM = (CW, SW), and store TM in the blockchain network. Thus, secure data transmission is established between the client and the blockchain network, avoiding privacy leakage of the client.

[0163] Based on the power data privacy protection sharing method provided in the above embodiments, the implementation framework of the method can be as follows: Figure 4 As shown in the figure, the smart meters in each household or a factory production workshop are regarded as a unified entity, while different smart meters are isolated from each other. Different smart meters are responsible for collecting different types of power load information, such as power data generated by refrigerators, TVs and other appliances in users' homes, and power data of various devices or areas in factory workshops. Then, the local STLF model is trained based on the edge computing devices connected to each entity. After that, the local model updates generated in the local model training phase are uploaded to the blockchain network for model verification and model aggregation.

[0164] Among them, Figure 4 As shown, the implementation framework mainly includes three entity types, namely: local client (LC), model verification node (VN) and model aggregation node (AN).

[0165] Specifically, LC is the client node responsible for local model training in the federated learning system, namely the smart meter and the computing devices connected to it (computers, edge servers or other smart computing devices, etc.). It independently trains the local model based on the local data set and collaborates with other entities to learn the global model.

[0166] VN is a part of the nodes selected in the blockchain network. It serves as a verification node to verify and evaluate the local model uploaded by the local client, and verifies and selects high-quality local models by running smart contracts with adaptive thresholds and multi-dimensional feature selection algorithms, and records and stores them in the blockchain network.

[0167] AN is a part of the nodes selected in the blockchain network. It serves as an aggregation node to replace the function of the traditional federated learning center server, making the federated learning system immune to single point failures and automatically and adaptively dynamically aggregates the global model by running smart contracts.

[0168] By adopting the power data privacy protection sharing method provided by the above embodiment of the present invention, the federated collaborative training of the STLF model can be realized, while protecting the privacy of the user's original data and model parameters, and obtaining a global model with relatively high quality, and finally realizing accurate prediction of power load. In this method, multiple edge computing devices work together and gradually converge to a common prediction model without directly exchanging original data, indirectly realizing shared computing of power data.

[0169] The following is an introduction to a power data privacy protection and sharing system provided in an embodiment of the present invention. The power data privacy protection and sharing system described below can be considered as a module architecture for implementing the power data privacy protection and sharing method provided in an embodiment of the present invention; the content described below can be cross-referenced with the above.

[0170] Optional, see Figure 5 , Figure 5 This is a structural block diagram of a power data privacy protection sharing system for a verification node in a blockchain network provided by an embodiment of the present invention. The system may include:

[0171] The first acquisition unit 10 is used to obtain a target model and a first public key. The target model is a trained local model uploaded by the client to the blockchain network, and the local model is encrypted by the client using a symmetric key and signed using a first private key. The first public key and the first private key are generated by the client using an elliptic curve digital signature algorithm.

[0172] A verification unit 20, configured to verify the integrity of the local model based on the first public key;

[0173] A selection unit 30, configured to determine, after verification, the candidate models in the local model based on preset conditions to form a candidate model group;

[0174] The first uploading unit 40 is used to perform group signing on the model group to be selected based on the second private key, and upload it to the aggregation node in the blockchain network for aggregation to obtain a global model. The second private key is generated by the verification node through the elliptic curve digital signature algorithm.

[0175] Optionally, the preset condition is that the similarity between the model feature vectors of local models uploaded to the blockchain network by different clients satisfies a preset similarity threshold.

[0176] Optionally, the preset similarity threshold is an adaptive threshold that gradually decreases according to a preset rule as the number of training rounds of the global model increases.

[0177] Optionally, the initial value of the preset similarity threshold is determined based on historical model parameter data of the global model.

[0178] Optionally, the selection unit 30 is specifically configured to:

[0179] Construct a model feature vector based on the direction, size, update frequency, and historical behavior of the local model. The historical behavior represents the statistics of abnormal updates to the local model.

[0180] Determine whether the similarity between the model feature vectors of the local models uploaded to the blockchain network by different clients meets a preset similarity threshold;

[0181] The local model that meets the preset similarity threshold is determined as the candidate model.

[0182] Optionally, the selection unit 30 is more specifically configured to:

[0183] Construct the weights of the model feature vector.

[0184] Optional, see Figure 6 , Figure 6 This is a structural block diagram of a power data privacy protection sharing system for an aggregation node in a blockchain network provided by an embodiment of the present invention. The system may include:

[0185] A receiving unit 50 is used to receive a candidate model group, where the candidate model group is composed of candidate models uploaded by verification nodes in the blockchain network, and the candidate models are local models that meet a preset condition, where the preset condition is that the similarity between model feature vectors of local models uploaded to the blockchain network by different clients meets a preset similarity threshold;

[0186] The aggregation unit 60 is used to aggregate the models to be selected based on the preset contract to obtain a global model.

[0187] Optional, preset contracts include:

[0188] Determine the aggregation weight of the local model uploaded by the client based on the model feature vector and the weight of the model feature vector. The model feature vector is constructed based on the direction, size, update frequency and historical behavior of the local model.

[0189] Based on the aggregation weights, the candidate models are aggregated into a global model through weighted averaging.

[0190] Optionally, the preset contract may include:

[0191] Determine the mixing coefficient based on the needs of the current training stage and the change in data distribution;

[0192] Based on the mixing coefficient, the client data volume and model feature vector are weighed to determine the aggregation weight.

[0193] Optional, see Figure 7 , Figure 7 This is a structural block diagram of a power data privacy protection sharing system provided by an embodiment of the present invention, which is applied to a client connected to a power company through a blockchain network. The system may include:

[0194] The second acquisition unit 70 is used to obtain the power load forecasting tasks issued by the power company;

[0195] A training unit 80, configured to perform local model training using local power load data based on a power load forecasting task;

[0196] A generating unit 90, configured to generate a first public key and a first private key based on an elliptic curve digital signature algorithm;

[0197] The encryption unit 100 is used to encrypt the trained local model based on a symmetric key, and to sign the local model based on a first private key after encryption;

[0198] The second uploading unit 200 is used to upload the signed local model and the first public key to the blockchain network.

[0199] Below, reference Figure 8 To describe the electronic device provided by the embodiment of the present application, the electronic device provided by the embodiment may include: at least one processor 100, at least one communication interface 200, at least one memory 300 and at least one communication bus 400;

[0200] In the embodiment of the present invention, the number of the processor 100, the communication interface 200, the memory 300, and the communication bus 400 is at least one, and the processor 100, the communication interface 200, and the memory 300 communicate with each other through the communication bus 400; obviously, Figure 8 The communication connections shown for the processor 100, the communication interface 200, the memory 300, and the communication bus 400 are merely optional;

[0201] Optionally, the communication interface 200 may be an interface of a communication module, such as an interface of a GSM module; the processor 100 may be a central processing unit CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention.

[0202] The memory 300 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0203] The processor 100 is specifically used to execute the application program in the memory to implement the steps of the above-mentioned crane hoisting wire rope installation control method.

[0204] The above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the invention.

Claims

1. A power data privacy protection sharing method, applied to a verification node in a blockchain network, characterized in that: The method comprises: Obtain a target model and a first public key, wherein the target model is a trained local model uploaded by a client to the blockchain network, and the local model is encrypted by the client using a symmetric key and signed using a first private key; the first public key and the first private key are generated by the client using an elliptic curve digital signature algorithm; Verifying the integrity of the local model based on the first public key; After the verification is passed, the candidate models in the local model are determined based on preset conditions to form a candidate model group; Based on the second private key, the group of selected models is group-signed and uploaded to the aggregation node in the blockchain network for aggregation to obtain a global model. The second private key is generated by the verification node through the elliptic curve digital signature algorithm.

2. The power data privacy protection sharing method according to claim 1 is characterized in that: The preset condition is that the similarity between the model feature vectors of the local models uploaded to the blockchain network by different clients meets a preset similarity threshold.

3. The power data privacy protection sharing method according to claim 2 is characterized in that: The similarity between the model feature vectors of the local models uploaded to the blockchain network by different clients satisfies a preset similarity threshold, including: The Euclidean distance between the model feature vectors is less than or equal to the preset similarity threshold; or The cosine similarity between the model feature vectors is greater than or equal to the preset similarity threshold.

4. The power data privacy protection sharing method according to claim 2 is characterized in that: The preset similarity threshold is an adaptive threshold that gradually decreases according to a preset rule as the number of training rounds of the global model increases.

5. The power data privacy protection sharing method according to claim 4 is characterized in that: The initial value of the preset similarity threshold is determined according to the historical model parameter data of the global model.

6. The power data privacy protection sharing method according to claim 2 is characterized in that: The determining of a model to be selected in the local model based on a preset condition comprises: constructing the model feature vector based on the direction, size, update frequency and historical behavior of the local model, wherein the historical behavior represents a statistic of abnormal updates of the local model; Determine whether the similarity between the model feature vectors of the local models uploaded to the blockchain network by different clients meets the preset similarity threshold; The local model that meets the preset similarity threshold is determined as the candidate model.

7. The power data privacy protection sharing method according to claim 6 is characterized in that: After constructing the model feature vector, a weight of the model feature vector is constructed.

8. A power data privacy protection sharing method, applied to aggregation nodes in a blockchain network, characterized in that: The method comprises: Receive a candidate model group, the candidate model group is composed of candidate models uploaded by verification nodes in the blockchain network, the candidate models are local models that meet a preset condition, and the preset condition is that the similarity between model feature vectors of the local models uploaded to the blockchain network by different clients meets a preset similarity threshold; Based on the preset contract, the candidate models are aggregated to obtain a global model.

9. The power data privacy protection sharing method according to claim 8 is characterized in that: The preset contract includes: Determining an aggregation weight of the local model uploaded by the client based on the model feature vector and a weight of the model feature vector, wherein the model feature vector is constructed based on the direction, size, update frequency, and historical behavior of the local model; Based on the aggregation weights, the candidate models are aggregated into the global model by weighted averaging.

10. The power data privacy protection sharing method according to claim 9 is characterized in that: The determining, based on the model feature vector and the weight of the model feature vector, an aggregation weight of the local model uploaded by the client includes: Determine the mixing coefficient based on the needs of the current training stage and the change in data distribution; Based on the mixing coefficient, the data volume of the client and the model feature vector are weighed to determine the aggregation weight.

11. The power data privacy protection sharing method according to claim 10, characterized in that: The weighing the amount of data of the client and the model feature vector based on the mixing coefficient to determine the aggregation weight includes: Based on the mixing coefficient, according to a preset formula, the amount of data of the client and the model feature vector are weighed to determine the aggregation weight; The preset formula includes: Among them, n i is the data volume of the ith client, S is the set of clients used for aggregation, is the weight calculated based on the amount of data, F i [k] is the kth eigenvalue of the i-th client, α k F i The feature weight of [k], is the weight calculated based on the model feature vector, and λ is the mixing coefficient.

12. A method for sharing power data with privacy protection, applied to a client connected to a power company via a blockchain network, characterized in that: The method comprises: Obtaining the power load forecasting task issued by the power company; Based on the power load forecasting task, local model training is performed using local power load data; Generate a first public key and a first private key based on an elliptic curve digital signature algorithm; Encrypt the trained local model based on the symmetric key, and after encryption, sign it based on the first private key; The signed local model and the first public key are uploaded to the blockchain network.

13. A power data privacy protection sharing system, applied to a verification node in a blockchain network, characterized in that: The system comprises: A first acquisition unit is used to obtain a target model and a first public key, wherein the target model is a trained local model uploaded by a client to the blockchain network, and the local model is encrypted by the client using a symmetric key and signed using a first private key; the first public key and the first private key are generated by the client using an elliptic curve digital signature algorithm; A verification unit, configured to verify the integrity of the local model based on the first public key; A selection unit, configured to determine, after verification, the candidate models in the local model based on preset conditions to form a candidate model group; The first uploading unit is used to group-sign the candidate model group based on the second private key, and upload it to the aggregation node in the blockchain network for aggregation to obtain a global model, and the second private key is generated by the verification node through the elliptic curve digital signature algorithm.

14. A power data privacy protection sharing system, applied to aggregation nodes in a blockchain network, characterized in that: The system comprises: A receiving unit, configured to receive a candidate model group, wherein the candidate model group is composed of candidate models uploaded by verification nodes in the blockchain network, and the candidate models are local models determined by a preset condition that the similarity between model feature vectors of the local models uploaded to the blockchain network by different clients satisfies a preset similarity threshold; The aggregation unit is used to aggregate the candidate models based on a preset contract to obtain a global model.

15. A power data privacy protection sharing system, applied to a client connected to a power company through a blockchain network, characterized in that: The system comprises: A second acquisition unit is used to obtain the power load forecasting task issued by the power company; A training unit, configured to perform local model training using local power load data based on the power load forecasting task; A generating unit, configured to generate a first public key and a first private key based on an elliptic curve digital signature algorithm; An encryption unit, used to encrypt the trained local model based on a symmetric key, and sign the encrypted model based on the first private key; The second uploading unit is used to upload the signed local model and the first public key to the blockchain network.

16. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to execute the power data privacy protection sharing method described in any one of claims 1 to 7 or any one of claims 8 to 11 or claim 12.