A hybrid blockchain-based secure energy trading method for microgrid communities

Through hybrid blockchain technology and proxy signature algorithm, combined with identity private chain and transaction alliance chain, the trust problem and low transaction efficiency in the microgrid energy trading system are solved, and a safe and efficient energy trading platform is realized, reducing the Cost and improve transaction security and transparency.

CN112926958BActive Publication Date: 2024-11-26CHENGDU TIANYI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110299215.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-21
Publication Date
2024-11-26
Estimated Expiration
2041-03-21

AI Technical Summary

Technical Problem

The existing microgrid energy trading system has trust problems, low transaction efficiency, high cost and insufficient security. Especially in the uncontrollability and intermittent power supply instability caused by DER, there is a lack of effective management and trading platform. .

Method used

Adopting hybrid blockchain technology, combining identity private chain and transaction alliance chain, through a bilateral auction mechanism based on user reputation and proxy signature algorithm, the security and transparency of user identity authentication and transaction information are achieved, and the security of energy transactions is ensured. and efficiency.

Benefits of technology

It provides a decentralized, secure and transparent energy trading platform, which reduces transaction costs, improves transaction efficiency, ensures the security and privacy of energy transactions within the microgrid community, and forms a good market behavior incentive mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112926958B_ABST
    Figure CN112926958B_ABST
Patent Text Reader

Abstract

A method for secure energy trading in a microgrid community based on a hybrid blockchain, including the construction of a trading alliance chain, the construction of a microgrid identity private chain, and the acquisition of a user public-private key pair; an identity-based proxy signcryption algorithm to achieve buyer or seller identity authentication; a user behavior-based reputation evaluation algorithm to achieve the management of buyer or seller reputation points; and a reputation-based continuous bilateral auction mechanism to achieve the collection, interaction, sharing and storage of user information. The present invention uses hybrid blockchain technology to ensure the privacy and security of microgrid community energy trading, and provides a low-cost, open and transparent information and trading platform for microgrids, while ensuring data traceability, tamper-proofing and privacy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the secure transaction of energy within a Micro Grid (MG) community, and involves blockchain technology in the field of information security, as well as a proxy signcryption technology based on bilinear pairing properties on an elliptic curve and user identity. Background Art

[0002] Energy is a material resource in nature that can provide humans with some form of energy, such as common light, heat, and power. With the continuous advancement of science and technology, various practical electrical appliances can easily convert electrical energy into various energies required for human production and life. The existing primary energy sources are mainly fossil energy, light energy, wind energy, and hydropower, and electrical energy needs to be converted from primary energy. The traditional conversion method is thermal power generation, that is, generating electricity through the combustion of fossil fuels, but this method has the problem of low efficiency and causes serious environmental pollution. Considering the importance of protecting the environment, Distributed Energy Resources (DER) with the characteristics of low loss, less pollution and good system economy has been widely recognized.

[0003] As the number of residential and industrial users who can afford the deployment of DERs such as solar photovoltaic panels, biomass generators, micro wind turbines, and diesel engines increases year by year, more and more DERs are deployed on the industrial and residential sides for their own interests. However, due to external conditions, the electricity generated by DER is intermittent and random, which reduces the reliability of power supply. For the existing power system, when a large amount of invisible and uncontrollable electricity generated by DER flows directly into the power grid, the overall power supply line is prone to power flow over-limit problems, which seriously violates the principle that the power system must be safe and reliable.

[0004] The introduction of virtual power plant (VPP) and microgrid (MG) technologies provides a reasonable solution to the problem of DER grid connection. Limited by the existing power transmission technology, long-distance power transmission will cause some power loss. For industrial and residential users who have installed DER, short-distance and small-scale MG technology is undoubtedly a better choice. Liu Yun et al. proposed a distributed robust energy management solution for a system composed of multiple MGs in "IEEE Transactions on Sustainable Energy" 2017, 10(1) "Distributed robust energy management of a multimicrogrid system in the real-time energy market". The adjustable robust optimization technology is used to deal with the uncertainties generated in the operation of MG, thereby optimizing the total operating cost of MG, and the effectiveness of this method is verified in a 4-MG system. Zhang Xiaoshun et al. proposed a novel cyber-physical-social system for DER management in MG in Energy 2018, 165. The system has parallel learning capabilities and can promote the emergence of high-quality DER optimization strategies through human-computer interactive learning. Case studies show that the technology is faster than other heuristic algorithms in obtaining DER optimization strategies. S. Ranjbar et al. proposed a MG protection method in International Transactions on Electrical Energy Systems 2020, 30(4) “Voltage-based protection of microgrids using decision tree algorithms”. The method uses short-time Fourier transform to preprocess the voltage waveform within a cycle and extract disturbance features based on it. These features will be provided to the decision tree algorithm to identify fault events in the MG. Simulations show that only two or six features are needed to detect any fault, depending on the event type. The above literature mainly focuses on solving the technical and economic problems of microgrids, but the further development of microgrids still requires solving many management issues.The existing energy operation model mostly adopts a centralized third-party management agency to manage transactions. This management model often has the following problems: First, as the DER transaction volume within its jurisdiction increases, the operating cost of the trading center will increase accordingly, and the transaction efficiency will be greatly reduced, making it difficult to ensure the effective operation of the microgrid in real time; second, in the process of energy trading, there is no complete trust between the trading center and the trading parties, which requires the trading center to incur a considerable amount of expenses every year to maintain its own trust; in addition, there is no open and transparent transaction and information platform in MG, not only the security and effectiveness of the transaction cannot be guaranteed, but also the cost of the transaction is very high; finally, the centralized trading center is prone to single point failure, that is, the trading center will cause the collapse of the entire system after being attacked maliciously, and the leakage of leaked or tampered transaction information will directly damage the property and privacy security of both parties to the transaction.

[0005] Blockchain has the characteristics of decentralization, trustlessness, openness and transparency. With continuous research, the application scope of blockchain is no longer limited to the financial field. Adding blockchain technology to the microgrid transaction process may provide new solutions to the above management problems. MLDi Silvestre et al. considered the provision of voltage regulation technology for microgrids based on blockchain in "IEEE Transactions on Industry Applications" 2019, 55 (6) "Ancillary services in the energy blockchain for microgrids", which is mainly achieved by solving reactive power optimization flow and reactive power compensation. Reactive power optimization flow aims to ensure the optimal economic planning during reactive power production, and reactive power compensation can evaluate the contribution to voltage regulation. MUHassan et al. proposed an energy trading auction mechanism called differential privacy auction in "IEEE Transactions on Services Computing" 2019, 13 (2) "DEAL: Differentially Private Auction for Blockchain-Based Microgrids Energy Trading", which can provide cost-effective, secure and private energy auctions for microgrids based on alliance blockchain. Experimental comparison shows that this mechanism is better than the VCG mechanism. G. van Leeuwen et al. designed an integrated blockchain-based energy management platform in Applied Energy 2020, 263, “An integrated blockchain-based energy management platform with bilateral trading for microgrid communities”. The platform consists of three parts: physical layer, economic layer, and information layer. That is, it can trade energy in microgrid communities through bilateral trading mechanisms, and optimize energy flow by solving optimal power flow problems. The above literature has studied blockchain-based microgrid systems from different technical aspects, but there is still a lack of a secure method to protect energy transactions in microgrids. Summary of the invention

[0006] The purpose of this invention is to propose a microgrid community secure energy trading method based on hybrid blockchain, so as to realize the role of blockchain technology in ensuring energy security transactions within the microgrid community.

[0007] The present invention discloses a microgrid community safe energy trading method based on a hybrid blockchain, which mainly includes two types of blockchains, namely, an identity private chain for identity management and a transaction alliance chain for transactions. The identity private chain is mainly composed of an authority center, MG, and users within the jurisdiction of MG. When a user wants to conduct energy transactions, he needs to perform identity authentication on the identity private chain. Only users who pass the authentication can obtain transaction permission, otherwise they cannot use the MG power trading platform. Whether a user can pass the verification of the identity private chain depends on his own reputation. When the reputation is 0, the user can no longer use the energy trading function. In order to effectively evaluate the reputation of the user, a reputation evaluation algorithm based on user behavior is proposed. Since there are two identities of buyers and sellers in energy transactions, the algorithm is divided into two parts: a buyer behavior reputation evaluation algorithm and a seller behavior reputation evaluation algorithm. All user behaviors can be objectively reflected in their reputation scores. The central node in the private chain has concentrated power, which gives it the ability to tamper with data. To prevent this incident from happening, the hash summary of the private chain needs to be stored in a more secure alliance chain. The transaction alliance chain is mainly composed of the authority center, the power trading center, all MGs, and the DER, energy manager, and smart home manager deployed by users within its jurisdiction. During the transaction process, in order to ensure the confidentiality and non-repudiation of the quotation information, the DER and smart home manager participating in the transaction need to continuously sign and encrypt the quotation information. Although the signcryption algorithm can simplify the signing and encryption work, it is still a huge computing power burden for the DER and smart home manager with limited computing power. Therefore, we use an identity-based proxy signcryption algorithm to perform the signcryption work, that is, the original information owner such as DER and smart home manager grants the processing right of the information to the energy manager belonging to the same user, and the energy manager performs the signcryption work. All transaction information will be recorded in the alliance chain to ensure the immutability and transparency of the information.

[0008] The present invention provides a microgrid community secure energy trading method based on hybrid blockchain technology, which comprises the following steps:

[0009] (S01): The authority first builds a transaction alliance chain. After the transaction alliance chain is successfully built, the MG goes to the authority to register the registration information and builds its own exclusive identity private chain with the authority. Only when the MG community to which the user belongs has built its own identity private chain, can the community user obtain an exclusive public and private key pair after passing the identity review of the authority. The key pair is generated by an identity-based encryption algorithm. The transaction alliance chain contains all the nodes in the network, while the identity private chain is built by each MG on the basis of the alliance chain and only contains user nodes and authority nodes within its own community;

[0010] (S02): Before the transaction begins, community users need to conduct buyer or seller identity authentication on the identity private chain. Users who pass the authentication can only obtain one identity license to trade. At the beginning of identity authentication, the system will check whether the community user is on the blacklist. Only users who are not on the blacklist can choose the trading identity. When the user chooses the seller identity, the system will check whether the user has distributed energy and whether his seller reputation score is qualified. Only when both are yes, the user can obtain the seller identity license, otherwise he needs to re-select the trading identity; when the user chooses the buyer identity, the system will check whether his buyer reputation score is qualified. If qualified, it will issue a buyer identity license to him. If unqualified, it will be added to the blacklist. When user nodes are first joined, the system will give them the same initial reputation score, and each user has a buyer and seller reputation score;

[0011] (S03): After community users obtain their own transaction licenses, they can conduct energy transactions on the transaction alliance chain. The transaction method is a reputation-based continuous bilateral auction mechanism. When participating in the transaction auction, the smart energy home manager or DER and other direct energy participating nodes entrust the data processing authority to the energy manager belonging to the same user as themselves through the proxy signcryption algorithm. In order to solve the certificate management problem of traditional public key facilities, an identity-based proxy signcryption algorithm is used here to generate a proxy key. Then the energy manager can use the proxy key to signcrypt each quotation information;

[0012] (S04): After each round of transactions, the central node in the identity private chain will collect the behavior information of the community users on the transaction alliance chain. Due to the different roles played by users when participating in transactions, this behavior information can be divided into buyer behavior information and seller behavior information. After the information collection is completed, the central node will use the reputation evaluation algorithm based on user behavior to evaluate the user's new round of buyer or seller reputation score;

[0013] (S05): The accounting nodes on the identity private chain package each user's identity information, transaction behavior information, and the new round of reputation into data blocks, and then the blocks are verified by the verification nodes. The blocks that pass the verification will be connected to the identity private chain. In addition, the verification node also needs to store the hash summary of the identity private chain on the transaction alliance chain. Similar to the identity private chain, the transaction information and the hash summary of the identity private chain are packaged into data blocks by pre-selected nodes in the transaction alliance chain. Similarly, only blocks that pass the verification can be selected as the latest blocks to be added to the transaction alliance chain;

[0014] (S06): When data is stored on the blockchain, all nodes share the same data information, and the transaction records generated by each node are public. The generation of blocks in the blockchain also follows transparent consensus rules. Consensus nodes process transaction information and generate new blocks according to a specific consensus method, thereby achieving data transparency. Blocks on the blockchain are generated in chronological order, and due to the transparency of the blockchain, all transactions are public. When a dispute arises over a transaction, the transaction information can be traced according to the above conditions.

[0015] The identity-based encryption algorithm described in step (S01) of the present invention includes the following specific contents:

[0016] (1) System settings.

[0017] Setup(1 l )→(GP,MSK): The authoritative organization executes the algorithm, inputs the system security parameter l, and outputs the specific system public parameter GP and the master key MSK.

[0018] (2) Key generation

[0019] KGen(GP,MSK,ID)→(PK ID ,SK ID ): The authority inputs the system public parameter GP, the master key MSK and the user ID∈(0,1) * , output the corresponding public and private key pair (PK ID ,SK ID ).

[0020] (3) Encryption.

[0021] Enc(GP,PK ID ,M)→C: The sender inputs the system public parameter GP and the receiver’s public key PK ID And plaintext information M, output ciphertext C.

[0022] (4) Decryption.

[0023] Dec(GP,C,SK ID )→M / ⊥: The ciphertext receiver inputs the system public parameter G, the received ciphertext C and his own private key SK ID If the received ciphertext is the recipient's public key PK ID The encrypted output is the plaintext information M, otherwise it is an error symbol ⊥.

[0024] The reputation-based continuous bilateral auction mechanism described in step (S03) of the present invention is as follows:

[0025] The reputation-based continuous bilateral auction mechanism mainly integrates the reputation-based market segmentation mechanism with the continuous bilateral auction mechanism. Its sorting mechanism is a change to the original sorting mechanism of the continuous bilateral auction mechanism, which is specifically manifested as "price priority, reputation priority, time priority", rather than a reputation-based priority value sorting mechanism. When using the reputation-based continuous bilateral auction mechanism for energy auctions, the system divides multiple level lists according to the user's reputation. The higher the level, the more targets can be matched when the transaction is matched. In the bidding list constructed by the buyer, the sorting rule is to sort from high to low price (descending order); on the contrary, the sorting rule in the quotation list constructed by the seller is to sort from low to high price (ascending order). These two sorting methods are the embodiment of price priority. When the prices are the same, reputation priority is implemented in a similar way, and finally time priority. The highest bid of the buyer is called the best bid price, and the lowest bid of the seller is called the best ask price. Only when the best bid price is greater than or equal to the best ask price can the buyer and seller be matched successfully. In order to maximize the interests of each participant, the transaction price is the average of the best bid price and the best ask price.

[0026] The proxy signcryption algorithm described in step (S03) of the present invention includes the following specific contents:

[0027] (1) System settings.

[0028] Setup(1 l )→(GP,MSK): The authoritative organization executes the algorithm, inputs the system security parameter l, and the algorithm outputs the specific system public parameter GP and the master key MSK.

[0029] (2) Key generation

[0030] KGen(GP,MSK)→(PK i ,SK i ): The authority inputs the system public parameter GP and the master key MSK, and the algorithm outputs the public and private key pair (PK i ,SK i ), where the public and private key pair of the original data owner is (PK o ,SK o ), the public-private key pair (PK p ,SK p ), and the public-private key pair (PK r ,SK r ).

[0031] (3) Commissioned generation.

[0032] WGen(GP,ω,SK o )→σ ω :The original data owner inputs the system public parameter GP and his own private key SKo and proxy permission ω, the algorithm outputs a proxy σ ω , the original data owner needs to convert (ω, σ ω ) is sent to the proxy signer.

[0033] (4) Proxy signing.

[0034] PSigc(GP,ω,σ ω ,M,SK p ,PK r )→σ: The proxy signer inputs the system parameters GP, the proxy permission ω, and the power of attorney σ ω , the private key SK p , the receiver's public key PK r and message M, the algorithm outputs the ciphertext σ.

[0035] (5) Decrypt the signature.

[0036] UnSigc(GP,ω,σ,SK r ,PK0,PK p )→M / ⊥: The message receiver inputs the system parameter GP, the proxy permission ω, the ciphertext σ, and the private key SK r , the original data owner's public key PK o and the proxy signer public key PK p , if the ciphertext σ is legal, the algorithm outputs the message M, otherwise it outputs the error symbol ⊥.

[0037] The identity-based proxy signcryption algorithm described in step (S03) of the present invention includes the following specific contents:

[0038] (1) System settings.

[0039] Setup(1 l )→(GP,MSK): The authoritative organization executes the algorithm, inputs the system security parameter l, and the algorithm outputs the specific system public parameter GP and the master key MSK.

[0040] (2) Key generation

[0041] KGen(GP,MSK,ID)→(PK ID ,SK ID ): The authority inputs the system public parameter GP, the master key MSK and the user ID∈(0,1) * , output the corresponding public and private key pair (PK ID ,SK ID ), where the public and private key pair of the original data owner is (PK o ,SK o ), the public-private key pair (PK p,SK p ), and the public-private key pair (PK r ,SK r ).

[0042] (3) Proxy key generation.

[0043] PKGen(GP,ω,SK o ,SK p )→PSK op :Community users input system public parameters GP, proxy permission ω, the private keys of the original data owner and the proxy signer (SK o ,SK p ), the algorithm outputs the proxy key PSK op .

[0044] (4) Proxy signing.

[0045] PSigc(GP,ω,M,PK r ,PSK op ,SK p )→σ: The proxy signer inputs the system parameter GP, the proxy permission ω, the message M, and the receiver’s public key PK r , proxy key PSK op , the private key SK p , the algorithm outputs the ciphertext σ.

[0046] (5) Decrypt the signature.

[0047] UnSigc(GP,σ,SK r ,PK r ,PK o ,PK p )→M / ⊥: The message receiver inputs the system parameter GP, the ciphertext σ, and the public-private key pair (PK r ,SK r ), the original data owner's public key PK o and the proxy signer public key PK p , if the ciphertext σ is legal, the algorithm outputs the message M, otherwise it outputs the error symbol ⊥.

[0048] The reputation evaluation algorithm based on user behavior described in step (S04) of the present invention is as follows:

[0049] (1) Buyer behavior reputation evaluation algorithm.

[0050] Buyers in the MG community are mainly consumers who need to buy energy. When the reputation of a prosumer is 0 or its DER power supply cannot meet its own needs, this type of prosumer is also a buyer. In the buyer behavior reputation evaluation algorithm, there are three main events that affect the buyer's reputation evaluation, namely, breach of contract events, demand response events, and block generation events. The reputation points generated by these three events are respectively called the buyer's contract reputation points. Demand Response Reputation Score And consensus reputation score When this round of transactions is over, the buyer's latest reputation score R i Equal to the reputation score at the beginning of the transaction Add the reputation scores generated by the above three types of events, as shown in formula (1):

[0051]

[0052] Where R is a response judgment value. When buyer i obtains the response qualification, R = 1, otherwise, R = 0.

[0053] (2) Seller behavior reputation evaluation algorithm.

[0054] The sellers in the MG community are only prosumers. In the seller behavior reputation evaluation algorithm, there are also three events that affect the seller's reputation, namely, breach of contract events, feedback events, and block generation events. The reputation points generated by these three events are called the seller's contract reputation points. Feedback reputation points And consensus reputation score When this round of transactions is over, the seller's latest reputation score R j Equal to the reputation score R' at the beginning of the transaction j Add the reputation points generated by the above three types of events, as shown in formula (2):

[0055]

[0056] A method for secure energy trading in a microgrid community based on hybrid blockchain technology described in the present invention. For the type of blockchain adopted, the public chain allows all network nodes to participate, and its security is the highest. However, the deployment of the public chain will sacrifice a large number of resources, and the public chain has low scalability and weak data throughput, which do not support the application of the public chain in commercial transactions with large data volumes; the private chain has the disadvantage of being too centralized, which makes the private chain only suitable for information sharing within a single entity, but not suitable for storing transaction information involving multiple entities; the alliance chain is a compromise between the public chain and the private chain. On the premise of retaining the advantages of the above two blockchains, there are no extreme disadvantages, so the alliance chain is the most common blockchain in existing blockchain applications. For energy transactions in microgrid communities, because it involves the transfer of digital property, a blockchain with a higher security level is required, and the public chain takes too much time, and the private chain has the risk of central nodes tampering with data, so the alliance blockchain naturally becomes the best choice. In practical applications, it is difficult for a single chain to provide an effective user identity management function, which easily provides criminals with opportunities to do evil. Therefore, the present invention also provides an identity chain outside the transaction chain to authenticate and manage the identity of the trader. During the operation of the microgrid, a microgrid community can be regarded as an entity. Usually, transactions are conducted within the community, so each microgrid community can establish its own identity chain to manage traders. Based on the above characteristics, the microgrid can use a private chain as the basic framework of its identity chain. In order to solve the problem of data tampering on the private chain, we store the hash summary of the private chain in the transaction alliance chain, and rely on the security of the alliance chain to ensure the security of the private chain data. In the identity private chain, the present invention adopts a strong leadership Raft consensus mechanism, which can ensure the rapid generation of data blocks. In the transaction alliance chain, the present invention adopts a reputation-based Byzantine fault-tolerant algorithm consensus mechanism, which ensures that even if there are some abnormal nodes in the system, it will not affect the final result.

[0057] The present invention uses hybrid blockchain technology to ensure the privacy and security of microgrid community energy transactions, and provides a low-cost, open and transparent information and transaction platform for the microgrid community. At the beginning of the transaction, the identity private chain is used to authenticate the user's identity, and the user's reputation is closely related to the result of the identity authentication. Authenticated users can conduct energy transactions on the transaction alliance chain. The transaction adopts a reputation-based continuous bilateral auction mechanism, which allows users to continuously update their quotations during the auction process and can also improve the influence of reputation points. In order to ensure the confidentiality and non-repudiation of quotation information, an identity-based proxy signcryption technology is adopted. The algorithm allows transaction participants with limited computing power to entrust all their information processing rights to proxy signers with stronger computing power. The legal effect of the information signed by the proxy signer is equivalent to that signed by the original data signer himself. After the transaction is completed, all the behavioral information of community users will be collected. The reputation evaluation algorithm based on user behavior can objectively reflect all the user's behaviors in their reputation scores. The higher the reputation of the user, the more benefits they will gain, which is conducive to forming good market behavior. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 The basic structure of the microgrid provided by CERTS, including is the common coupling point, For energy managers, For separation device, For circuit breaker, is a power-voltage controller, is the heat load, For micro power supply.

[0059] Figure 2 A microgrid data storage and sharing model based on a hybrid blockchain framework. Among them is the alliance chain block, For private chain blocks, For prosumers, For consumers, For wind power generation, For photovoltaic power generation, For fuel cells, For energy managers.

[0060] Figure 3 Flowchart for building and joining a private identity chain.

[0061] Figure 4 This is the identity authentication flow chart.

[0062] Figure 5 It is a secure transaction model based on the transaction alliance chain.

[0063] Figure 6This is a simplified PBFT algorithm consensus flow chart. DETAILED DESCRIPTION

[0064] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0065] The earliest microgrid concept was proposed by the Consortium for Electric Reliability Technology Solutions (CERTS) in the United States, and this concept is also the most authoritative one. The CERTS microgrid assumes that the collection of loads and DERs operates as a single system. Its key feature is that it can exist in the distribution system as an autonomous and independent self-controlled entity. In other words, it is impossible to distinguish the microgrid from the legitimate customer site in the power grid. Its basic structure is as follows: Figure 1 The present invention adopts a 1+N hybrid blockchain framework to realize the secure transaction of microgrids, that is, there is one alliance transaction chain and N identity private chains in the whole network, and N is determined by the number of microgrids.

[0066] 1. Model design of the present invention.

[0067] like Figure 2 , is the overall structure of the present invention, and the specific parameters are defined as follows:

[0068] Prosumer nodes: Prosumer nodes refer to community user nodes that are equipped with DERs such as distributed power sources, distributed energy storage or controllable loads. For prosumer nodes, when they have excess energy, they can participate in energy transactions on the alliance chain as sellers; when the DERs they deploy are difficult to meet their own electricity needs, prosumer nodes will participate in energy transactions as buyers like ordinary consumer nodes. It should be noted that when the seller reputation score of a prosumer node is 0, the prosumer node can only exist in the network as an ordinary consumer node. Prosumer nodes are mainly responsible for providing energy to consumer nodes, and consumer nodes need to pay corresponding remuneration to prosumer nodes.

[0069] Consumer node: A consumer node refers to a community user node with a smart home manager installed. Unlike a prosumer node, a consumer node can only participate in energy transactions on the alliance chain as a buyer. When the reputation of a consumer node is 0, the MG Energy Trading Platform will refuse the consumer node from participating in energy transactions. After each transaction, the consumer node can provide feedback on the quality of power supply services to the prosumer node that provides it with energy, and this feedback will affect the reputation score of the prosumer node.

[0070] Microgrid nodes: Microgrid nodes are the initiators of building private identity chains. Only when microgrid nodes successfully build their own private identity chains based on the transaction alliance chain can community users under their jurisdiction join the energy trading network. On the private identity chain they have built, microgrid nodes are responsible for generating blocks as central nodes, and are also responsible for running a reputation evaluation algorithm based on user behavior to evaluate user reputation after each round of transactions. On the transaction alliance chain, microgrid nodes exist as energy auctioneers, mainly responsible for running a reputation-based continuous bilateral auction mechanism to match transactions between producer and consumer nodes.

[0071] Trusted institution node: This node is considered to be the most secure and trustworthy. In the present invention, it refers to the authoritative institution and the power trading center. The authoritative institution exists both in the identity private chain and in the trading alliance chain. Its main function is to verify the node identity information and generate exclusive public and private key pairs for the passed nodes. In addition, the selection of the consensus committee in the trading alliance chain is performed by the authoritative institution. The power trading center only exists in the trading alliance chain, and it exists in the energy trading process as an energy balancer. When the auction ends, if energy balance is not achieved in the MG community, MG needs to send an energy balance request to the power trading center, and the power trading center needs to actively respond to MG's request.

[0072] The symbols used in the present invention are shown in Table 1:

[0073] Table 1 Symbols used in the present invention

[0074]

[0075]

[0076] 2. The identity private chain construction and joining process of the present invention.

[0077] When users want to trade energy, they need to authenticate their identity on the private identity chain. Only users who pass the authentication can obtain trading permission, otherwise they cannot use the MG Power Trading Platform. For community users who use the platform for the first time, they first need to register their identity information so that they have the opportunity to join the private identity chain, as shown in (S01). The detailed process of building and joining the private identity chain is as follows: Figure 3 As shown, steps 1-3 belong to the process of building the identity private chain, and steps 4-7 are the process of joining the community user node.

[0078] (1) Construction process.

[0079] In the construction process, step 1 means that the MG manager sends an identity private chain construction application to the authority, which contains the identity information of the MG community, the maximum power limit, and the divided jurisdiction area. After receiving the application from MG, the authority reviews the application, and returns a success message to MG after the review is passed, and invites MG to build an identity private chain exclusively for the MG community. This is the meaning of step 2. Step 3 means that MG and the authority jointly build a private chain.

[0080] (2) Join the process.

[0081] After the identity private chain is successfully built, community users can apply to join the private chain. The first step of the joining process, that is, step 4, is that community users need to send registration information to the authority. Unlike consumers, the registration information of prosumers not only contains the identity information that consumers should send, but also needs to provide detailed information of the deployed DER. After receiving the registration information of community users, the authority will carefully verify the information. The verified information will be encrypted and uploaded to the private chain of the community to which the user belongs. Then the authority will generate a dedicated key for the user and issue it. Steps 5 and 6 are such a process. As shown in step 7, after the user receives the dedicated key, he can officially join the identity private chain according to the key.

[0082] 3. The identity authentication process of the present invention.

[0083] In the present invention, successfully joining the identity private chain does not mean that you can use the MG energy trading platform to trade energy. Only after obtaining trading permission on the identity private chain can you officially trade energy on the trading alliance chain. To obtain trading permission, you must perform identity authentication on the identity private chain, such as (S02).

[0084] Figure 4This is the flow chart of identity authentication. As can be seen from the figure, in identity authentication, the system will first check whether the user node ID exists in the blacklist BL. If it exists, it will refuse to use the energy trading function. Otherwise, it will proceed to the next step. Then, the user node selects the role it plays on the trading alliance chain. There are only two roles to choose from: seller and buyer. When selecting a seller, the system checks whether the user node has a DER certified by an authoritative organization. If not, it returns to the previous step and reselects the role. If it does, it checks the seller reputation value of the user to which the node belongs. If the reputation value is equal to 0, it will re-enter the role selection process. If the reputation value is not 0, it will issue a seller license. When selecting a buyer, the system only needs to check the buyer reputation value of the user to which the node belongs. If the reputation value is equal to 0, the user ID will be added to the BL and refused to conduct energy trading. If the reputation value is not 0, it will issue a buyer license. Finally, users who obtain seller or buyer licenses can conduct energy trading on the trading alliance chain with the license. For prosumers, they can choose to trade as sellers or buyers. Therefore, in each round of transactions, the identity private chain only provides one identity authentication for each user. After the transaction is completed, the system recalculates the reputation score of each node based on its performance in the transaction. For all newly joined nodes, the system will give them the same initial reputation score, and each node has a seller reputation score and a buyer reputation score, but only prosumers can use the seller reputation score. For prosumers with a seller reputation of 0, they can no longer trade energy on TCB as a seller and can only purchase energy like ordinary consumers; and for users on the blacklist BL, they cannot re-register with the authority to obtain a new node identity, and the method of regaining trading rights is formulated by the authority.

[0085] 4. The transaction process of the present invention.

[0086] At present, the forms of DER energy trading in the MG energy trading platform are mainly divided into two types: P2P trading and centralized clearing. P2P trading is a direct transaction between individuals, and the transaction is automatically executed according to the corresponding contract, but such transactions are chaotic and disorderly, which can easily cause disorder in the power system. Centralized clearing requires a third-party platform to conduct unified transactions under optimized scheduling, reducing the risk of system disorder. Due to the trust issues of third-party platforms, the centralized clearing transaction model has always been criticized. The emergence of blockchain provides a new solution to the trust problem. The transaction method used on the trading alliance chain is the continuous double auction (CDA) in centralized clearing. The quotation information required for the auction is transmitted using an identity-based proxy signcryption algorithm, such as (S03). There are only three trading entities in the traditional CDA, namely the auctioneer, the buyer and the seller, while on the trading alliance chain, there is an additional power trading center that acts as an energy balancer. Secure trading model such as Figure 5 , the details are as follows:

[0087] (1) Initialization.

[0088] After the community users pass the identity authentication of the private chain, they can conduct transactions with corresponding identities on the trading alliance chain according to their identity permissions. Users who have obtained the seller's permission play the role of seller, and those who have obtained the buyer's permission play the role of buyer. The auctioneer is played by the MG manager node, and the keys of the transaction participants are all generated by authoritative institutions.

[0089] (2) Quotation collection.

[0090] Although the smart home manager or DER as a light node can generate quotations and sign them to the MG manager node, frequent signcryption work requires a lot of computing power. In addition, there will be multiple energy quotations belonging to the same entity in the auction list, which increases the workload of the auction and causes unnecessary waste. As a full node, the energy manager can first integrate the quotation information of the user's home manager, and then sign the quotation information through an identity-based proxy signcryption algorithm, and finally send the signed information to the MG management node. In this way, the effect of light nodes participating in transactions in person can be achieved, and the problems caused by their personal participation can be solved.

[0091] (3)Energy auctions.

[0092] After receiving the proxy signcryption information from buyers and sellers, the MG manager node decrypts it. After decrypting the signcryption to obtain the quotation information, the auction is matched according to the quotation. In order to increase users' attention to reputation, the CDA auction mechanism based on reputation is adopted for auction, that is, users are divided into levels according to their scores. Users with higher levels have a wider range of matches, and they are matched according to the matching rules of "price first, reputation first, time first". At the end of the auction, if energy balance is not achieved in the MG community, energy transactions will be conducted with the power trading center depending on the situation.

[0093] (4) Trading and settlement.

[0094] Successfully matched community users check the transaction information, and after confirming that it is correct, they confirm the transaction contract and conduct energy transactions. During the transaction, users who default will be subject to economic penalties, and default behavior will cause their reputation value to decrease. Transaction settlement needs to be carried out through the system's unique energy coins, which are generated by the power trading center. When each user first joins the trading alliance chain, he can receive a certain amount of energy coins for free with his ID, and each ID can only receive it once.

[0095] 5. The consensus process of the present invention.

[0096] The system adopted by the present invention is a 1+N hybrid blockchain system, which is essentially a transaction alliance chain and N identity private chains. Since there are two different blockchains, the present invention simultaneously adopts two consensus algorithms to generate blocks, namely the Raft consensus algorithm and the PBFT consensus algorithm, as shown in (S05).

[0097] (1) Consensus algorithm on the private identity chain.

[0098] The private chain built by MG itself has a high degree of centralization and has a central node, which coincides with the strong leadership characteristics of the Raft consensus algorithm, so the present invention uses the Raft consensus algorithm on the identity private chain. The strong leadership form of the Raft consensus algorithm is mainly manifested in that all log entries flow only from the leader server to the backup server, which simplifies the management of the replicated log. There are three identities in the Raft consensus mechanism: leader, candidate and follower. In the identity private chain built by MG, the leader is selected by MG from its manager node, and the other unselected MG manager nodes and authoritative structure nodes are candidates, and the followers are the community user nodes in the identity private chain. Candidates are candidates for leaders. When the leader cannot operate normally, the new leader will be selected from the candidates. Only when all MG manager nodes fail, the authoritative agency node will temporarily serve as the leader. The process of generating blocks using the Raft consensus algorithm can be simplified into three steps: the first step is that the leader node reviews the reputation data of the community users. If the review is passed, it will be sent to the energy manager nodes of each community user for re-inspection. In the second step, the energy manager node re-verifies the data sent by the leader node and returns the re-verification results to the leader node. In the third step, the leader node packages the data that has passed both the verification and re-verification into blocks and uploads them to the local private chain. To prevent the MG manager node on the private chain from tampering with the data, the block hash value on the private chain is uploaded to the transaction alliance chain. In addition, the Raft consensus algorithm will not affect the user's reputation.

[0099] (2) Consensus algorithm on the transaction alliance chain.

[0100] The PBFT consensus algorithm is used on the transaction alliance chain. The PBFT consensus algorithm used in the present invention has been modified from the original algorithm, mainly in the formation of the consensus committee. In the original algorithm, the consensus committee is composed of pre-selected consensus nodes, the number of nodes in the consensus committee is fixed, and the consensus nodes will not change. In the modified PBFT algorithm, the consensus nodes that form the consensus committee are constantly changing. At the beginning of each round of transactions, the system will reselect consensus nodes to form a new consensus committee. The working time of each consensus committee is a transaction cycle time planned by the system. In order to encourage each micro-network trading platform to maintain good internal trading behavior, the system will construct a consensus committee based on the principle of "reputation first, quantity first". In essence, it is to first select the first-ranked MG community according to the selection principle, and then select the H-1 user nodes and one MG manager node with the highest reputation ranking from the MG community to form a consensus committee, and H is the fixed number of nodes that constitute the consensus committee. The reputation priority in the selection rules refers to the priority selection of the MG community with the highest reputation. The reputation of the MG community is determined by its internal users, and its calculation formula is as follows.

[0101]

[0102] In the formula, l represents the number of buyers in the MG community at this time, and m represents the number of sellers. If the reputations of the MG communities are the same, the MG community with the largest number of users will be selected first. The same MG community cannot be selected continuously. When this happens, the quota will be postponed to the second place.

[0103] After the consensus committee is established, the members of the committee generate blocks according to the same consensus process as the original PBFT consensus algorithm, such as Figure 6 As shown. The PBFT distributed consensus process is divided into five stages: request, pre-preparation, preparation, commitment, and reply. At the beginning of the request stage, the authority sends the client's request to the MG manager node; after receiving the request, the algorithm enters the pre-preparation stage, which requires the MG manager node to broadcast the execution order of the transaction to the user nodes within the consensus committee; in the preparation stage, for the received information, the user node has two different behaviors, one is to accept and forward the received information to each node, and the other is to do nothing. The node in the second state is called a Byzantine node, as shown in Figure 6The trigger condition of the commitment phase is to receive (Hf) identical request messages. If they are met, the commitment information will be broadcast to the entire network. f is the number of Byzantine nodes in the consensus node and f needs to satisfy f≤(H-1) / 3. In the reply phase, the consensus node will also feedback to the authority center after collecting (Hf) identical commitment messages. The verified information will be packaged into blocks and uploaded to the transaction alliance chain. Except for the MG manager node, other consensus nodes can obtain reputation rewards after the block is generated.

[0104] 6. Safety analysis of the present invention.

[0105] The data security of the present invention is crucial to the entire MG Energy Trading Platform and meets the security requirements for data trading and data storage. The relevant security is as follows:

[0106] (1) Privacy and confidentiality: The present invention uses both transaction alliance chain and identity private chain to store information. The user's identity information is all stored in the identity private chain. When the user conducts transactions on the transaction alliance, the attacker cannot learn the user's real identity information from the transaction information. To ensure the confidentiality of transaction information, we use an identity-based proxy signcryption algorithm, in which the quotation submitted by the user is encrypted using a symmetric encryption key. Without obtaining the symmetric encryption key, the nodes on the alliance chain cannot understand the quotation information contained in the decrypted document.

[0107] (2) Transparency and traceability: As a shared ledger, all nodes in the blockchain store the same data information, and the transaction records generated by each node are public. The generation of blocks in the blockchain also follows transparent consensus rules. Consensus nodes process transaction information and generate new blocks according to a specific consensus method, thereby achieving data transparency. Blocks on the blockchain are generated in chronological order, and due to the transparency of the blockchain, all transactions are public. When questions arise about a transaction, the transaction information can be traced according to the above conditions.

[0108] (3) Immutability: The difficulty of data tampering on the blockchain is related to the consensus algorithm used. The present invention adopts the Raft consensus algorithm on the private chain and the PBFT consensus algorithm on the alliance. The central node of the private chain has powerful power. In order to prevent the central node from tampering with the data, the block summary of the private chain is stored in the alliance chain. Therefore, the immutability of the scheme is mainly achieved by the PBFT consensus algorithm on the alliance chain. The PBFT algorithm is the most commonly used alliance chain consensus algorithm at present, with high scalability and low consumption. When the PBFT algorithm is used, even if there are 33% Byzantine nodes in the system, the system can still work normally. In addition, the consensus nodes of the present invention are selected from high-reputation nodes, and the higher the reputation of the node, the more benefits it obtains. It is unrealistic for more than one-third of the high-reputation nodes to violate their own interests to undermine the stability of the system.

[0109] (4) Non-repudiation: The non-repudiation of information is achieved by digital signatures. Before being stored in the blockchain, the signature information will be broadcast and verified between nodes. Only the verified information can be stored. When a transaction dispute occurs, the non-repudiation of the transaction can be achieved by tracing the transaction signature in the blockchain. The identity-based proxy signcryption scheme adopted in this paper can not only encrypt the information, but also further sign the information. Since the transaction entity does not have enough computing power to perform frequent signcryption, we entrust the data signcryption right to a proxy signcryptor with strong computing power. The information signed by the proxy signcryptor is equivalent to the original signcryptor's signcryption information.

[0110] 7. The present invention will be further illustrated by the following two examples.

[0111] Embodiment 1: After the transaction is completed, the MG node collects user behavior information and performs reputation evaluation, such as (S04).

[0112] In addition, this is Figure 4 The reputation source in the detailed steps are as follows:

[0113] In the traditional centralized power supply mode, the user's electricity consumption behavior always changes according to the change of time period, and it is this change that leads to the emergence of peak and trough periods of electricity consumption. Peak period usually refers to electricity consumption when electricity consumption behavior is concentrated and power supply is tight. The trough period is just the opposite, usually referring to electricity consumption when electricity consumption behavior is less and power supply is sufficient. The detailed peak and valley time periods are mainly divided according to the local season and the time when the peak and valley loads occur. There will be slight differences in the peak and valley time periods in different regions. Therefore, only three time periods, peak section H, average section A and valley section L, are defined here, and no detailed time division is given. In order to better restrict the user's trading behavior, the present invention defines a time adaptive weight parameter η(T) according to the peak and valley time periods,

[0114]

[0115] In the formula, no matter whether the transaction time T is in the peak period or the trough period, its weight is greater than the weight of the average period. This is to enhance the user's attention to electricity consumption in these two periods and reduce the probability of their bad trading behavior.

[0116] (1) Buyer behavior reputation evaluation algorithm.

[0117] When the buyer and seller reach a transaction intention and sign a contract through an auction, the seller begins to transmit electricity to the buyer. When the buyer's actual electricity consumption within the agreed time slot exceeds the agreed transaction volume, the seller's interests will be damaged because the number of tokens specified in the contract is fixed.

[0118] Therefore, this paper uses whether the contract is breached or not as one of the buyer’s reputation evaluation indicators. The buyer’s contract reputation score is shown in formula (5).

[0119]

[0120] In the formula, is the contract reputation score of buyer i after the t-1th round of transactions; T i Transaction time for buyer i; is the actual electricity consumption of buyer i in the transaction time slot; The amount of electricity agreed in the contract. When the buyer breaches the contract, in order to make up for the seller's economic losses, the buyer must compensate the seller for the excess electricity according to the electricity price of the power trading center.

[0121] Demand response events refer to the situation when electricity is tight. In order to balance the energy demand of the power supply system, each MG publishes a demand response to reduce energy usage to its community and announces the total amount of energy that needs to be reduced. Buyers who are qualified to respond reduce their own electricity consumption according to the agreed response amount. The buyer's demand response reputation score is shown in formula (6).

[0122]

[0123] In the formula, T is the reputation score of buyer i’s demand response after the t-1th round of transactions; i,d.5% T represents the time duration during which the deviation between buyer i’s response capacity and the agreed capacity is less than 5%; i,d.5%~25% Indicates the duration of the deviation between 5% and 25%; T i,d.25%~50% Indicates the duration when the deviation is between 25% and 50%; It represents the total time required for buyer i to respond in the t-1th round of transactions; r is 1, indicating that buyer i responds as required, and r is 0, indicating no response.

[0124] The generation of blocks is inseparable from the consensus algorithm. In order to motivate nodes on the network to actively participate in the consensus process, the system will give a certain amount of reputation points as rewards to the nodes participating in the consensus process. The calculation formula for the consensus reputation points is as follows.

[0125]

[0126] In the formula, is the consensus reputation score of buyer i after the t-1th round of transactions; k i It represents the number of times buyer i participates in the consensus process in the t-1th round of transactions; the value of α is always greater than 0, and the specific value depends on the block generation rate, and the two are inversely proportional.

[0127] In summary, before the buyer prepares to conduct the tth round of transactions, we can calculate the buyer's reputation value when participating in the tth round of transactions according to formula (8).

[0128]

[0129] In the formula, R i,t represents the reputation value of buyer i when participating in the tth round of transactions; R i,t-1 Represents the reputation value at round t-1; R is a judgment function. When buyer i obtains the response qualification, R=1, otherwise, R=0; when buyer i participates in the transaction for the first time, its initial reputation is 50.

[0130] (2) Seller Behavior Reputation Evaluation Algorithm

[0131] When the actual power supply of the prosumer does not reach the contracted transaction volume, at this time, in order to meet its own electricity needs, the buyer needs to purchase electricity from the power trading center. The electricity price of the power trading center is often higher than the transaction electricity price in the MG community, which will cause property losses to the buyer.

[0132] Therefore, whether the contract is breached or not can also be used as one of the seller's reputation evaluation indicators. The seller's contract reputation score is shown in formula (9).

[0133]

[0134] In the formula, is the contract reputation score of seller j after the t-1th round of transactions; T j is the transaction time of seller j; is the actual power supply of seller j in the trading time slot. When seller j defaults, it will subsidize the extra money that buyer i spends on purchasing electricity in the power trading center.

[0135] Feedback event means that after the transaction between buyer i and seller j is completed, buyer i needs to provide feedback on the power supply service quality of seller j. The feedback is expressed as F ij Indicates that, and Fij The value range of is [-0.5, 0.5], and the feedback reputation score of seller j is shown in formula (10).

[0136]

[0137] In the formula, is the feedback reputation score of seller j after the t-1th round of transactions; L is the number of buyers who have provided feedback to seller j; E i It is a feedback equalization function, which is mainly used to equalize the feedback value.

[0138] E i The values ​​of E are only 0 and 1. i To work, we first need to calculate the average value of buyer feedback F a and standard deviation F sd , and their calculation formulas are shown in formula (11) and formula (12) respectively.

[0139]

[0140]

[0141] Then, according to F a and F sd To obtain the equilibrium parameter ε, see formula (13).

[0142] ε=F a -F sd (13)

[0143] Finally, E is realized by formula (14) i Assignment of .

[0144]

[0145] The block generation events of the seller and the buyer are exactly the same, and the calculation formula of their reputation points is as follows.

[0146]

[0147] In the formula, is the consensus reputation score of seller j after the t-1th round of transactions; k j It represents the number of times seller j participated in the consensus process in the t-1th round of transactions.

[0148] At this point, we can get the reputation value of the seller when participating in the tth round of transactions:

[0149]

[0150] In the formula, R j,t represents the reputation value of seller j when participating in the tth round of transactions; Rj,t-1 Represents the reputation value at round t-1; when seller j participates in the transaction for the first time, its initial reputation is 50.

[0151] Whether it is a buyer or a seller, the reputation score can only be in the range of [0,100]. Therefore, after calculating the reputation value of the user participating in this round of transactions according to the above formula, it should be reassigned through formula (17) to achieve the purpose of constraining the range of user reputation values.

[0152]

[0153] In the formula, R i / j,t Indicates the reputation value of the buyer / seller when participating in the tth round of transactions. When the seller's reputation value is 0, the seller can only participate in the transaction as a buyer. When the buyer's reputation value is 0, the buyer is added to the blacklist and prohibited from participating in the tth round of transactions.

[0154] Embodiment 2: The specific implementation process of energy traders sign-encrypting the quotation information and sending it to the microgrid for auction. Figure 5 The corresponding steps are as follows:

[0155] (1) System establishment

[0156] Setup(1 l )→(GP,MSK): In identity-based cryptographic algorithms, keys are generated through PKG, while in our scheme, the key generation is controlled by the authority. First, the authority inputs the security parameter l into the system. Then, the system generates two additive cyclic groups G and G of order p according to the security parameter l. T , and defines four hash functions H1:{0,1} * →G, H3:G T →{0,1} n , Where n is the byte length of the information M. Regarding the cyclic group G, g is its generator, and G and G T Satisfies the bilinear mapping relationship e:G×G→G T Next, the authority randomly selects elements As the system master key, and calculate the system public key PK pub =λg. Finally, the master key MSK and the system global parameter GP are output.

[0157]

[0158] MSK is kept secret by an authoritative organization, while GP is announced to the entire network, and all nodes can obtain this information.

[0159] (2) Key Generation

[0160] KGen(GP,MSK,ID)→(PK ID ,SK ID ): Enter a user ID∈(0,1) * , the authority needs to review it. If the ID fails the review, the authority refuses to generate a key for the user. If the review passes, the authority outputs the public and private key pair corresponding to the ID.

[0161]

[0162] During the key generation process, each user can obtain multiple pairs of public and private keys. For consumers, the energy manager and smart home manager they deploy in their homes will obtain exclusive public and private key pairs. For prosumers, in addition to the energy manager and smart home manager, the DER they deploy will also obtain exclusive public and private key pairs. In order to better explain our solution, we define the public and private key pairs of the smart home manager and DER as (PK ori ,SK ori ), which is the key of the original signer; the key of the energy manager is defined as (PK proxy ,SK proxy ), which is the key of the proxy signer. The receiver's key uses the public-private key (PK MG ,SK MG )express.

[0163] (3) Proxy Key Generation

[0164] PKGen(GP,ω,SK ori ,SK proxy )→PSK op The proxy key generation process is performed by the user and is divided into three steps. The first step is performed by the original signer such as the smart home manager or DER. The original signer uploads the authorization letter to the alliance chain. ori ∈(0,1) * (It records the proxy validity period, proxy content authority, and the identity information of the original signer and the proxy signer). At this time, MG needs to update the authorization documents of each node in the storage list in real time. ori , in order to verify the validity of the information during the decryption process.

[0165] The second step is to generate proxy authorization D ω Whether the original signer's private key SK ori , or the private key SK of the proxy signer proxy, both belong to the same community user. Therefore, in this step, the community user can choose to have the original signer perform the operation, or the energy manager, the proxy signer, perform the operation. When the user has too many initial signers, it is recommended that the original signer generate D ω The generation process of proxy authorization is as follows:

[0166] s=H2(ω) (20)

[0167] D ω =sSK ori (twenty one)

[0168] In the third step, the proxy signer generates a proxy key.

[0169] PSK op =SK proxy +D ω (twenty two)

[0170] The information exchange between the proxy signer and the original signer is carried out on the home intranet, so there is no need to verify the information from the original signer.

[0171] (4) Proxy Signature

[0172] PSigc(GP,ω proxy ,M,PK MG ,PSK op ,SK proxy )→σ: When a user wants to participate in the auction, his proxy signer needs to collect the bid information M∈(0,1) from the initial signer. n The proxy signer is randomly selected And calculate the symmetric encryption key K

[0173] K=H3(e(PK pub ,PK MG ) x ) (twenty three)

[0174] Then, calculate the symmetric encrypted ciphertext C

[0175]

[0176] Next, the proxy signer uses the proxy key PSK op Proxy Signcryption

[0177]

[0178] Finally, the proxy signcryptor outputs the proxy signcryption information σ=(ω proxy ,μ,C,S), and send it to MG,ω proxyIndicates the original signatory authorization letter forwarded by the proxy signatory. proxy The purpose of putting it into the proxy signcryption information is to facilitate MG to quickly find the original signer corresponding to the proxy signcryption information.

[0179] (5) Decryption

[0180] UnSigc(GP,σ,SK MG ,PK ori ,PK proxy )→M / ⊥: When MG conducts energy auction, it needs the quotation information M from the initial signer, which exists in the received proxy signcryption information σ, so MG needs to perform the decryption process. If the authorization letter in the proxy signcryption information is inconsistent with the one sent by the original signcryptor, an error symbol ⊥ is returned. Otherwise, MG performs the following tasks to verify the validity of the ciphertext C in the proxy signcryption information σ.

[0181]

[0182] Only when μ=H4(C,V') holds, MG receives the ciphertext C and then calculates the symmetric encryption key

[0183] K'=H3(e(S,PK MG )e(PK proxy ,SK MG ) μ+1 e(PK ori ,SK MG ) s ) (27)

[0184] Finally, MG gets the quotation information of the initial signer If the content of M does not belong to the authorization letter ω ori Within the specified range, the algorithm also outputs the error symbol ⊥.

Claims

1. A hybrid blockchain-based microgrid community secure energy trading method, characterized by Follow these steps: (S01): The authority first builds a transaction alliance chain. After the transaction alliance chain is successfully built, the microgrid goes to the authority to register information and builds its own exclusive identity private chain with the authority. When the microgrid community to which the user belongs has built its own identity private chain, the community user obtains an exclusive public-private key pair after passing the identity review of the authority. The key pair is generated by an identity-based encryption algorithm. The transaction alliance chain contains all nodes in the network, while the identity private chain is built by each microgrid on the basis of the alliance chain and only contains user nodes and authority nodes within its own community. (S02): Before the transaction begins, community users need to conduct buyer or seller identity authentication on the identity private chain. Users who pass the authentication can only obtain one identity license to trade; when the identity authentication begins, the system will check whether the community user exists in the blacklist. Only users who are not on the blacklist can choose the trading identity; when the user chooses the seller identity, the system will check whether the user has distributed energy and whether his seller reputation score is qualified. Only when both are yes, the user can obtain the seller identity license, otherwise he needs to re-select the trading identity; when the user chooses the buyer identity, the system will check whether his buyer reputation score is qualified. If it is qualified, the buyer identity license will be issued to him. If it is not qualified, he will be added to the blacklist; when the user nodes are just joined, the system assigns them the same initial reputation score, and each user has a buyer reputation score and a seller reputation score respectively; (S03): After community users obtain their own transaction licenses, they can conduct energy transactions on the transaction alliance chain. The transaction method is a reputation-based continuous bilateral auction mechanism. When participating in the transaction auction, the smart energy home manager or distributed energy participating node entrusts the data processing authority to the energy manager belonging to the same user as itself through the proxy signcryption algorithm, and uses the identity-based proxy signcryption algorithm to generate a proxy key. Then the energy manager uses the proxy key to signcrypt each quotation information. (S04): After each round of transactions, the central node in the identity private chain collects the behavior information of the community users on the transaction alliance chain; After the information is collected, the central node will use a reputation evaluation algorithm based on user behavior to evaluate the user's new round of buyer or seller reputation score; (S05): The accounting node on the identity private chain packages each user's identity information, transaction behavior information and the new round of reputation into data blocks, and then verifies the blocks through the verification nodes. The blocks that pass the verification will be connected to the identity private chain; at the same time, the verification node stores the hash summary of the identity private chain on the transaction alliance chain; Similar to the private identity chain, the transaction information and the hash summary of the private identity chain are packaged into data blocks by pre-selected nodes in the transaction alliance chain. Similarly, only blocks that have passed verification can be selected as the latest blocks and added to the transaction alliance chain. (S06): When data is stored on the blockchain, all nodes jointly store the same data information, and the transaction records generated by each node are public; the generation of blocks in the blockchain follows transparent consensus rules, and consensus nodes process transaction information and generate new blocks according to the consensus algorithm adopted, thereby achieving transparency and traceability of transaction information.

2. According to claim 1, a hybrid blockchain-based microgrid community secure energy trading method is characterized by: The identity-based encryption algorithm described in step (S01) is as follows: (1) System settings: Setup(1 l )→(GP,MSK): The authority executes the algorithm, inputs the system security parameter l, and outputs the specific system public parameter GP and the master key MSK; (2) Key generation: KGen(GP,MSK,ID)→(PK ID ,SK ID ): The authority inputs the system public parameter GP, the master key MSK and the user ID∈(0,1) * , output the corresponding public and private key pair (PK ID ,SK ID ); (3) Encryption: Enc(GP,PK ID ,M)→C: The sender inputs the system public parameter GP and the receiver’s public key PK ID and plaintext information M, output ciphertext C; (4) Decryption: Dec(GP,C,SK ID )→M / ⊥: The ciphertext receiver inputs the system public parameter G, the received ciphertext C and his own private key SK ID ; If the received ciphertext is the recipient's public key PK ID The encrypted output is the plaintext information M, otherwise it is an error symbol ⊥.

3. According to claim 1, a hybrid blockchain-based microgrid community secure energy trading method is characterized by: The reputation-based continuous bilateral auction mechanism described in step (S03) is: The reputation-based market segmentation mechanism is integrated with the continuous bilateral auction mechanism. Based on the original sorting mechanism of the continuous bilateral auction mechanism, the sorting mechanism is based on price priority, reputation priority, and time priority. The system is divided into multiple level lists according to user reputation. Users with higher levels can match more targets during transaction matching. In the bidding list constructed by the buyer, the sorting rule is from high to low price. In the quotation list constructed by the seller, the sorting rule is from low to high price.

4. A microgrid community secure energy trading method based on hybrid blockchain according to claim 1, characterized in that The proxy signcryption algorithm described in step (S03) is as follows: (1) System settings: Setup(1 l )→(GP,MSK): The authority executes the algorithm, inputs the system security parameter l, and the algorithm outputs the specific system public parameter GP and the master key MSK; (2) Key generation: KGen(GP,MSK)→(PK i ,SK i ): The authority inputs the system public parameter GP and the master key MSK, and the algorithm outputs the public and private key pair (PKi, SKi) of each user, where the public and private key pair of the original data owner is (PK o ,SK o ), the public-private key pair (PK p ,SK p ), and the public-private key pair (PK r ,SK r ); (3) Delegated generation: WGen(GP,ω,SK o )→σ ω :The original data owner inputs the system public parameter GP and his own private key SK o and proxy permission ω, the algorithm outputs a proxy σ ω , the original data owner needs to convert (ω, σ ω ) is sent to the proxy signer; (4) Proxy Signature: PSigc(GP,ω,σ ω ,M,SK p ,PK r )→σ: The proxy signer inputs the system parameters GP, the proxy permission ω, and the power of attorney σ ω , the private key SK p , the receiver's public key PK r and message M, the algorithm outputs ciphertext σ; (5) Decryption: UnSigc(GP,ω,σ,SK r ,PK0,PK p )→M / ⊥: The message receiver inputs the system parameter GP, the proxy permission ω, the ciphertext σ, and the private key SK r , the original data owner's public key PK o and the proxy signer public key PK p , if the ciphertext σ is legal, the algorithm outputs the message M, otherwise it outputs the error symbol ⊥.

5. According to claim 1, a hybrid blockchain-based microgrid community secure energy trading method is characterized by: The identity-based proxy signcryption algorithm described in step (S03) is as follows: (1) System settings: Setup(1 l )→(GP,MSK): The authority executes the algorithm, inputs the system security parameter l, and the algorithm outputs the specific system public parameter GP and the master key MSK; (2) Key generation: KGen(GP,MSK,ID)→(PK ID ,SK ID ): The authority inputs the system public parameter GP, the master key MSK and the user ID∈(0,1) * , output the corresponding public and private key pair (PK ID ,SK ID ), where the public and private key pair of the original data owner is (PK o ,SK o ), the public-private key pair (PK p ,SK p ), and the public-private key pair (PK r ,SK r ); (3) Proxy key generation: PKGen(GP,ω,SK o ,SK p )→PSK op :Community users input system public parameters GP, proxy permission ω, the private keys of the original data owner and the proxy signer (SK o ,SK p ), the algorithm outputs the proxy key PSK op ; (4) Proxy Signature: PSigc(GP,ω,M,PK r ,PSK op ,SK p )→σ: The proxy signer inputs the system parameter GP, the proxy permission ω, the message M, and the receiver’s public key PK r , proxy key PSK op , the private key SK p , the algorithm outputs the ciphertext σ; (5) Decryption: UnSigc(GP,σ,SK r ,PK r ,PK o ,PK p )→M / ⊥: The message receiver inputs the system parameter GP, the ciphertext σ, and the public-private key pair (PK r ,SK r ), the original data owner's public key PK o and the proxy signer public key PK p , if the ciphertext σ is legal, the algorithm outputs the message M, otherwise it outputs the error symbol ⊥.

6. A method for secure energy trading in a microgrid community based on a hybrid blockchain according to claim 1, characterized in that The reputation evaluation algorithms based on user behavior described in step (S04) are: (1) Buyer Behavior Reputation Evaluation Algorithm: Buyers in the microgrid community are mainly consumers who need to buy energy. When the reputation of the prosumer seller is 0 or its distributed energy supply cannot meet its own needs, this type of prosumer is also a buyer. In the buyer behavior reputation evaluation algorithm, the events that affect the buyer's reputation evaluation are breach of contract events, demand response events, and block generation events, and the reputation scores generated by these three events are respectively called the buyer's contract reputation score Demand Response Reputation Score And consensus reputation score When this round of transactions is over, the buyer's latest reputation score R i Equal to the reputation score R' at the beginning of the transaction i Add the reputation scores generated by the above three types of events, as shown in formula (1): Where R is a response judgment value. When buyer i obtains the response qualification, R = 1, otherwise, R = 0; (2) Seller Behavior Reputation Evaluation Algorithm: The sellers in the microgrid community are only prosumers. In the seller behavior reputation evaluation algorithm, there are also three events that affect the seller's reputation, namely, breach of contract events, feedback events, and block generation events. The reputation points generated by these three events are called the seller's contract reputation points. Feedback reputation points And consensus reputation score When this round of transactions is over, the seller's latest reputation score R j Equal to the reputation score R' at the beginning of the transaction j Add the reputation scores generated by the above three types of events, as shown in formula (2):