Load side distributed resource trusted transaction method and system based on block chain
By building a load aggregator power load prediction model and blockchain encryption transmission technology, the problem of private information leakage in blockchain and power load management is solved, and trusted transactions of load-side resources and grid interaction are realized, ensuring the security of private information and the stability of the power grid.
Patent Information
- Application Number
- CN202510152244.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-07-08
AI Technical Summary
The existing technology has the risk of private information leakage in the process of combining blockchain and power load management, and cannot meet the requirements of trusted exchange and sharing of energy Internet data.
The power load prediction model of the pre-constructed load aggregator is used to predict, and the smart contract is deployed on the blockchain for encrypted transmission, and the load prediction value of the encrypted transmission is transmitted to the trained trading model for trusted transactions. The hybrid model of the convolutional neural network and the long and short-term memory network is used for load prediction, and privacy information is protected through attribute-based encryption.
It realizes trusted transactions of load-side resources, ensures the security of private information, reduces operating costs, makes full use of the ability of distributed adjustable resources, and improves the security and reliability of power grid interaction.
Smart Images

Figure CN120278716A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent power consumption, and particularly to a method and system for trustworthy trading of distributed resources on the load side based on blockchain. Background Art
[0002] With the accelerated construction of the new power system, the rapid development and grid connection of large-scale new energy, distributed photovoltaics, and electric vehicles, combined with the frequent occurrence of extreme weather, the characteristics of peak loads are becoming increasingly prominent. The pressure and task of ensuring power supply are great, and traditional power balancing means are difficult to sustain. The participation of adjustable resources on the demand side in grid interaction has become an important means to ensure the safe and stable operation of the power grid, maintain the smooth order of power supply and consumption, promote the consumption of renewable energy, and improve energy efficiency.
[0003] Currently, various companies have basically built a new type of power load management system, and under the guidance of local power authorities, achieved full coverage of power load management centers, which can basically support the normal operation of power load management services. Blockchain technology has been widely used in the energy Internet. However, there are risks such as leakage of private information in the combination of blockchain and power load management technology in the existing technology, which cannot meet the requirements of trustworthy exchange and sharing applications of energy Internet data. For example, the following two pieces of prior art:
[0004] Prior art one: The publication number is CN 115203734 A, and the name is: A method and system for supervising privacy data of multi-load power trading based on blockchain, as Figure 1 shown, this method is implemented based on a blockchain system, and unified data processing intelligent contracts are deployed on each level of nodes of the blockchain system. When the data processing intelligent contract monitors the action of the transaction data warehousing program of the power trading market entity corresponding to the node, it automatically runs the data processing intelligent contract to obtain the transaction data, extracts the privacy data from the transaction data, statistically analyzes the extracted privacy data, generates corresponding secondary feature data, and distributes and stores the secondary feature data on the chain. Although the present invention can automatically statistically analyze privacy transaction data without the market entity obtaining the market plaintext data, it meets the requirements of power trading privacy data permission management, and at the same time can achieve the secure and trustworthy verification of power trading privacy data. However, this processing process extracts privacy data from transaction data and processes the extracted privacy data, and there is a risk of leakage of privacy data in this process.
[0005] Prior art two: The publication number is CN 117407717 A, and the name is A method for decoupling and predicting multi-energy loads with privacy protection in the energy Internet, as Figure 2As shown in the figure, it includes the following steps: S1. Construct a multi-energy load prediction model PPenergyNET. The PPenergyNET includes local models respectively set at cold, heat, and electricity energy companies, which are used to independently extract the load characteristics of the local load data of the corresponding energy companies. The PPenergyNET also includes a global model set on the cloud server, which is used to aggregate the load characteristics of the three local models for multi-energy load prediction. S2. Learn and optimize the PPenergyNET constructed in S1. S3. Use the PPenergyNET after learning and optimization for multi-energy load prediction. By using the present invention, the training and prediction of the model can be completed only by exchanging local features, prediction results, losses, and gradient information, thus realizing data availability but invisibility and protecting the privacy of the original data. This method can accurately perform multi-energy load prediction while protecting the local data privacy of each energy company. Although this solution well protects the local data privacy, it cannot achieve shared application. Among them, ring structure vertical federated learning: ring structure vertical federated learning; multi-tasklearning: multi-task learning; modified homoscedastic uncertainty: modified homoscedastic uncertainty; heating utility: heating public utility; electric utility: electric public utility; cooling utility: cooling public utility. Summary of the Invention
[0006] In order to solve the problems in the prior art that there are risks such as privacy information leakage in the process of combining blockchain and power load management technology, and it cannot meet the requirements of trusted exchange and sharing applications of energy Internet data, the present invention proposes a method for trusted trading of distributed resources on the load side based on blockchain, including:
[0007] Predict the power load of the load aggregator based on a pre-constructed power load prediction model of the load aggregator to obtain the predicted value of the power load of the load aggregator.
[0008] Deploy a smart contract on the blockchain to encrypt and transmit the predicted value of the aggregator power load.
[0009] Transmit the encrypted predicted value of the aggregator power load to a pre-trained load aggregator trading model for trusted trading.
[0010] Optionally, the construction of the power load prediction model of the load aggregator includes:
[0011] Construct an adjustable power analysis model for a single adjustable load.
[0012] Construct an external equivalent power model for the load aggregator according to the adjustable power analysis model of the monomer
[0013] Construct an adjustable power analysis model for the load aggregator according to the external equivalent power model of the load aggregator
[0014] Construct an adjustable power transfer probability matrix for the load aggregator according to the analysis results of the adjustable power analysis model of the load aggregator
[0015] Take the adjustable power transfer probability matrix as prior information, and embed it into the hybrid model of the convolutional neural network and the long short-term memory network through weighted average to obtain the fused hybrid model
[0016] Construct a dataset based on the historical power load data of the load aggregator and the relevant influencing factors of the historical power load data, and train the fused hybrid model based on the dataset to obtain a power load prediction model for the load aggregator
[0017] Optionally, the training based on the dataset to obtain the power load prediction model for the load aggregator includes:
[0018] Divide the dataset into a training set and a validation set according to a set ratio
[0019] Substitute the power load data and the relevant influencing factors of the power load data in the training set into the fused hybrid model, extract spatio-temporal features through the convolutional neural network, and use the long short-term memory network to capture the temporal dependence relationship to obtain the spatio-temporal features and the temporal dependence relationship
[0020] Input the spatio-temporal features and the temporal dependence relationship into the fully connected layer, and through non-linear transformation, obtain the power load, learn the corresponding relationship between the power load and the spatio-temporal features and the temporal dependence relationship, and obtain the preliminarily trained hybrid model
[0021] Substitute the relevant influencing factors of the power load data in the validation set into the preliminarily trained hybrid model to obtain a prediction result, calculate the difference between the power load data in the validation set and the prediction result, and judge whether the difference meets the set threshold. If it meets, the preliminarily trained hybrid model is the power load prediction model for the load aggregator, otherwise continue training
[0022] Optionally, the training based on the dataset to obtain the power load prediction model for the load aggregator is specifically implemented as follows:
[0023] S101, Obtain the historical power load time series data and the relevant influencing factor data to form the original load dataset
[0024] S102, preprocess the original load dataset, including missing value filling, outlier handling, and data normalization, to obtain a preprocessed load dataset;
[0025] S103, construct an initial transition probability matrix based on the historical load change trend and influencing factors in the preprocessed load dataset, where this matrix represents the transition probabilities between different load states;
[0026] S104, design a convolutional neural network and long short-term memory network hybrid model architecture, where the convolutional neural network is used to extract local features of the load data, and the long short-term memory network is used to capture the load time dependence relationship;
[0027] S105, take the initial transition probability matrix as prior information and embed it into the convolutional neural network and long short-term memory network hybrid model through weighted averaging to form an enhanced hybrid prediction model;
[0028] S106, adopt a multi-scale data partitioning method to partition the preprocessed load dataset according to different time granularities such as hours, days, weeks, etc., to generate a multi-scale training dataset;
[0029] S107, use the multi-scale training dataset to train the enhanced hybrid prediction model, and optimize the model parameters through the backpropagation algorithm to obtain a trained load prediction model;
[0030] S108, input the real-time power load data into the trained load prediction model and output the load prediction results for future periods;
[0031] S109, calculate the root mean square error between the predicted load results and the actual load data to evaluate the prediction accuracy;
[0032] S1010, according to the root mean square error, use the gradient descent algorithm to dynamically adjust the parameters of the transition probability matrix and update the load prediction model;
[0033] S1011, re-embed the updated transition probability matrix into the load prediction model to achieve model adaptive optimization and improve the subsequent load prediction accuracy.
[0034] Optionally, deploying a smart contract on the blockchain to encrypt and transmit the aggregator power load prediction value includes:
[0035] Generate an attribute authority identifier, an adjustable load node identifier, and an adjustable load node public key through certificate authorization;
[0036] Generate a load aggregator node public key and a load aggregator node private key through the OwnerGen algorithm, and send the load aggregator node private key to the attribute authority through a secure channel;
[0037] Through the load aggregator node, construct an access control structure according to the attribute authority identifier, the adjustable load node identifier, the public key of the adjustable load node, the public key of the load aggregator node, and the private key of the load aggregator node;
[0038] Through the load aggregator node, classify the information attributes of the adjustable load node according to the classification standard of the information attributes of the adjustable load node. According to the classification result, perform attribute-based encryption on the predicted value of the aggregator power load using the corresponding access control structure.
[0039] Optionally, the step of, through the load aggregator node, classifying the information attributes of the adjustable load node according to the classification standard of the information attributes of the adjustable load node, and according to the classification result, performing attribute-based encryption on the predicted value of the aggregator power load using the corresponding access control structure includes:
[0040] Classify the information attributes of the adjustable load node according to the classification standard of the information attributes of the adjustable load node, and establish a set of adjustable load node attributes;
[0041] According to the set of adjustable load node attributes, perform attribute-based encryption on the predicted value of the aggregator power load, send the attribute-based encryption public key to the load aggregator node, and send the attribute-based encryption private key to the corresponding other nodes.
[0042] Optionally, the training of the load aggregator trading model includes:
[0043] Step 1: Obtain the local privacy data of N load aggregators, and construct a training set for the local privacy data of each load aggregator;
[0044] Step 2: Train the local model with the training sets of each load aggregator to obtain the updated values of the model parameters, and upload the updated values of the model parameters to the blockchain through a smart contract;
[0045] Step 3: The blockchain aggregates the updated values of the model parameters uploaded by all load aggregators to obtain the global model parameters, and returns the global model parameters to all load aggregators;
[0046] Step 4: The load aggregator calculates the mean value of the global model parameters and updates the local model of the load aggregator;
[0047] Step 5: Determine whether the local model of the load aggregator converges. If it does not converge, return to Step 2; otherwise, end the training to obtain the load aggregator trading model.
[0048] Optionally, the step of uploading the updated values of the model parameters to the blockchain through a smart contract includes:
[0049] When the smart contract is called each time, it reads the contract logic and the previous state from the blockchain. After execution, it stores the new state in the block and publishes it to all nodes.
[0050] The specific implementation steps of this step include: Since the data source has passed the credibility assessment, during the operation of the consensus algorithm, the peer node where the edge IoT agent is located directly acts as the leader node for accounting, generates a new block, and realizes the data on-chain. This process includes three steps: contract generation, contract publishing, and contract execution.
[0051] (a) Contract generation. The smart contract is deployed on the peer node, which contains the authentication information of the data source. For a trusted data source, the smart contract programs and standardizes its data on-chain transactions.
[0052] (b) Contract publishing. After the new smart contract is digitally signed by the creator, it is published to the blockchain in the form of an access address and a hash digest. Other nodes on the blockchain verify the integrity of the contract based on this. The contract publishing process realizes the consensus of all nodes on the validity of the smart contract.
[0053] (c) Contract execution. The contract execution is triggered by the data upload event of the data source. During the call process, the local ledger state is updated. After the call is completed, the transaction is confirmed and broadcast to other nodes. Since the contract carries verification information, the data can be uploaded safely and efficiently.
[0054] Optionally, before uploading the updated value of the model parameter to the blockchain through the smart contract, it further includes:
[0055] Complete the deployment of the smart contract through the node management component, and assign an account and the access permission corresponding to the account to the business system.
[0056] Optionally, the blockchain aggregates the updated values of the model parameters uploaded by all load aggregators to obtain the global model parameter, including:
[0057] The blockchain aggregates the model parameters uploaded by all load aggregators and obtains the global model parameter:
[0058]
[0059] Where is the global model parameter, is the local model parameter, m is the number of load aggregators, i is the number of the load aggregator, and t is the time.
[0060] On the other hand, the present application also provides a load-side distributed resource trusted trading system based on the blockchain, including:
[0061] A prediction module for predicting the power load of a load aggregator based on a pre-constructed power load prediction model of the load aggregator to obtain a predicted value of the power load of the load aggregator;
[0062] An encryption transmission module for deploying a smart contract on a blockchain and encrypting and transmitting the predicted value of the aggregator power load;
[0063] A transaction module for transmitting the encrypted predicted value of the aggregator power load to a pre-trained load aggregator transaction model for trustworthy transactions.
[0064] Optionally, it further includes a prediction model construction module for constructing a power load prediction model of the load aggregator;
[0065] The prediction model construction module includes:
[0066] A monomer construction sub-module for constructing an adjustable power analysis model of a monomer adjustable load;
[0067] An external equivalent model construction sub-module for constructing an external equivalent power model of the load aggregator according to the adjustable power analysis model of the monomer adjustable load;
[0068] An analysis model construction sub-module for constructing an adjustable power analysis model of the load aggregator according to the external equivalent power model of the load aggregator;
[0069] A probability matrix calculation sub-module for constructing an adjustable power transfer probability matrix of the load aggregator according to the analysis result of the adjustable power analysis model of the load aggregator;
[0070] A data fusion sub-module for using the adjustable power transfer probability matrix as prior information and embedding it into a hybrid model of a convolutional neural network and a long short-term memory network through weighted averaging to obtain a fused hybrid model;
[0071] A training sub-module for constructing a data set based on the historical power load data of the load aggregator and the influencing factors related to the historical power load data, and training the fused hybrid model based on the data set to obtain a power load prediction model of the load aggregator.
[0072] Optionally, the training sub-module is specifically used for:
[0073] Dividing the data set into a training set and a validation set according to a set ratio;
[0074] Substitute the power load data and the relevant influencing factors of the power load data in the training set into the fused hybrid model, extract spatio-temporal features through a convolutional neural network, and use a long short-term memory network to capture temporal dependencies to obtain spatio-temporal features and temporal dependencies;
[0075] Input the spatio-temporal features and temporal dependencies into a fully connected layer, and through non-linear transformation, obtain the power load, learn the corresponding relationship between the power load and the spatio-temporal features and temporal dependencies, and obtain a preliminarily trained hybrid model;
[0076] Substitute the relevant influencing factors of the power load data in the validation set into the preliminarily trained hybrid model to obtain a prediction result. Calculate the difference between the power load data in the validation set and the prediction result, and determine whether the difference meets the set threshold. If it meets, the preliminarily trained hybrid model is the power load prediction model of the load aggregator; otherwise, continue training.
[0077] Optionally, the encryption transmission module is specifically used for:
[0078] Generate an attribute authority identifier, an adjustable load node identifier, and an adjustable load node public key through certificate authorization;
[0079] Generate a load aggregator node public key and a load aggregator node private key through the OwnerGen algorithm, and send the load aggregator node private key to the attribute authority through a secure channel;
[0080] Through the load aggregator node, construct an access control structure according to the attribute authority identifier, the adjustable load node identifier, the adjustable load node public key, the load aggregator node public key, and the load aggregator node private key;
[0081] Through the load aggregator node, classify the adjustable load node information attributes according to the adjustable load node information attribute classification standard. According to the classification result, perform attribute-based encryption on the aggregator power load prediction value using the corresponding access control structure.
[0082] Optionally, the specific implementation steps of performing attribute-based encryption on the aggregator power load prediction value by the load aggregator node in the encryption transmission module according to the adjustable load node information attribute classification standard, classifying the adjustable load node information attributes according to the classification result, and using the corresponding access control structure include:
[0083] Classify the adjustable load node information attributes according to the adjustable load node information attribute classification standard, and establish an adjustable load node attribute set;
[0084] According to the set of adjustable load node attributes, perform attribute-based encryption on the predicted value of the aggregator's power load, send the attribute-based encryption public key to the load aggregator node, and send the attribute-based encryption private key to the corresponding other nodes.
[0085] Optionally, it further includes a transaction model training module, which is specifically used for:
[0086] Step 1: Obtain the local privacy data of N load aggregators, and construct a training set for the local privacy data of each load aggregator;
[0087] Step 2: Train the local model with the training sets of each load aggregator to obtain the updated values of the model parameters, and upload the updated values of the model parameters to the blockchain through a smart contract;
[0088] Step 3: The blockchain aggregates the updated values of the model parameters uploaded by all load aggregators to obtain the global model parameters, and returns the global model parameters to all load aggregators;
[0089] Step 4: The load aggregator calculates the mean of the global model parameters and updates the local model of the load aggregator;
[0090] Step 5: Determine whether the local model of the load aggregator converges. If it does not converge, return to Step 2; otherwise, end the training to obtain the load aggregator transaction model.
[0091] Optionally, the inequality in the transaction model training module is shown as follows:
[0092] |V FED -V SUM |<δ
[0093] In the formula, δ is the precision loss standard, V FED is the model precision of the global model, and V SUM is the model precision of the local model.
[0094] Optionally, the specific implementation steps for uploading the updated values of the model parameters to the blockchain by the transaction model training module include:
[0095] Each time the smart contract is called, it reads the contract logic and the previous state from the blockchain, and after execution, stores the new state in the block and publishes it to all nodes.
[0096] Optionally, before uploading the updated values of the model parameters to the blockchain by the transaction model training module, it further includes:
[0097] Complete the deployment of the smart contract through the node management component, and allocate accounts and the access rights of the corresponding accounts to the business system.
[0098] Optionally, in the transaction model training module, the blockchain aggregates the updated values of the model parameters uploaded by all load aggregators to obtain global model parameters. The specific implementation steps include:
[0099] The blockchain aggregates the model parameters uploaded by all load aggregators and obtains global model parameters:
[0100]
[0101] where is the global model parameter, is the local model parameter, m is the number of load aggregators, i is the number of the load aggregator, and t is the time.
[0102] On the other hand, the present application also provides an electronic device, including: at least one processor and a memory; the memory and the processor are connected by a bus;
[0103] The memory is used to store one or more programs;
[0104] When the one or more programs are executed by the at least one processor, the method for trustworthy trading of distributed resources on the load side based on blockchain as described above is implemented.
[0105] On the other hand, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed, the method for trustworthy trading of distributed resources on the load side based on blockchain as described above is implemented.
[0106] Compared with the prior art, the beneficial effects of the present invention are:
[0107] The present invention provides a method for trustworthy trading of distributed resources on the load side based on blockchain, including: predicting the power load of a load aggregator based on a pre-constructed power load prediction model of the load aggregator to obtain a predicted value of the power load of the load aggregator; deploying a smart contract on the blockchain to encrypt and transmit the predicted value of the aggregator power load; and transmitting the encrypted and transmitted predicted value of the aggregator power load to a pre-trained load aggregator transaction model for trustworthy trading. The present invention uses a smart contract to protect the privacy information during the process of load-side resources participating in grid interaction and trading. BRIEF DESCRIPTION OF THE DRAWINGS
[0108] Figure 1 It is a flowchart of a method for supervising privacy data of multi-load power trading based on blockchain in the prior art one;
[0109] Figure 2 It is a flowchart of a method for decoupling and predicting multi-energy loads with privacy protection in the energy Internet in the prior art two;
[0110] Figure 3 Flowchart of a blockchain-based trusted trading method for distributed resources on the load side of the present invention;
[0111] Figure 4 Schematic diagram of the structure of an electronic device according to the present invention. Detailed implementation manners
[0112] The present invention proposes a method for using blockchain technology to provide a trading venue for aggregators and dispatchable resources, which provides the potential for large-scale demand-side resources to participate in grid interaction, reduces operating costs and platform maintenance, and fully utilizes the capabilities of distributed adjustable resources in the distribution network.
[0113] To better understand the present invention, the content of the present invention will be further described below in conjunction with the accompanying drawings of the specification and embodiments.
[0114] Embodiment 1:
[0115] A blockchain-based trusted trading method for distributed resources on the load side, as Figure 3 shown, includes:
[0116] Step S1: Predict the power load of the load aggregator based on a pre-constructed power load prediction model of the load aggregator to obtain the predicted value of the power load of the load aggregator;
[0117] Step S2: Deploy a smart contract on the blockchain to encrypt and transmit the predicted value of the aggregator power load;
[0118] Step S3: Transmit the encrypted predicted value of the aggregator power load to a pre-trained load aggregator trading model for trusted trading.
[0119] A blockchain-based trusted trading method for distributed resources on the load side, which includes the following steps:
[0120] Before step S1, it further includes: constructing a power load prediction model of the load aggregator, and the specific construction of the power load prediction model of the load aggregator will be further introduced below.
[0121] The construction of the power load prediction model of the load aggregator includes:
[0122] Construct an adjustable power analysis model for a single adjustable load;
[0123] Construct an external equivalent power model of the load aggregator according to the adjustable power analysis model of the single adjustable load;
[0124] Construct an adjustable power analysis model of the load aggregator according to the external equivalent power model of the load aggregator;
[0125] According to the analysis results of the adjustable power analysis model of the load aggregator, construct an adjustable power transfer probability matrix of the load aggregator;
[0126] Take the adjustable power transfer probability matrix as prior information, and embed it into a hybrid model of a convolutional neural network and a long short-term memory network through weighted averaging to obtain a fused hybrid model;
[0127] Construct a data set based on the historical power load data of the load aggregator and the influencing factors related to the historical power load data, and train the fused hybrid model based on the data set to obtain a power load prediction model of the load aggregator.
[0128] Optionally, the training based on the data set to obtain a power load prediction model of the load aggregator includes:
[0129] Divide the data set into a training set and a validation set according to a set ratio;
[0130] Substitute the power load data and the influencing factors related to the power load data in the training set into the fused hybrid model, extract spatio-temporal features through a convolutional neural network, and use a long short-term memory network to capture temporal dependencies to obtain spatio-temporal features and temporal dependencies;
[0131] Input the spatio-temporal features and temporal dependencies into a fully connected layer, and through non-linear transformation, obtain the power load, learn the corresponding relationship between the power load and the spatio-temporal features and temporal dependencies, and obtain a preliminarily trained hybrid model;
[0132] Substitute the influencing factors related to the power load data in the validation set into the preliminarily trained hybrid model to obtain a prediction result, calculate the difference between the power load data in the validation set and the prediction result, and judge whether the difference meets a set threshold. If it meets, the preliminarily trained hybrid model is the power load prediction model of the load aggregator, otherwise continue training.
[0133] I. Analysis Model of Adjustable Characteristics of Distributed Resources on the Load Side
[0134] S101: Determine the analysis model of the adjustable characteristics of a single adjustable load resource:
[0135]
[0136] Among them, P is the typical daily operating load data of a single adjustable load resource, is the downward adjustment potential of a single adjustable load resource, is the upward adjustment potential of a single adjustable load resource, is the adjustable capacity of a single adjustable load resource, is the maximum adjustable capacity of a single adjustable load resource; P i (t) is the current operating power of the i-th single adjustable load resource at time t, is the maximum allowable power consumption of a single adjustable load resource in the current state, is the minimum allowable power consumption of the i-th single adjustable load resource in the current state, P t is the typical daily operating load data of a single adjustable load resource at time t, where t is the time, and the values are 1, 2, 3, ….
[0137] S102: Determine that the adjustable load resource aggregation external equivalent power model (the load aggregator external equivalent power model) is
[0138]
[0139] where S(t) is the total operating power of the load aggregator, P i (n, t) is the operating power of the i-th adjustable load at time t, and n is the total number of adjustable loads.
[0140] S103: Determine the adjustable characteristic analysis model of the load aggregator:
[0141]
[0142] where S is the typical daily operating load data of the load aggregator, S t is the operating load data of the load aggregator at time t on a typical day, is the downward regulation potential of the load aggregator, is the upward regulation potential of the load aggregator, is the adjustable capacity of the load aggregator, is the maximum adjustable capacity of the load aggregator; S i (t) is the current operating power of the load aggregator, is the maximum allowable power consumption of the load aggregator, is the minimum allowable power consumption of the load aggregator.
[0143] S104: Consider the adjustable power of the load aggregator as a stochastic process:
[0144]
[0145] The set of possible values of the stochastic process is denoted as the set of non-negative integers {0, 1, 2,...}. If S n = i, then it is said that the process is in state i at time t. Assume that the stochastic process is in state i and has a fixed probability Pij , making it be in state j at the next moment, that is, assuming for all states i0, i1,..., i n-1 , i, j and all n ≥ 0, there is
[0146] X{S n+1 = j|S n = i, S n = i n-1 ,..., S1 = i1, X0 = i0} = X ij 5)
[0147] For a Markov chain, given the past states S0, S1,..., S n-1 and the current state S n at a certain time, the future state S n+1 is conditionally independent of the past states and only depends on the current state. X ij represents the probability of transferring to state j next time when in state i in the past. Since probabilities are all non - negative and since the process must transfer to some state, X0 represents the initial state transition probability, i0 represents the initial state, and X represents the transition probability, that is:
[0148] X ij ≥ 0, i, j ≥ 0; 6)
[0149]
[0150] The transition probability X ij matrix:
[0151]
[0152] S105: Construct a power load prediction model for load aggregators based on CNN - LSTM. The CNN - LSTM network is mainly composed of two parts: the CNN network and the LSTM network. As the network feature extractor, CNN extracts features, while LSTM introduces gating units to retain and forget time - series features, thereby improving the prediction accuracy. Combining the respective advantages of the CNN and LSTM networks to form the CNN - LSTM network model can not only extract time - domain features but also consider the influence of multiple factors on the network. The LSTM network is an improved recurrent neural network. The introduction of gating units (input gate, output gate, forget gate) enables the LSTM network to have a memory function similar to the human brain, be able to store data information for a long time in the time series, and screen or retain data, better mining the correlation between time and information. The emergence of gating units solves the problems of the RNN network in processing long time series, such as gradient disappearance and gradient explosion.
[0153] The LSTM network introduces a new internal state ct ∈R D Specifically perform linear cyclic information transfer and simultaneously output non-linear information to the external state h of the hidden layer t ∈R D . The internal state c t is calculated by the following formula:
[0154]
[0155] h t = o t ⊙ tanh(c t ) 10)
[0156] where f t ∈ [0, 1] D , i t ∈ [0, 1] D and o t ∈ [0, 1] D are three gates to control the path of information transfer; ⊙ is the element-wise product of vectors; c t-1 is the memory cell of the previous moment; R D is the distributed representation space; D is the state dimension; is the candidate state obtained through a non-linear function:
[0157]
[0158] where W c is the weight matrix used to weight the input x at the current time step t , and the dimension of W c is determined according to the dimension of the input x t and the dimension of the cell state; U c is the weight matrix used to weight the hidden state h at the previous time step t-1 , and the dimension of U c is determined by the dimension of the hidden state and the dimension of the cell state; h t-1 is the external state of the previous moment, and b c is the bias vector used to increase the fitting ability of the model, and its dimension is the same as the dimension of the cell state.
[0159] At each moment t, the internal state c of the LSTM network t records the historical information up to the current moment. The LSTM network introduces a gating mechanism to control the path of information transfer. i t is the input gate used to control how much information of the candidate state at the current moment needs to be saved; f t is the forget gate used to control the internal state c at the previous moment t-1How much information needs to be forgotten; o t is the output gate, which controls the internal state c at the current time t How much information needs to be output to the external state h t . The "gates" in the LSTM network are "soft" gates, with values between (0, 1), indicating that information is allowed to pass through at a certain ratio. The calculation methods for the three gates are as follows:
[0160] i t = σ(W i x t + U i h t-1 + b i ) 12)
[0161] f t = σ(W f x t + U f h t-1 + b f ) 13)
[0162] o t = σ(W o x t + U o h t-1 + b o ) 14)
[0163] where σ(·) is the Logistic function, whose output range is (0, 1), x t is the input at the current time, h t-1 is the external state at the previous time, W i is the weight matrix for input gate calculation, used to weight the input x at the current time step t ; W f is the weight matrix for forget gate calculation, used to weight the input x at the current time step t ; W o is the weight matrix for output gate calculation, used to weight the input x at the current time step t ; U i is the weight matrix for input gate calculation, used to weight the hidden state h at the previous time step t-1 ; U f is the weight matrix for forget gate calculation, used to weight the hidden state h at the previous time step t-1 ; U o is another weight matrix for output gate calculation, used to weight the hidden state h at the previous time step t-1 ; b i is the bias vector for input gate calculation; b fis the bias vector calculated by the forget gate; b o is the bias vector calculated by the output gate.
[0164] The construction of the power load prediction model for load aggregators is further introduced below in combination with specific implementation cases:
[0165] S101. Obtain historical power load time series data and related influencing factor data to form an original load data set.
[0166] According to the historical operation records of the power system, obtain the power load data within a certain time range to form a time series data set. By analyzing the influencing factors of the power load, determine the key factors related to the load, such as weather, holidays, economic activities, etc. For each determined key influencing factor, obtain the corresponding factor data corresponding to the power load time series. Preprocess the obtained power load time series data to remove outliers and supplement missing values to obtain a complete load series. Match the preprocessed power load time series data with the related influencing factor data to construct a data set containing the load and influencing factors. Use the correlation analysis method to calculate the correlation coefficients between the power load and each influencing factor, and screen out the key factors with a relatively large correlation with the load. Taking the power load as the target value and the key influencing factors as the feature values, construct an original data set for load prediction to prepare for subsequent modeling.
[0167] Specifically, when designing a convolutional neural network, it is possible to consider using 3 to 5 convolutional layers, with each layer using 16 to 64 convolutional kernels of different sizes, such as 3x3, 5x5, and 7x7, to extract local features of the load data at different scales. Through the convolution operation, the ReLU activation function is used to perform a non-linear transformation on the features, and the max pooling operation is used to downsample the features to reduce the size of the feature map. When designing a long short-term memory network, 2 to 3 LSTM layers can be used, with each layer containing 64 to 128 neurons, to capture the dependencies of the load data at different time scales. The local feature vectors extracted by the convolutional neural network are used as the input to the LSTM layer. The gating mechanism is used to control the flow and update of information, and memory cells are used to store long-term dependencies. In the output layer, a fully connected layer and the Softmax activation function can be used for multi-classification tasks, or a linear activation function can be used for regression prediction tasks. The cross-entropy loss function or the mean squared error loss function is used as the optimization objective, and the Adam optimization algorithm is used to update the model parameters, with the learning rate set to 0.01. During the training process, techniques such as Early Stopping and L2 regularization can be used to prevent overfitting. Finally, the trained hybrid model is used to predict or classify new load data. Based on the probability distribution or predicted values output by the model, combined with expert knowledge and business rules, intelligent scheduling and optimization control of the load are performed, such as adjusting the power generation plan in advance according to the predicted load peak, or implementing differential electricity price policies according to the load category, to improve the economy and reliability of the power system.
[0168] S102. Preprocess the original load data set, including filling missing values, handling outliers, and data normalization, to obtain a preprocessed load data set.
[0169] S103. Construct an initial transition probability matrix based on the historical load change trends and influencing factors in the preprocessed load data set. This matrix represents the transition probabilities between different load states.
[0170] S104. Design an architecture for a hybrid model of a convolutional neural network and a long short-term memory network. The convolutional neural network is used to extract local features of the load data, and the long short-term memory network is used to capture the time dependencies of the load.
[0171] Step S2: Deploy a smart contract on the blockchain to encrypt and transmit the predicted value of the aggregator power load, including:
[0172] Generate an attribute authority identifier, an adjustable load node identifier, and an adjustable load node public key through certificate authorization;
[0173] Generate a load aggregator node public key and a load aggregator node private key through the OwnerGen algorithm, and send the load aggregator node private key to the attribute authority through a secure channel;
[0174] Through the load aggregator node, an access control structure is constructed according to the attribute authority identifier, the adjustable load node identifier, the public key of the adjustable load node, the public key of the load aggregator node, and the private key of the load aggregator node.
[0175] Through the load aggregator node, according to the classification standard of the adjustable load node information attributes, the adjustable load node information attributes are classified. According to the classification results, the corresponding access control structure is used to perform attribute-based encryption on the aggregator power load prediction value.
[0176] Optionally, the step of performing attribute-based encryption on the aggregator power load prediction value by using the corresponding access control structure according to the classification results after classifying the adjustable load node information attributes through the load aggregator node according to the classification standard of the adjustable load node information attributes includes:
[0177] According to the classification standard of the adjustable load node information attributes, the adjustable load node information attributes are classified to establish an adjustable load node attribute set.
[0178] According to the adjustable load node attribute set, attribute-based encryption is performed on the aggregator power load prediction value. The attribute-based encryption public key is sent to the load aggregator node, and the attribute-based encryption private key is sent to the corresponding other nodes.
[0179] Step S2 specifically includes:
[0180] The steps for constructing the internal access control model of the load aggregator are S201 - S206, which are specifically as follows.
[0181] S201: Let CA (certificate authority) be a trusted entity responsible for issuing and maintaining the identities of all adjustable loads and attribute authorities AA within the load aggregator. Generate an AID for each attribute authority (AA), and generate a global UID and public key PK for each adjustable load. UID .
[0182] S202: The data owner (load aggregator) executes the OwnerGen algorithm to generate a public key MK0 and a private key SK0, and sends SK0 to each attribute authority (AA) within the system through a secure channel.
[0183] Various adjustable load resources within the load aggregator submit registration applications to the system, fill in detailed information related to adjustable loads at the load aggregator node, and obtain the identifier UID and attribute set Su corresponding to their true identity information; including parameters such as electricity marketing account number, user type, voltage level, total load capacity, adjustable load capacity, maximum upward adjustment capacity, maximum downward adjustment capacity, upward adjustment rate, downward adjustment rate, duration, response time, adjustment accuracy, etc.
[0184] The load aggregator node classifies the adjustable load information according to the information classification standard, and performs attribute-based encryption on the information using different access control structures according to the classification of the information.
[0185] S203: The attribute authority is a trusted entity responsible for issuing, revoking, and updating user attributes, and is only responsible for the management of adjustable load attributes. Each attribute authority will execute the AAGen(ADI) algorithm respectively to generate a version key VK AID and the public key {PK x,AID} of attribute x.
[0186] S204: The load aggregator node classifies the adjustable load information according to the information classification standard, and performs attribute-based encryption on the information using different access control structures according to the classification of the information. Each attribute authority AA will execute KeyGen(S, SK0, VK AID , PK UID ), taking the description of the private key attribute set S, the private key SK0 of the data owner (load aggregator), the current version key VK AID , the public key PK of the adjustable load UID as input, and the output is the public key PK 0,AID for the data owner (load aggregator) to encrypt data and the private key SK UID,AID of the adjustable load identified by UID.
[0187] S205: To achieve restricted access to data, the data owner will further generate an access structure to describe the scope of authorized users and execute an algorithm on the data encryption key:
[0188]
[0189] for encryption, where m is the encryption key, A is the access structure, is the set of relevant attribute authorities I A that issues the public key for the data owner, is the set of public keys corresponding to the attribute set A issued by the attribute authority identified by AID k in I , and the ciphertext CT A is the output.
[0190] S206: The adjustable load is the data visitor. Each adjustable load has a UID identity identifier issued by the CA and an attribute plan issued by the attribute authority. After obtaining the encrypted data and the symmetric key protected by CP-ABE encryption from the service provider (which is only responsible for providing the outsourced storage of the data), the adjustable load will first execute decrypt the symmetric key, and then use the symmetric key to decrypt the data. Among them, CT A is the symmetric key protected by CP-ABE encryption, PK UID is the public key issued by the CA to the user, and SK is the private key issued by the attribute authority to this adjustable load. If the attributes of the adjustable load satisfy the access structure, the adjustable load can successfully decrypt the symmetric key and use it to decrypt the data, that is, only when the attribute set S satisfies the access structure A, the Decrypt() operation can succeed.
[0191] The service provider is responsible for providing the outsourced storage of the data and does not participate in the execution of the multi-authority CP-ABE algorithm. Among them, the data server is responsible for storing the data, and the data service manager is responsible for providing various operation services for the adjustable load to the data.
[0192] Before step S3, it also includes training the load aggregator trading model.
[0193] The training of the load aggregator trading model includes:
[0194] Step 1: Obtain the local privacy data of N load aggregators, and construct a training set for the local privacy data of each load aggregator;
[0195] Step 2: Train the local model with the training sets of each load aggregator to obtain the updated values of the model parameters, and upload the updated values of the model parameters to the blockchain through the smart contract;
[0196] Step 3: The blockchain aggregates the updated values of the model parameters uploaded by all load aggregators to obtain the global model parameters, and returns the global model parameters to all load aggregators;
[0197] Step 4: The load aggregator calculates the mean value of the global model parameters and updates the local model of the load aggregator;
[0198] Step 5: Determine whether the local model of the load aggregator converges. If it does not converge, return to Step 2. Otherwise, end the training to obtain the load aggregator trading model.
[0199] Optionally, the uploading of the updated values of the model parameters to the blockchain through the smart contract includes:
[0200] Each time a smart contract is called, it reads the contract logic and the previous state from the blockchain. After execution, the new state is stored in the block and published to all nodes.
[0201] The specific implementation steps of this step include: Since the data source has passed the credibility assessment, during the operation of the consensus algorithm, the peer node where this edge IoT agent is located directly acts as the leader node for accounting, generates a new block, and realizes the data on-chain. This process includes three steps: contract generation, contract publication, and contract execution.
[0202] (a) Contract generation. The smart contract is deployed on the peer node, which contains the authentication information of the data source. For a trusted data source, the smart contract programs and standardizes its data on-chain transactions.
[0203] (b) Contract publication. After the new smart contract is digitally signed by the creator, it is published to the blockchain in the form of an access address and a hash digest. Other nodes on the blockchain verify the integrity of the contract based on this. The contract publication process realizes the consensus of all nodes on the validity of this smart contract.
[0204] (c) Contract execution. The contract execution is triggered by the data upload event of the data source. During the call process, the local ledger state is updated. After the call is completed, the transaction is confirmed and broadcast to other nodes. Since the contract carries verification information, the data can be uploaded safely and efficiently.
[0205] Optionally, before uploading the updated value of the model parameter to the blockchain through the smart contract, it further includes:
[0206] Complete the deployment of the smart contract through the node management component, and assign an account and the access rights corresponding to the account to the business system.
[0207] Optionally, the blockchain aggregates the updated values of the model parameters uploaded by all load aggregators to obtain the global model parameter, including:
[0208] The blockchain aggregates the model parameters uploaded by all load aggregators and obtains the global model parameter:
[0209]
[0210] Where is the global model parameter, is the local model parameter, m is the number of load aggregators, i is the number of the load aggregator, and t is the time.
[0211] The construction of the load aggregator trading model mainly includes steps S301 - S306:
[0212] S301: Build a data sharing model among load aggregators based on blockchain and federated learning. Under the coordination of the central server, the essence of federated learning is a distributed machine learning framework. Each load aggregator independently calculates the updated value of the current model parameters based on local data and transmits it to the central server. The server aggregates the updates of the load aggregators to calculate a new global model, thereby achieving the purpose of data sharing. Federated learning can perform machine learning without the original data of the load aggregators leaving their localities, achieving the purpose of securely sharing data without the data leaving the localities, and becoming an important tool for protecting data security.
[0213] The update of each local model by each load aggregator can be linked to the distributed ledger provided by the blockchain for auditing the model update. In addition, the gradient of each model update can be traced back to a single load aggregator and correlated with each other, which helps to detect malicious tampering and malicious model replacement of the model by the load aggregator.
[0214] In federated learning, the data owner Q i holds the local private data D i , and all load aggregators share the model architecture θ, and the number of load aggregator digital models is m. The specific steps are as follows:
[0215] S302: N load aggregators {Q1, Q2,... Q N} each hold training sets {D1, D2,... D N}, where Q N is the Nth load aggregator, that is, the data owner, and D N is the local private data held by the Nth load aggregator, and N takes positive integer values. In federated learning, each load aggregator collaboratively trains the model M i without exposing its local data D FED to a third party.
[0216] Compared with traditional deep learning that collects these data together to obtain a summary dataset D:
[0217] D = U1 ∪ U2 … ∪ U N N, 16)
[0218] The local model M SUM is trained, and U N is the Nth subset of data.
[0219] The federated learning method is for the participating load aggregators to jointly train a global model M FED , and at the same time, the load aggregator data D i remains local and is not transmitted externally. If there exists a non - negative real number δ such that the model accuracy V of the global M FED ...FED with the local model M SUM model accuracy V SUM satisfies the following inequality:
[0220] |V FED -V SUM | < δ 17)
[0221] Then it is said that the federated learning algorithm achieves δ-precision loss. Federated learning allows a certain degree of performance deviation in the training model, but provides data security and privacy protection for all load aggregators. The commonly used framework for federated learning is the client-server architecture. In the client-server architecture, the training method of federated learning is to let each data holder train the model locally according to its own conditions and rules, and then summarize the desensitized parameters to the central server for calculation, and then send them back to each data holder to update its local model until the global model is stable. When performing federated learning training in the peer-to-peer network architecture, load aggregators can communicate directly without relying on a third party, and the security is further improved, but more computational operations are required for encryption and decryption. Currently, more research is based on the framework of a third-party server.
[0222] load aggregator Q i based on the local privacy data D i trains the model architecture θ and calculates to obtain Q i The local model parameter update value of is:
[0223]
[0224] The FedAvg algorithm uses the local stochastic gradient descent method to optimize the local model for data holders and performs aggregation operations on the central server side. The objective function is defined as follows:
[0225]
[0226] where M represents the number of data holders participating in the joint modeling, ω represents the current parameters of the model, represents the mean square error function, f(ω) represents the current function value of the model, and f(ω * ) represents the value of the objective function f when the parameter takes the optimal value w * at that time.
[0227] S303: Load aggregator Q i will local model parameters Uploaded to the blockchain through a smart contract; before data is uploaded to the blockchain, it is advisable to complete the deployment of the smart contract through the node management component, and assign an account and the access rights corresponding to the account to the business system. The data upload process to the blockchain includes application-side interface calls, middleware signature verification, verification of uploaded information, caching of uploaded information, adding to the upload task queue, calling the middleware smart contract interface, and interface callback.
[0228] Data is uploaded to the blockchain through a smart contract. Each time the smart contract is called, it reads the contract logic and the previous state from the blockchain, and after execution, stores the new state in the block and publishes it to all nodes. Since the data source has passed the credibility assessment, during the operation of the consensus algorithm, the peer node where the edge IoT agent is located directly acts as the leader node for accounting, generates a new block, and realizes data upload to the blockchain. This process includes three steps: contract generation, contract publication, and contract execution.
[0229] (a) Contract generation. The smart contract is deployed on the peer node and contains the authentication information of the data source. For a trusted data source, the smart contract programs and standardizes its data upload transactions.
[0230] (b) Contract publication. After being digitally signed by the creator, the new smart contract is published to the blockchain in the form of an access address and a hash digest, and other nodes on the blockchain verify the integrity of the contract based on this. The contract publication process realizes the consensus of all nodes on the validity of the smart contract.
[0231] (c) Contract execution. The contract execution is triggered by the data upload event of the data source. The local ledger state is updated during the call process. After the call is completed, the transaction is confirmed and broadcast to other nodes. Since the contract carries verification information, data can be uploaded safely and efficiently.
[0232] S304: The blockchain aggregates the model parameters uploaded by all load aggregators and obtains the global model parameters:
[0233]
[0234] S305: The blockchain will Return to all load aggregators, and users calculate the mean value and update the local model;
[0235] S306: Repeat the iterative process of steps S301 - S304 until the model converges.
[0236] Step S3: Transmit the encrypted predicted value of the aggregator power load to the pre-trained load aggregator trading model for trusted transactions.
[0237] Example 2:
[0238] Based on the same inventive concept, the present invention also provides a blockchain-based trusted trading system for distributed resources on the load side, including:
[0239] A prediction module, configured to predict the power load of the load aggregator based on a pre-constructed power load prediction model of the load aggregator, and obtain the predicted value of the power load of the load aggregator;
[0240] An encryption transmission module, configured to deploy a smart contract on the blockchain and encrypt and transmit the predicted value of the aggregator power load;
[0241] A trading module, configured to transmit the encrypted and transmitted predicted value of the aggregator power load to a pre-trained load aggregator trading model for trusted trading.
[0242] Optionally, it further includes a prediction model construction module, configured to construct a power load prediction model of the load aggregator;
[0243] The prediction model construction module includes:
[0244] A monomer construction sub-module, configured to construct an adjustable power analysis model of the monomer adjustable load;
[0245] An external equivalent model construction sub-module, configured to construct an external equivalent power model of the load aggregator according to the adjustable power analysis model of the monomer adjustable load;
[0246] An analysis model construction sub-module, configured to construct an adjustable power analysis model of the load aggregator according to the external equivalent power model of the load aggregator;
[0247] A probability matrix calculation sub-module, configured to construct an adjustable power transfer probability matrix of the load aggregator according to the analysis result of the adjustable power analysis model of the load aggregator;
[0248] A data fusion sub-module, configured to use the adjustable power transfer probability matrix as prior information and embed it into a hybrid model of a convolutional neural network and a long short-term memory network through a weighted average method for weighted average to obtain a fused hybrid model;
[0249] A training sub-module, configured to construct a data set based on the historical power load data of the load aggregator and the influencing factors related to the historical power load data, and train the fused hybrid model based on the data set to obtain a power load prediction model of the load aggregator.
[0250] Optionally, the training sub-module is specifically configured to:
[0251] Divide the data set into a training set and a validation set according to a set ratio;
[0252] Substitute the power load data and the relevant influencing factors of the power load data in the training set into the fused hybrid model. Extract spatio-temporal features through a convolutional neural network and capture the temporal dependence relationship using a long short-term memory network to obtain spatio-temporal features and temporal dependence relationships;
[0253] Input the spatio-temporal features and temporal dependence relationships into a fully connected layer. Through non-linear transformation, obtain the power load, learn the corresponding relationship between the power load and the spatio-temporal features and temporal dependence relationships, and obtain a preliminarily trained hybrid model;
[0254] Substitute the relevant influencing factors of the power load data in the validation set into the preliminarily trained hybrid model to obtain a prediction result. Calculate the difference between the power load data and the prediction result in the validation set, and determine whether the difference meets the set threshold. If it meets, the preliminarily trained hybrid model is the power load prediction model of the load aggregator; otherwise, continue training.
[0255] Optionally, the encryption transmission module is specifically used for:
[0256] Generate an attribute authority identifier, an adjustable load node identifier, and an adjustable load node public key through certificate authorization;
[0257] Generate a load aggregator node public key and a load aggregator node private key through the OwnerGen algorithm, and send the load aggregator node private key to the attribute authority through a secure channel;
[0258] Through the load aggregator node, construct an access control structure according to the attribute authority identifier, the adjustable load node identifier, the adjustable load node public key, the load aggregator node public key, and the load aggregator node private key;
[0259] Through the load aggregator node, classify the information attributes of the adjustable load nodes according to the classification standard of the information attributes of the adjustable load nodes. According to the classification results, perform attribute-based encryption on the predicted value of the aggregator power load using the corresponding access control structure.
[0260] Optionally, the specific implementation steps of performing attribute-based encryption on the predicted value of the aggregator power load through the load aggregator node in the encryption transmission module according to the classification standard of the information attributes of the adjustable load nodes and using the corresponding access control structure according to the classification results include:
[0261] Classify the information attributes of the adjustable load nodes according to the classification standard of the information attributes of the adjustable load nodes, and establish an adjustable load node attribute set;
[0262] According to the set of adjustable load node attributes, perform attribute-based encryption on the predicted value of the aggregator's power load, send the attribute-based encryption public key to the load aggregator node, and send the attribute-based encryption private key to the corresponding other nodes.
[0263] Optionally, it further includes a trading model training module, specifically used for:
[0264] Step 1: Obtain the local privacy data of N load aggregators, and construct a training set for the local privacy data of each load aggregator;
[0265] Step 2: Train the local model with the training sets of each load aggregator to obtain the updated values of the model parameters, and upload the updated values of the model parameters to the blockchain through a smart contract;
[0266] Step 3: The blockchain aggregates the updated values of the model parameters uploaded by all load aggregators to obtain the global model parameters, and returns the global model parameters to all load aggregators;
[0267] Step 4: The load aggregator calculates the mean of the global model parameters and updates the local model of the load aggregator;
[0268] Step 5: Determine whether the local model of the load aggregator converges. If it does not converge, return to Step 2; otherwise, end the training to obtain the trading model of the load aggregator.
[0269] Optionally, the inequality in the trading model training module is shown as follows:
[0270] |V FED -V SUM |<δ
[0271] In the formula, δ is the precision loss standard, V FED is the model precision of the global model, and V SUM is the model precision of the local model.
[0272] Optionally, the specific implementation steps for uploading the updated values of the model parameters to the blockchain by the trading model training module include:
[0273] Each time the smart contract is called, it reads the contract logic and the previous state from the blockchain, and after execution, stores the new state in the block and publishes it among all nodes.
[0274] Optionally, before uploading the updated values of the model parameters to the blockchain by the trading model training module, it further includes:
[0275] Complete the deployment of the smart contract through the node management component, and assign an account and the access rights corresponding to the account to the business system.
[0276] Optionally, in the transaction model training module, the blockchain aggregates the updated values of the model parameters uploaded by all load aggregators to obtain global model parameters. The specific implementation steps include:
[0277] The blockchain aggregates the model parameters uploaded by all load aggregators and obtains global model parameters:
[0278]
[0279] In the formula, is the global model parameter, is the local model parameter, m is the number of load aggregators, i is the number of the load aggregator, and t is the time.
[0280] Embodiment 3
[0281] As Figure 4 shown, the present invention further provides an electronic device, which may be a computer device, a single-chip microcomputer device, a smart mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, the processor, and the transceiver component are connected through a bus; the memory can be used to store an execution program, and an exemplary execution program may include instructions; the processor is used to execute the instructions stored in the memory. The memory can also be used to store data, and this data can be called and / or modified when the instructions are executed.
[0282] The processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in the storage medium to implement the corresponding method flow or corresponding function, so as to implement the steps of a load-side distributed resource trusted transaction method based on blockchain in the above embodiment.
[0283] Embodiment 4
[0284] Based on the same inventive concept, the present invention further provides a readable storage medium, specifically an electronic device-readable storage medium (Memory). The electronic device-readable storage medium is a memory device in the electronic device and is used to store programs and data. It can be understood that the storage medium here can include both the built-in storage medium in the electronic device and, of course, the extended storage medium supported by the electronic device. The storage medium provides a storage space, and this storage space stores the operating system of the terminal. Moreover, one or more instructions suitable for being loaded and executed by the processor are stored in this storage space, and these instructions can be one or more execution programs (including program codes). It should be noted that the storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. By the processor loading and executing one or more instructions stored in the storage medium, the steps of a method for trustworthy transactions of distributed resources on the load side based on blockchain in the above embodiments can be realized.
[0285] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0286] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for realizing the function specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0287] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and this instruction device realizes the function in Figure 1 one process or multiple processes and / or blocks Figure 1The functions specified in one or more boxes.
[0288] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide for implementing the steps of the functions specified in Figure 1 One process or more processes and / or boxes Figure 1 The steps of the functions specified in one box or more boxes.
[0289] The above are only embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included within the scope of the claims of the present invention pending approval.
Claims
1. A blockchain-based trustworthy trading method for distributed resources on the load side, characterized in that, Including: Predict the power load of the load aggregator based on a pre-constructed power load prediction model of the load aggregator to obtain the predicted value of the power load of the load aggregator; Deploy a smart contract on the blockchain to encrypt and transmit the predicted value of the aggregator power load; Transmit the encrypted predicted value of the aggregator power load to a pre-trained load aggregator trading model for trusted transactions.
2. The method according to claim 1, characterized in that, The construction of the power load prediction model of the load aggregator includes: Construct an adjustable power analysis model for individual adjustable loads; Construct an external equivalent power model of the load aggregator according to the adjustable power analysis model of the individual adjustable load; Construct an adjustable power analysis model of the load aggregator according to the external equivalent power model of the load aggregator; Construct an adjustable power transfer probability matrix of the load aggregator according to the analysis result of the adjustable power analysis model of the load aggregator; Take the adjustable power transfer probability matrix as prior information and embed it into a hybrid model of a convolutional neural network and a long short-term memory network through weighted averaging to obtain a fused hybrid model; Construct a data set based on the historical power load data of the load aggregator and the related influencing factors of the historical power load data, and train the fused hybrid model based on the data set to obtain a power load prediction model of the load aggregator.
3. The method according to claim 2, wherein The training of the fused hybrid model based on the data set to obtain a power load prediction model of the load aggregator includes: Divide the data set into a training set and a validation set according to a set ratio; Substitute the power load data and the related influencing factors of the power load data in the training set into the fused hybrid model, extract spatio-temporal features through a convolutional neural network, and use a long short-term memory network to capture temporal dependencies to obtain spatio-temporal features and temporal dependencies; Input the spatio-temporal features and temporal dependencies into a fully connected layer, and through non-linear transformation, obtain the power load, learn the corresponding relationship between the power load and the spatio-temporal features and temporal dependencies, and obtain a preliminarily trained hybrid model; Substitute the related influencing factors of the power load data in the validation set into the preliminarily trained hybrid model to obtain a prediction result, calculate the difference between the power load data in the validation set and the prediction result, and judge whether the difference meets the set threshold. If it meets, the preliminarily trained hybrid model is the power load prediction model of the load aggregator, otherwise continue training.
4. The method according to claim 1, wherein The deployment of a smart contract on the blockchain to encrypt and transmit the predicted value of the aggregator power load includes: Generate an attribute authority identifier, an adjustable load node identifier, and an adjustable load node public key through certificate authorization; Generate a load aggregator node public key and a load aggregator node private key through the OwnerGen algorithm, and send the load aggregator node private key to the attribute authority through a secure channel; Through the load aggregator node, construct an access control structure according to the attribute authority identifier, the adjustable load node identifier, the adjustable load node public key, the load aggregator node public key, and the load aggregator node private key; Through the load aggregator node, according to the classification standard of adjustable load node information attributes, classify the adjustable load node information attributes. According to the classification results, use the corresponding access control structure to perform attribute-based encryption on the aggregator power load prediction value.
5. The method according to claim 4, characterized in that, The method of performing attribute-based encryption on the aggregator power load prediction value through the load aggregator node, according to the classification standard of adjustable load node information attributes, classifying the adjustable load node information attributes, and using the corresponding access control structure according to the classification results includes: According to the classification standard of adjustable load node information attributes, classify the adjustable load node information attributes and establish an adjustable load node attribute set; According to the adjustable load node attribute set, perform attribute-based encryption on the aggregator power load prediction value, send the attribute-based encryption public key to the load aggregator node, and send the attribute-based encryption private key to the corresponding other nodes.
6. The method according to claim 1, wherein The training of the load aggregator trading model includes: Step 1: Obtain the local privacy data of N load aggregators, and construct a training set for the local privacy data of each load aggregator; Step 2: Train the local model with the training sets of each load aggregator to obtain the updated values of the model parameters, and upload the updated values of the model parameters to the blockchain through a smart contract; Step 3: The blockchain aggregates the updated values of the model parameters uploaded by all load aggregators to obtain the global model parameters, and returns the global model parameters to all load aggregators; Step 4: The load aggregator calculates the mean of the global model parameters and updates the local model of the load aggregator; Step 5: Determine whether the local model of the load aggregator converges. If it does not converge, return to Step 2; otherwise, end the training to obtain the load aggregator trading model.
7. The method according to claim 6, wherein The inequality is shown as follows: |V FED -V SUM |<δ Where δ is the standard of precision loss, V FED is the model precision of the global model, and V SUM is the model precision of the local model.
8. A blockchain-based trusted trading system for distributed resources on the load side, characterized in that, It includes: A prediction module for predicting the power load of the load aggregator based on a pre-constructed load aggregator power load prediction model to obtain a load aggregator power load prediction value; An encrypted transmission module for deploying a smart contract on the blockchain to perform encrypted transmission on the aggregator power load prediction value; A trading module for transmitting the encrypted aggregator power load prediction value to a pre-trained load aggregator trading model for trustworthy trading.
9. An electronic device, characterized in that, It includes: At least one processor and a memory; The memory and the processor are connected by a bus; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, a trustworthy trading method for load-side distributed resources based on blockchain as described in any one of claims 1 to 7 is implemented.
10. A readable storage medium, characterized in that, There is an execution program stored thereon, and when the execution program is executed, a trustworthy trading method for load-side distributed resources based on blockchain as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Multi-element load power transaction privacy data supervision method and system based on block chain
CN115203734A
Multi-energy load decoupling prediction method for privacy protection in energy internet
CN117407717A