PHEV energy transaction system based on alliance block chain and transaction method thereof
Technical Field
The invention belongs to the technical field of urban traffic, and particularly relates to a PHEV energy trading system and a PHEV energy trading method based on an alliance block chain.
Background
The energy internet is an innovative network serving energy production, transportation, storage and distribution management, and the energy internet comprehensively uses advanced electronic technology, information technology and intelligent management technology to interconnect distributed energy nodes so as to realize bidirectional flow, peer-to-peer exchange and balanced sharing of energy. As a mobile storage facility for distributed energy, plug-in hybrid electric vehicles (PHEVs) are an important component of the energy internet, which, by virtue of flexible mobility, enables energy trading of vehicles to the Grid (V2G) to cope with ever-increasing energy demands and extremely unbalanced energy distribution. Compared with the traditional electric vehicle, the PHEV is more energy-saving and environment-friendly, many countries are actively developed and deployed, and dense and huge charging infrastructures are continuously built to the ground, so that the PHEV has great influence on green traffic and smart city construction.
With the increasing number of PHEVs, their daily charging behavior will inevitably affect the energy internet, and reasonable charge and discharge management helps to improve the stability of the smart grid and maintain the supply and demand balance of the energy market. Thus, intelligent energy management for PHEVs is attracting widespread attention in the industry and academia.
At present, most of the invention focuses on a scheduling strategy and a pricing mechanism of PHEV charging and discharging so as to reduce charging time and loss cost; there are also a number of inventive efforts aimed at exploring deployment optimizations of PHEV charging stations; only a few researches concern the safety problem of the charging user, the existing safety scheme depends on an authoritative key mechanism, once a trusted third party fails or falls down, the privacy of the PHEV user is greatly threatened, the enthusiasm of the PHEV to participate in energy balance management is seriously attacked, and the PHEV energy transaction scheme which is going to the center, is distributed and trusted, can be traced and cannot be tampered and has the advantage of protecting the privacy safety of the user has great significance.
In summary, the prior art has the following problems:
(1) in the prior art, a single point of failure is easy to occur, once a centralized mechanism fails or suffers from a disaster, transaction authentication and payment activities are interfered or controlled, and thus the availability and reliability of the system are threatened;
(2) in the prior art, privacy and anonymity are lacked, a centralized mechanism has a potential danger of compromise, the privacy of a user is threatened, and a vehicle with surplus energy is lacked as the positivity of a supplier for participating in energy transaction;
(3) the efficiency is low, for large-quantity and geographically distributed PHEVs, the regulation and control efficiency of a remote power grid center in the prior art is low, particularly in a social hotspot area far away from a power grid, the flexibility is poor, a plurality of stagnant vehicles have a lot of energy, meanwhile, a plurality of vehicles are in urgent need of charging to complete a trip plan, and extra time cost and energy consumption are caused by the charging when the vehicles go around a long distance;
(4) in the prior art, when PHEV user authentication is carried out, the time delay is large, the time consumption is long, the efficiency is low, and the energy consumption is increased.
Disclosure of Invention
Aiming at the defects in the prior art, the PHEV energy transaction system and the PHEV energy transaction method based on the alliance block chain, which are provided by the invention, have the advantages of high system safety, high user privacy, low energy transaction efficiency, good flexibility, short time for user verification and high efficiency, ensure the availability and reliability of the system, avoid extra time cost and energy consumption, and solve the problems of low system safety, low user privacy, low energy transaction efficiency, poor flexibility, long time for user verification and low efficiency in the prior art.
In order to achieve the purpose of the invention, the invention adopts the technical scheme that:
a federation blockchain-based PHEV energy trading system, comprising:
the plug-in hybrid electric vehicle PHEV is used for participating in energy transactions and comprises a charging PHEV for consuming energy and a power supply PHEV for supplying energy;
the energy fog node is used for providing a communication support and energy transaction platform for the PHEV in the coverage area, managing energy transaction, performing consensus management of a distributed account book, and finishing transaction audit and data sharing;
the intelligent electric meter is positioned on the electrode of the PHEV and used for calculating and recording the energy transaction amount in real time and providing powerful data basis for transaction payment of both parties.
Further, the distributed energy fog nodes are mutually communicated and connected through a consensus network, and the effective blocks are backed up in a linear time sequence to form an energy block chain.
Further, the energy fog node comprises a transaction server, an account pool and a memory pool which are mutually connected in a communication manner;
the transaction server is used for controlling the energy transaction process of the PHEV, collecting the energy requirement of the charging PHEV and the energy supply of the power supply PHEV, and matching the charging and discharging PHEV; the intelligent power supply system is used for monitoring the feedback of the intelligent electric meter in real time and intelligently controlling a switch of a charging click according to a scheduling decision; the distributed transaction servers are mutually communicated and connected to jointly maintain an energy block chain;
the account pool comprises all system accounts of PHEV users, is used for managing the transaction of the energy coins and storing related transaction records, and also comprises a wallet corresponding to the system account, is used for managing the energy coins in the system account and storing the mapping relation between the wallet and the system account in the account pool, and the wallet generates random anonymity by using a hash algorithm to replace a real address;
and the memory pool is used for storing the related block data of the client wallet corresponding to the system account and all transaction records.
A transaction method based on a PHEV energy transaction system comprises the following steps:
s1: carrying out system initialization: in an energy block chain, carrying out system initialization, and issuing key materials of data encryption, digital signature and login authentication in the system by using an asymmetric encrypted elliptic curve encryption algorithm;
s2: performing PHEV classification: setting a PHEV of which the energy state cannot meet a travel plan as a charging PHEV and setting a PHEV which has surplus energy and is willing to participate in energy trading after meeting the travel plan as a power supply PHEV according to the energy state and the travel plan of the PHEV in the initialized system;
s3: and (3) carrying out energy transaction: performing energy transaction according to the charging PHEV, the power supply PHEV and the energy fog node;
s4: and (4) scribing and transferring energy coins: according to the charging PHEV and the power supply PHEV which participate in the energy transaction, the charging PHEV is enabled to pay corresponding energy coins to the power supply PHEV contributing surplus energy through the energy fog node, transaction records are generated and stored in a memory pool, the power supply PHEV is enabled to verify and sign the transaction records, and the transaction records are submitted to the energy fog node for verification and audit;
s5: consensus was performed using PDPOS algorithm: and (4) using a PDPOS algorithm to identify the blocks, and writing the blocks passing the identification into a block chain.
Further, in step S3, the method for energy trading includes the following steps:
s3-1: enabling the charging PHEV to submit energy requirements and available purchase prices to a transaction server of the energy fog node;
s3-2: enabling the transaction server to count the total energy demand and available purchase price of all the charging PHEVs and broadcast the energy demand and available purchase price to the local power supply PHEVs;
s3-3: causing the powered PHEV to send the marketable energy and the acceptable selling price to the trading server;
s3-4: according to the total energy demand and the available purchase price of the charging PHEV and the saleable energy and the acceptable sale price of the power supply PHEV, an energy iteration bidirectional auction EIDA algorithm is adopted to enable a trading server to execute energy bidding, negotiation and trading between the charging and power supply PHEV, the charging and power supply PHEV is matched, and a decision consisting of optimal energy distribution and optimal energy bidding is obtained;
s3-5: and feeding the decisions back to the charging and power supply PHEV respectively, and enabling the charging and power supply PHEV to finish energy transmission according to the decisions so as to realize energy transaction.
Further, in step S3-4, the EIDA algorithm includes the following steps:
s3-4-1: inputting the energy states and energy bids of the charging PHEV and the power supply PHEV into an energy fog node;
s3-4-2: initializing iteration parameters, and initializing optimal energy bidding according to initial energy bidding;
s3-4-3: calculating optimal energy distribution according to the current optimal energy bidding, and matching energy demands and supplies of the charging PHEV and the power supply PHEV;
s3-4-4: updating the optimal energy bidding of the charging PHEV and the power supply PHEV according to the current optimal energy distribution, and updating the iteration time t to be t + 1;
s3-4-5: judging whether the updated current optimal energy bidding convergence meets the requirement, if so, entering a step S3-4-7, otherwise, entering a step S3-4-6;
s3-4-6: judging whether the current iteration number is larger than the maximum iteration number, if so, entering a step S3-4-7, otherwise, entering a step S3-4-3;
s3-4-7: and combining the current optimal energy allocation and the current optimal energy bidding into a decision and outputting the decision.
Further, in step S3-4-5, the convergence criterion formula is:
in the formula, CB and CS are convergence judgment criteria;
bidding for charging the energy of the PHEV;
bidding on energy for powering the PHEV; epsilon is a convergence condition constant; and t is the iteration number.
Further, in step S5, the PDPOS algorithm, which takes the energy fog node with the energy currency share as the voter, includes the following steps:
a-1: voting according to voters, taking m energy fog nodes which are ranked at the front as shareholders to form a equity shareholder conference, and randomly sequencing the m shareholders;
a-2: according to the block generation period, the number m of shareholders is left, and a forger of the current consensus time slice is determined;
a-3: taking a forger of the current time slice as a creator of the new block, encrypting and digitally signing transaction records collected by shareholders according to the creator, structuring the encrypted transaction records, generating the block and broadcasting the block to the energy block chain consensus network;
a-4: the shareholder verifies the received new block, and generates and broadcasts a preparation message after the verification is qualified;
a-5: judging whether the specified time of the timer is reached, if so, ending consensus, otherwise, entering the step A-6;
a-6: until each shareholder receives more than f +1 preparation messages in an accumulated way, generating and broadcasting a confirmation message;
a-7: judging whether the specified time of the timer is reached, if so, ending consensus, otherwise, entering the step A-8;
a-8: until more than 2f +1 acknowledgment messages are cumulatively received by each shareholder, the consensus passes, and the block is written into the block chain.
The beneficial effect of this scheme does:
(1) the invention provides a V2V energy transaction architecture based on fog calculation and an alliance block chain, which records the local energy transaction of PHEV by a distributed book, ensures the safety and the non-falsification of transaction records, and avoids the availability and the reliability of a system threatened by faults;
(2) in the invention, the transaction information and the block data in the block chain are encrypted and stored, thereby avoiding exposing the privacy of the user; the client address is maintained by using an elliptic curve encryption algorithm, so that account information is prevented from being leaked, and the enthusiasm of a vehicle with surplus energy as a supplier for participating in energy transaction is improved;
(3) according to the invention, the energy fog nodes are deployed at social hotspots, so that communication coverage and transaction control are provided for an energy transaction market, the distance between a power grid and a PHEV is shortened, the efficiency and flexibility of local energy transaction are improved, and extra time cost and energy consumption are avoided;
(4) the invention adopts a new consensus algorithm, namely a PDPOS algorithm, improves the consensus efficiency and fault tolerance of the system, reduces the time delay of user verification and the energy consumption of ore excavation, supports quick transaction payment and saves the energy consumption.
Drawings
FIG. 1 is a block diagram of a PHEV energy trading system architecture based on federation blockchains;
FIG. 2 is a flow chart of a transaction method based on the PHEV energy transaction system;
FIG. 3 is a flow diagram of a method of conducting an energy transaction;
FIG. 4 is a flow chart of the EIDA algorithm;
FIG. 5 is a flow chart of the PDPOS algorithm.
Detailed Description
The following description of the embodiments of the present invention is provided to facilitate the understanding of the present invention by those skilled in the art, but it should be understood that the present invention is not limited to the scope of the embodiments, and it will be apparent to those skilled in the art that various changes may be made without departing from the spirit and scope of the invention as defined and defined in the appended claims, and all matters produced by the invention using the inventive concept are protected.
A system for PHEV energy trading based on federation blockchain, as shown in fig. 1, comprising:
the plug-in hybrid electric vehicle PHEV is used for participating in energy transactions and comprises a charging PHEV for consuming energy and a power supply PHEV for supplying energy;
the energy fog node is used for providing a communication support and energy transaction platform for the PHEV in the coverage area, managing energy transaction, performing consensus management of a distributed account book, and finishing transaction audit and data sharing;
the intelligent electric meter is positioned on the electrode of the PHEV and used for calculating and recording the energy transaction amount in real time and providing powerful data basis for transaction payment of both parties.
In this embodiment, the distributed energy fog nodes are communicatively connected to each other through a consensus network, and back up the active blocks in a linear time sequence to form an energy block chain.
In the present embodiment, the number of energy mist nodes is only an example, and is not limited to this number.
In this embodiment, the energy fog node includes a transaction server, an account pool, and a memory pool, which are communicatively connected to each other;
the transaction server is used for controlling the energy transaction process of the PHEV, collecting the energy requirement of the charging PHEV and the energy supply of the power supply PHEV, and matching the charging and discharging PHEV; the intelligent power supply system is used for monitoring the feedback of the intelligent electric meter in real time and intelligently controlling a switch of a charging click according to a scheduling decision; the distributed transaction servers are mutually communicated and connected to jointly maintain an energy block chain;
the account pool comprises all system accounts of PHEV users, is used for managing the transaction of the energy coins and storing related transaction records, and also comprises a wallet corresponding to the system account, is used for managing the energy coins in the system account and storing the mapping relation between the wallet and the system account in the account pool, and the wallet generates random anonymity by using a hash algorithm to replace a real address;
and the memory pool is used for storing the related block data of the client wallet corresponding to the system account and all transaction records.
A transaction method based on a PHEV energy transaction system is shown in FIG. 2, and comprises the following steps:
s1: carrying out system initialization: in an energy block chain, carrying out system initialization, and issuing key materials of data encryption, digital signature and login authentication in the system by using an asymmetric encrypted elliptic curve encryption algorithm;
s2: performing PHEV classification: setting a PHEV of which the energy state cannot meet a travel plan as a charging PHEV and setting a PHEV which has surplus energy and is willing to participate in energy trading after meeting the travel plan as a power supply PHEV according to the energy state and the travel plan of the PHEV in the initialized system;
s3: and (3) carrying out energy transaction: according to the charging PHEV, the power supply PHEV and the energy fog node, as shown in fig. 3, the method for energy trading comprises the following steps:
s3-1: enabling the charging PHEV to submit energy requirements and available purchase prices to a transaction server of the energy fog node;
s3-2: enabling the transaction server to count the total energy demand and available purchase price of all the charging PHEVs and broadcast the energy demand and available purchase price to the local power supply PHEVs;
s3-3: causing the powered PHEV to send the marketable energy and the acceptable selling price to the trading server;
s3-4: according to the total energy demand and the available purchase price of the charging PHEV, the marketable energy and the acceptable sale price of the power supply PHEV, an energy iteration bidirectional auction EIDA algorithm is adopted to enable a trading server to execute energy bidding, negotiation and trading between the charging and power supply PHEV, the charging and power supply PHEV is matched, and a decision consisting of optimal energy distribution and optimal energy bidding is obtained, wherein the EIDA algorithm comprises the following steps as shown in FIG. 4:
s3-4-1: inputting the energy states and energy bids of the charging PHEV and the power supply PHEV into an energy fog node;
s3-4-2: initializing iteration parameters, and initializing optimal energy bidding according to initial energy bidding;
s3-4-3: calculating optimal energy distribution according to the current optimal energy bidding, and matching energy demands and supplies of the charging PHEV and the power supply PHEV;
s3-4-4: updating the optimal energy bidding of the charging PHEV and the power supply PHEV according to the current optimal energy distribution, and updating the iteration times;
s3-4-5: judging whether the updated current optimal energy bidding convergence meets the requirement, if so, entering the step S3-4-7, otherwise, entering the step S3-4-6, wherein the convergence judgment criterion formula is as follows:
in the formula, CB and CS are convergence judgment criteria;
bidding for charging the energy of the PHEV;
bidding on energy for powering the PHEV; epsilon is a convergence condition constant; t is the number of iterations;
s3-4-6: judging whether the current iteration number is larger than the maximum iteration number, if so, entering a step S3-4-7, otherwise, entering a step S3-4-3;
s3-4-7: combining the current optimal energy allocation and the current optimal energy bidding into a decision and outputting the decision;
s3-5: and feeding the decisions back to the charging and power supply PHEV respectively, and enabling the charging and power supply PHEV to finish energy transmission according to the decisions so as to realize energy transaction.
S4: and (4) scribing and transferring energy coins: according to the charging PHEV and the power supply PHEV which participate in the energy transaction, the charging PHEV is enabled to pay corresponding energy coins to the power supply PHEV contributing surplus energy through the energy fog node, transaction records are generated and stored in a memory pool, the power supply PHEV is enabled to verify and sign the transaction records, and the transaction records are submitted to the energy fog node for verification and audit;
s5: consensus was performed using PDPOS algorithm: using a PDPOS algorithm to identify blocks, writing the blocks passing the identification into a block chain, and using an energy fog node with an energy coin share as a voter, as shown in fig. 5, the PDPOS algorithm includes the following steps:
a-1: voting according to voters, taking m energy fog nodes which are ranked at the front as shareholders to form a equity shareholder conference, and randomly sequencing the m shareholders;
a-2: according to the block generation period, the number m of shareholders is left, and a forger of the current consensus time slice is determined;
a-3: taking a forger of the current time slice as a creator of the new block, encrypting and digitally signing transaction records collected by shareholders according to the creator, structuring the encrypted transaction records, generating the block and broadcasting the block to the energy block chain consensus network;
a-4: the shareholder verifies the received new block, and generates and broadcasts a preparation message after the verification is qualified;
a-5: judging whether the specified time of the timer is reached, if so, ending consensus, otherwise, entering the step A-6;
a-6: until each shareholder receives more than f +1 preparation messages in an accumulated way, generating and broadcasting a confirmation message;
a-7: judging whether the specified time of the timer is reached, if so, ending consensus, otherwise, entering the step A-8;
a-8: until more than 2f +1 acknowledgment messages are cumulatively received by each shareholder, the consensus passes, and the block is written into the block chain.
In this embodiment, in order to incentivize more powered PHEVs to participate in local energy balance management, the powered PHEV will receive additional energy dollar rewards in addition to poor trading profits.
The PHEV energy transaction system and the transaction method based on the alliance block chain have the advantages that the system safety is high, the user privacy is high, the energy transaction efficiency is low, the flexibility is good, the time for user verification is short, the efficiency is high, the availability and the reliability of the system are guaranteed, extra time cost and energy consumption are avoided, and the problems that in the prior art, the system safety is low, the user privacy is low, the energy transaction efficiency is low, the flexibility is poor, the user verification delay is long, the time is long, and the efficiency is low are solved.