[go: up one dir, main page]

CN114841813A - P2P energy trading method based on intelligent contract - Google Patents

P2P energy trading method based on intelligent contract Download PDF

Info

Publication number
CN114841813A
CN114841813A CN202210548195.8A CN202210548195A CN114841813A CN 114841813 A CN114841813 A CN 114841813A CN 202210548195 A CN202210548195 A CN 202210548195A CN 114841813 A CN114841813 A CN 114841813A
Authority
CN
China
Prior art keywords
energy
transaction
consumers
price
consumer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210548195.8A
Other languages
Chinese (zh)
Inventor
李刚
关雪
杨会峰
鲁斌
赵琳颖
辛锐
陈连栋
程凯
赵丛林
卢宁
刘欣
申培培
辛晓鹏
刘咸通
郭少勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Posts and Telecommunications
North China Electric Power University
Information and Telecommunication Branch of State Grid Hebei Electric Power Co Ltd
Original Assignee
Beijing University of Posts and Telecommunications
North China Electric Power University
Information and Telecommunication Branch of State Grid Hebei Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing University of Posts and Telecommunications, North China Electric Power University, Information and Telecommunication Branch of State Grid Hebei Electric Power Co Ltd filed Critical Beijing University of Posts and Telecommunications
Priority to CN202210548195.8A priority Critical patent/CN114841813A/en
Publication of CN114841813A publication Critical patent/CN114841813A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/02Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP]
    • G06Q20/023Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP] the neutral party being a clearing house
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0605Pooling transaction partners, e.g. group buying or group selling
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0611Request for offers or quotes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0613Electronic shopping [e-shopping] using intermediate agents
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S50/00Market activities related to the operation of systems integrating technologies related to power network operation or related to communication or information technologies
    • Y04S50/14Marketing, i.e. market research and analysis, surveying, promotions, advertising, buyer profiling, customer management or rewards

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Security & Cryptography (AREA)
  • Public Health (AREA)
  • Water Supply & Treatment (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Resources & Organizations (AREA)
  • Primary Health Care (AREA)
  • Tourism & Hospitality (AREA)
  • Technology Law (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明公开了一种基于智能合约的P2P能源交易方法,首先,构建基于智能合约的产消者与消费者之间P2P能源交易模型;然后,采用PC‑DA进行产消者与消费者之间的P2P能源交易,生成交易订单;并在智能合约下对生成的交易订单进行自动清算;交易订单匹配完成后,计算所有参与本轮交易的产消者与消费者的反馈值,进行用户反馈分析;最后,将生成的交易订单打包成区块,随后区块在网络中进行传播,等待共识节点达成共识后,将该区块进行上链处理。本发明将区块链与能源P2P交易结合,发挥区块链的优点,促进清洁能源的消纳,实现智能合约下自动化执行产消者与消费者之间的P2P能源交易,有助于提高能源交易效率、降低成本。

Figure 202210548195

The invention discloses a P2P energy trading method based on smart contracts. First, a P2P energy trading model between prosumers and consumers based on smart contracts is constructed; then, PC-DA is used to conduct P2P energy trading between prosumers and consumers. The P2P energy transaction will generate transaction orders; and the generated transaction orders will be automatically cleared under the smart contract; after the transaction order matching is completed, the feedback values of all prosumers and consumers participating in this round of transactions will be calculated, and user feedback will be analyzed. ; Finally, the generated transaction orders are packaged into blocks, and then the blocks are propagated in the network. After the consensus nodes reach a consensus, the block is processed on the chain. The present invention combines the blockchain with energy P2P transactions, gives play to the advantages of the blockchain, promotes the consumption of clean energy, realizes the automatic execution of P2P energy transactions between producers and consumers under smart contracts, and helps to improve energy efficiency. Transaction efficiency and cost reduction.

Figure 202210548195

Description

P2P energy trading method based on intelligent contract
Technical Field
The invention relates to the technical field of energy trading, in particular to a P2P energy trading method based on an intelligent contract.
Background
With the increasing prosperity of economy and the continuous improvement of living standard, the energy consumption is continuously increased, the shortage risk exists, and the serious imbalance phenomenon exists between the energy consumption and the acquisition. The emergence and the efficient utilization of renewable energy sources (such as solar energy, wind energy, hydroenergy and the like) relieve certain energy consumption and shortage, the renewable energy sources play an important role in the increasing energy demand in the world, but the intermittence and the transmission loss caused by the continuous increase of the use of the solar energy, the wind energy and the like bring instability to the energy trading market, the existence of a microgrid is dedicated to guarantee the supply balance of the energy sources, and the emergence of a producer and a consumer is beneficial to the consumption of the renewable energy sources such as the solar energy, the wind energy and the like. However, the existing energy trading methods also have the following disadvantages:
1) the traditional energy trading market adopts a centralized management mode, a third-party intermediary exists, namely, a centralized problem exists, the credibility of the third-party intermediary is guaranteed under the condition, once the third-party intermediary has malicious operation, the relevant information of energy trading cannot be restored, and irreversible damage can be brought to the energy trading market;
2) in the traditional energy trading market, the traditional energy is mainly used, so that the traditional energy is greatly reduced, and certain environmental pollution is caused, and the intermittence and transmission loss caused by the renewable energy bring instability to the energy trading market, so that a method for consuming the renewable energy on site is urgently needed to be found, and meanwhile, the related benefits of participating the main body are also guaranteed;
3) the settlement part after the energy transaction is finished generally needs the participation of professional persons such as banks and the like, the task amount is complicated, a large amount of manpower and material resources are wasted, the possibility of errors is high, the working efficiency is low, and how to perform settlement after the transaction more quickly, accurately and efficiently is also one of the problems faced at present;
4) after the energy trading is finished, the satisfaction degree of the participating subject is not deeply researched, the satisfaction degree of the participating subject to the current round of trading is not known, the development of the energy trading market in the future is not facilitated, and how to measure the satisfaction degree of the participating subject to the energy trading is also one of the problems which should be focused at present.
Disclosure of Invention
The invention aims to provide a P2P energy trading method based on an intelligent contract, which combines a block chain with energy P2P trading, exerts the advantages of the block chain, makes up the problems of the existing energy trading market, promotes the consumption of clean energy, realizes the automatic execution of the P2P energy trading between a producer and a consumer under the intelligent contract, and is beneficial to improving the energy trading efficiency and reducing the cost.
In order to achieve the purpose, the invention provides the following scheme:
a P2P energy trading method based on intelligent contracts comprises the following steps:
s1, aiming at internal transaction of the microgrid, calling an intelligent contract function to register the microgrid with the serial number id, registering users, namely a producer and a consumer under the microgrid, initializing the microgrid and the users at the same time, and constructing a P2P energy transaction model between the producer and the consumer based on an intelligent contract;
s2, performing P2P energy trading between the prosumers and the consumers by adopting a P2P energy trading model between the prosumers and the consumers by adopting a PC-DA (personal computer-data acquisition), and generating a trading order;
s3, automatically clearing the generated trade order under the intelligent contract;
s4, after the matching of the trading orders is completed, calculating feedback values of all the producers and consumers participating in the current round of trading, and performing user feedback analysis;
and S5, after the set time is reached, the node responsible for packaging packs the generated transaction orders into blocks, then the blocks are transmitted in the network, and after the consensus node reaches consensus, the blocks are linked up, so that the round of transaction is completed.
Further, in step S1, for the internal transaction of the microgrid, calling an intelligent contract function to register the microgrid with the serial number id, and registering users, i.e., both a producer and a consumer, under the microgrid, initializing the microgrid and the users at the same time, and constructing a P2P energy transaction model between the producer and the consumer based on the intelligent contract, specifically including:
the selling price and the purchasing price of the micro-grid energy with the serial number id are respectively SP id 、BP id (ii) a And setting a microgrid id of m id Individual person of birth and consumption, n id The set of consumers and the set of the producers and the consumers
Figure BDA0003650036630000021
Figure BDA0003650036630000022
Collection for consumer
Figure BDA0003650036630000023
Respectively indicating the person of birth and consumption
Figure BDA0003650036630000024
The selling price and the amount of the energy sold, wherein i is 1, 2.
Figure BDA0003650036630000025
Respectively represent consumers
Figure BDA0003650036630000031
The purchase price and the amount of energy purchased, where j is 1, 2.
Further, in step S2, the P2P energy trading model between the producer and the consumer adopts PC-DA to perform P2P energy trading between the producer and the consumer, and generate a trade order, specifically including:
the patients of both birth and consumption
Figure BDA0003650036630000032
Invoking intelligent contract function publishing
Figure BDA0003650036630000033
And
Figure BDA0003650036630000034
then automatically moving contactThe order of the hair is regulated according to
Figure BDA0003650036630000035
Adding the selling arrays in a sequence from low to high;
at the same time, the consumer
Figure BDA0003650036630000036
Invoking intelligent contract function publishing
Figure BDA0003650036630000037
And
Figure BDA0003650036630000038
and judge the consumers
Figure BDA0003650036630000039
Whether there are sufficient token purchases of
Figure BDA00036500366300000310
If there are enough tokens, automatically triggers a sort rule according to
Figure BDA00036500366300000311
Add purchase array in high to low order, otherwise refuse consumer
Figure BDA00036500366300000312
Participating in the energy transaction of the current round;
and generating a trade order when the conditions are met according to the one-to-one matching of the selling array and the purchasing array.
Further, the generating a trade order according to one-to-one matching between the selling array and the purchasing array and meeting the condition specifically includes:
judging whether the selling price of the first element of the selling array, the quantity of the selling energy, the purchase price of the first element of the purchasing array and the quantity of the purchasing energy meet the requirements or not, namely whether the selling price, the quantity of the selling energy, the purchase price of the first element of the purchasing array and the purchasing energy quantity meet the requirements simultaneously or not
Figure BDA00036500366300000313
Figure BDA00036500366300000314
And
Figure BDA00036500366300000315
and forming a matched trading order by the two trading parties meeting the requirement, then sequentially iterating until the conditions are not met, and trading the remaining unmatched users with the microgrid operator.
Further, step S3, automatically clearing the generated trade order under the intelligent contract, specifically includes:
s301, taking an intelligent contract standard ERC20 as a basic agreement, converting the token and the energy price by adopting an exchange rate, wherein the average price and the mixed price refer to real world currency, the token needs to be converted before settlement, and the exchange mechanism is shown as a formula (1):
token=token_rate*price (1)
wherein token represents token, token _ rate represents exchange rate, and price represents currency;
s302, setting the average price clearing mechanism time to be 1 hour, and adopting average price clearing when the P2P energy transaction is finished in the mode; when the producer bid and the consumer bid are the same, then the average price equals the producer bid and the consumer bid; when the producer and consumer bid is larger than the consumer bid, a matching order cannot be formed; when the producer and the consumer bid less than the consumer bid, clearing according to the average price of the producer and the consumer; wherein the average price
Figure BDA0003650036630000041
It is the case of both birth and consumption
Figure BDA0003650036630000042
Is/are as follows
Figure BDA0003650036630000043
And consumers
Figure BDA0003650036630000044
Is/are as follows
Figure BDA0003650036630000045
The average value of the two is shown in formula (2):
Figure BDA0003650036630000046
s303, setting the mixed price clearing mechanism time to be 1 hour, adopting the mixed price clearing to clear the P2P energy source transaction in the mode, and leading the producer and the consumer to be on or off
Figure BDA0003650036630000047
And consumers
Figure BDA0003650036630000048
Mixed price of transaction
Figure BDA0003650036630000049
As shown in formula (3):
Figure BDA00036500366300000410
further, in step S4, after the matching of the trade order is completed, feedback values of all the producers and consumers participating in the current round of trade are calculated, and the user feedback analysis is performed, which specifically includes:
s401, calculating the yield of the producers and the consumers: the patients of both birth and consumption
Figure BDA00036500366300000411
As a benefit of the producer
Figure BDA00036500366300000412
As shown in formula (4):
Figure BDA00036500366300000413
in the formula (I), the compound is shown in the specification,
Figure BDA00036500366300000414
respectively representing producers and consumers under the id of the microgrid
Figure BDA00036500366300000415
And consumers
Figure BDA00036500366300000416
Energy quantity of trading, microgrid operator trading; p is a radical of ij The person who is born and goes bad
Figure BDA00036500366300000417
And consumers
Figure BDA00036500366300000418
The bargain price of (c); describing the relationship between the output energy and the equipment expenditure by adopting an ln function;
s402, calculating consumer income: consumers
Figure BDA00036500366300000419
Gain of (2)
Figure BDA00036500366300000420
As shown in formula (5):
Figure BDA00036500366300000421
in the formula (I), the compound is shown in the specification,
Figure BDA00036500366300000422
representing consumers
Figure BDA00036500366300000423
Benefits from purchasing energy;
Figure BDA00036500366300000424
respectively represent consumers
Figure BDA00036500366300000425
The benefit factor of (2);
Figure BDA00036500366300000426
respectively representing consumers under the microgrid id
Figure BDA00036500366300000427
The syndrome of labor and consumption
Figure BDA00036500366300000428
Energy quantity of trading, microgrid operator trading; describing the relation between the energy purchase and the benefit of the consumer by adopting a quadratic function and using the quadratic function
Figure BDA00036500366300000429
Representing consumers
Figure BDA00036500366300000430
The benefit factor of (1);
s403, calculating a feedback value of the indigestion person: the patients of both birth and consumption
Figure BDA00036500366300000431
Is fed back to
Figure BDA00036500366300000432
As shown in formula (6):
Figure BDA0003650036630000051
in the formula (I), the compound is shown in the specification,
Figure BDA0003650036630000052
respectively indicating the person of birth and consumption
Figure BDA0003650036630000053
The price feedback value, the energy transaction quantity feedback value and the income feedback value;
Figure BDA0003650036630000054
representing a preference coefficient;
s404, calculating a consumer feedback value: consumers
Figure BDA0003650036630000055
Is fed back to
Figure BDA0003650036630000056
As shown in formula (7):
Figure BDA0003650036630000057
in the formula (I), the compound is shown in the specification,
Figure BDA0003650036630000058
respectively represent consumers
Figure BDA0003650036630000059
The price feedback value, the energy transaction quantity feedback value and the income feedback value;
Figure BDA00036500366300000510
the preference coefficient is represented.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects: the intelligent contract based on the intelligent contract P2P energy transaction method provided by the invention takes the intelligent contract of the block chain as an important component part of the P2P energy transaction, plays an important role in the transaction between a producer and a consumer, and brings a series of advantages to the P2P energy transaction:
1) the traditional trading mode of the power grid needs a completely trusted third party intermediary as a trading center, and the invention adopts a block chain and intelligent contract mode to ensure that nodes added into the block chain can unconditionally trust each other, thereby achieving the aim of decentralization;
2) the P2P energy transaction between the producer and consumer can not only locally consume renewable energy and reduce the loss in the transmission process, but also has larger profit for the producer and consumer in the P2P energy transaction compared with the traditional energy transaction mode;
3) the P2P energy trading model is deployed on the intelligent contract, users with demand trading can register and join in energy trading and issue own demands, and the users only need to wait for the intelligent contract to match the contract without human intervention, so that a large amount of manpower, material resources and financial resources are saved;
4) the automatic clearing function saves a great deal of time, and two transaction parties do not need to worry about the condition that energy is not used or the condition that energy cannot be used after payment;
5) user feedback values are set in the intelligent contract to measure the satisfaction degree of the user to the transaction, so that a microgrid operator can well master the energy transaction condition of the user;
6) the trade orders are finally stored on the blockchain, the property of the blockchain enables the trade information not to be falsified, and all users can conveniently and timely trace back the trade orders.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a flow chart of a P2P energy trading method based on intelligent contracts according to an embodiment of the invention;
fig. 2 is a diagram of a P2P energy trading framework based on intelligent contracts according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The block chain is used as a novel distributed account book, has the characteristics of openness, transparency, decentralization, no tampering, traceability and the like, and is beneficial to improving the energy transaction efficiency, reducing the cost and the like. At present, a point-to-point energy trading mode, called P2P (peer-to-peer) energy trading for short, is adopted in an energy trading market, and a block chain and energy P2P trading are combined, so that the advantages of the block chain can be exerted, the problems in the energy trading market are solved, the consumption of clean energy is promoted, and the P2P energy trading between a producer and a consumer is automatically executed under an intelligent contract. Therefore, the object of the present invention is to develop research on energy trading between a producer and a consumer in the context of a microgrid and to attempt to propose a P2P energy trading method based on a smart contract with the aid of a blockchain smart contract.
In a blockchain, an intelligent contract is a set of code that is deployed on the blockchain and is capable of running according to predefined logic rules. At present, the application platforms of intelligent contracts mainly include etherhouses (Ethereum) and hyper ledgers (hyper Legendre Fabric). The Ethenhouse is used as a platform for using the intelligent contract at the earliest time, the development is mature, the intelligent contract is compiled by adopting the solidity language, and the Ethenhouse virtual machine EVM is used as the operating environment of the intelligent contract and can isolate the outside, so that the intelligent contract can be operated well. The intelligent contract in the super ledger is also called as 'chain code', the chain code is mainly compiled by adopting languages such as go, java and node.
The micro-grid is used as a regional power grid and provides a supporting condition for the consumption of renewable energy sources. The invention takes the micro-grid as the research background to develop the P2P energy trade. The P2P energy transaction of the microgrid is mainly divided into microgrid internal energy transaction and microgrid external energy transaction. The participating main bodies of the internal energy trading of the micro-grid comprise micro-grid operators, producers and consumers. Wherein the producers and consumers are simply referred to as users. The participation subject of the external energy trading of the micro-grid is the micro-grid operator of each micro-grid. The internal microgrid transaction is mainly considered, and the transaction is not particularly described below and is the internal microgrid transaction.
In order to make the aforementioned objects, features and advantages of the present invention more comprehensible, the present invention is described in detail with reference to the accompanying drawings and the detailed description thereof.
As shown in fig. 1, the P2P energy trading method based on intelligent contracts provided by the invention comprises the following steps:
s1, aiming at internal transaction of the microgrid, calling an intelligent contract function to register the microgrid with the serial number id, registering users, namely a producer and a consumer under the microgrid, initializing the microgrid and the users at the same time, and constructing a P2P energy transaction model between the producer and the consumer based on an intelligent contract; the method specifically comprises the following steps:
the selling price and the purchasing price of the micro-grid energy with the serial number id are respectively SP id 、BP id (ii) a And setting a microgrid id of m id Individual person of birth and consumption, n id The set of consumers and the set of the producers and the consumers
Figure BDA0003650036630000071
Figure BDA0003650036630000081
Collection for consumer
Figure BDA0003650036630000082
Respectively indicating the person of birth and consumption
Figure BDA0003650036630000083
The selling price and the amount of the energy sold, wherein i is 1, 2.
Figure BDA0003650036630000084
Respectively represent consumers
Figure BDA0003650036630000085
The purchase price and the amount of energy purchased, where j is 1, 2.
S2, performing P2P energy trading between the prosumers and the consumers by adopting a P2P energy trading model between the prosumers and the consumers by adopting a PC-DA (personal computer-data acquisition), and generating a trading order;
s3, automatically clearing the generated trade order under the intelligent contract;
s4, after the matching of the trading orders is completed, calculating feedback values of all the producers and consumers participating in the current round of trading, and performing user feedback analysis;
and S5, after the set time is reached, the node responsible for packaging packs the generated transaction orders into blocks, then the blocks are transmitted in the network, and after the consensus node reaches consensus, the blocks are linked up, so that the round of transaction is completed.
A price-constrained two-way auction (PC-DA for short) adds price limit in the two-way auction, and the user can not participate in energy transaction when the user exceeds the range of bid. And P2P energy trading between the producer and consumer and the consumer is carried out by adopting a PC-DA inside the microgrid, and the PC-DA considers the bidding of two trading parties and also considers the energy quantity. The patients with either birth or death are classified into 3 categories: the 1 st production energy is totally used by oneself, the 2 nd production energy is sold with surplus energy besides self-use, and the 3 rd production energy is sold totally. Assuming that all the producers and consumers in the micro-grid carry out P2P energy trading in the consumer type, the PC-DA is the consumer and cannot generate a matching order. Assuming that some or all of the producers and consumers inside the microgrid are performing P2P energy transactions as producer types, the PC-DA has both producers and consumers and may generate matching orders. Therefore, the invention assumes that the producer inside the microgrid is a category 2 producer, i.e. the producer sells the surplus energy while using the producer for the energy trade. The producers and consumers are divided into three categories, the first category of energy is totally self-used, the second category of energy is sold as surplus energy except self-use, and the third category of energy is sold as whole. And (4) assuming that the producer and the consumer inside the microgrid are second-class users, and selling redundant energy as the producer while using the consumers to participate in energy trading.
In step S2, the P2P energy trading model between the producer and the consumer adopts PC-DA to trade the P2P energy between the producer and the consumer, and generates a trading order, which specifically includes:
the patients of both birth and consumption
Figure BDA0003650036630000086
Invoking intelligent contract function publishing
Figure BDA0003650036630000087
And
Figure BDA0003650036630000088
then automatically triggers a sort rule according to
Figure BDA0003650036630000091
Adding the selling arrays in a sequence from low to high;
at the same time, the consumer invokes the intelligent contract function
Figure BDA0003650036630000092
Issue a publication
Figure BDA0003650036630000093
And
Figure BDA0003650036630000094
and judge the consumers
Figure BDA0003650036630000095
Whether there are sufficient token purchases of
Figure BDA0003650036630000096
If there are enough tokens, automatically triggers a sort rule according to
Figure BDA0003650036630000097
Add purchase array in high to low order, otherwise refuse consumer
Figure BDA0003650036630000098
Participating in the energy transaction of the current round;
generating a trade order according to one-to-one matching of the selling array and the purchasing array and meeting the conditions, and specifically comprising the following steps:
determining the selling price of the first element of the selling array, the quantity of the selling energy and the purchasing price of the first element of the purchasing arrayThe grid and the amount of energy purchased meet the requirements, i.e. both
Figure BDA0003650036630000099
Figure BDA00036500366300000910
And
Figure BDA00036500366300000911
and forming a matched trading order by the two trading parties meeting the requirement, then sequentially iterating until the conditions are not met, and trading the remaining unmatched users with the microgrid operator.
The choice of clearing mechanism determines the transaction price of both parties to the transaction. The microgrid operator can decide the clearing mechanism of the microgrid, and in order to research the influence of different clearing mechanisms on the feedback value of the user, two clearing mechanisms are tried to be adopted for clearing, namely an average price clearing mechanism and a mixed price clearing mechanism.
In the present invention, the step S3, automatically clearing the generated trade order under the intelligent contract, specifically includes:
s301, taking an intelligent contract standard ERC20 as a basic agreement, converting the token and the energy price by adopting an exchange rate, wherein the average price and the mixed price refer to real world currency, the token needs to be converted before settlement, and the exchange mechanism is shown as a formula (1):
token=token_rate*price (1)
wherein token represents token, token _ rate represents exchange rate, and price represents currency;
s302, setting the average price clearing mechanism time to be 1 hour, and adopting average price clearing when the P2P energy transaction is finished in the mode; when the producer bid and the consumer bid are the same, then the average price equals the producer bid and the consumer bid; when the producer and consumer bid is larger than the consumer bid, a matching order cannot be formed; when the producer and the consumer bid less than the consumer bid, clearing according to the average price of the producer and the consumer; wherein the average price
Figure BDA00036500366300000912
The patients with the symptoms of both birth and consumption
Figure BDA00036500366300000913
Is/are as follows
Figure BDA00036500366300000914
And consumers
Figure BDA00036500366300000915
Is/are as follows
Figure BDA00036500366300000916
The average value of the two is shown in formula (2):
Figure BDA0003650036630000101
s303, the mixed price (Mp) refers to a mixed price obtained by comprehensively considering the bids of both producer and consumer, consumer and microgrid, and the price indicates that the mixed price is related to not only the bids of producer and consumer, but also the selling price and purchasing price of microgrid operator. Setting the mixed price clearing mechanism time to be 1 hour, adopting the mixed price clearing to clear the P2P energy source transaction in the mode, and leading the producers and the consumers to be on production and consumption
Figure BDA0003650036630000102
And consumers
Figure BDA0003650036630000103
Mixed price of transaction
Figure BDA0003650036630000104
As shown in formula (3):
Figure BDA0003650036630000105
in step S4, after the matching of the trade order is completed, feedback values of all the producers and consumers participating in the current round of trade are calculated, and the user feedback analysis is performed, which specifically includes:
s401, calculating the yield of the producers and the consumers: the producer and the consumer are used as special users of the micro-grid, can sell redundant energy to other users while producing and using; thus, the revenue of the producer and the consumer as the producer includes the income of selling energy to users inside the microgrid, operators of the microgrid and the expenditure of investing related equipment; the income of the producer and the consumer is consistent with that of the ordinary consumer, and the income of the consumer is specifically referred; either of the two patients M iid As a benefit of the producer
Figure BDA0003650036630000106
As shown in formula (4):
Figure BDA0003650036630000107
in the formula (I), the compound is shown in the specification,
Figure BDA0003650036630000108
respectively representing producers and consumers under the id of the microgrid
Figure BDA0003650036630000109
And consumers
Figure BDA00036500366300001010
Energy quantity of trading, microgrid operator trading; p is a radical of ij The person who is born and goes bad
Figure BDA00036500366300001011
And consumers
Figure BDA00036500366300001012
The bargain price of (c); the expenditure of the producer and the consumer on the relevant equipment cannot be measured by an accurate value due to the particularity of the producer and the consumer, and therefore, the relation between the produced energy and the equipment expenditure is described by an ln function;
s402, calculating consumer income: the consumer acts as a microgridSimilar to ordinary users, the energy can only be purchased but not produced; the consumer's revenue includes the benefits of the consumer's purchase of energy and the expenditure of energy from the producer or consumer or the microgrid operator. Consumers
Figure BDA00036500366300001013
Gain of (2)
Figure BDA00036500366300001014
As shown in formula (5):
Figure BDA0003650036630000111
in the formula (I), the compound is shown in the specification,
Figure BDA0003650036630000112
representing consumers
Figure BDA0003650036630000113
Benefits from purchasing energy;
Figure BDA0003650036630000114
respectively represent consumers
Figure BDA0003650036630000115
The benefit factor of (2);
Figure BDA0003650036630000116
respectively representing consumers under the microgrid id
Figure BDA0003650036630000117
The syndrome of labor and consumption
Figure BDA0003650036630000118
Energy quantity of trading, microgrid operator trading; because each consumer has different preference to energy and may have different benefits for purchasing the same energy, for the convenience of calculation, a quadratic function is used to describe the relationship between the energy purchased by the consumer and the obtained benefits, and the quadratic function is used to describe the relationship between the energy purchased by the consumer and the obtained benefits
Figure BDA0003650036630000119
Representing consumers
Figure BDA00036500366300001110
The benefit factor of (1);
at S403, the user feedback refers to the satisfaction degree of the user participating in the P2P energy transaction for the transaction after the transaction is finished. User feedback includes two categories, namely, both prenatal and consumer feedback. The feedback of the producers and the consumers is divided into three parts, namely price feedback, energy transaction quantity feedback and income feedback. Calculating a feedback value of the birth and consumption person: the patients of both birth and consumption
Figure BDA00036500366300001111
Is fed back to
Figure BDA00036500366300001112
As shown in formula (6):
Figure BDA00036500366300001113
in the formula (I), the compound is shown in the specification,
Figure BDA00036500366300001114
respectively indicating the person of birth and consumption
Figure BDA00036500366300001115
The price feedback value, the energy transaction quantity feedback value and the income feedback value;
Figure BDA00036500366300001116
the preference coefficient is represented.
S404, calculating a consumer feedback value: consumers
Figure BDA00036500366300001117
Is fed back to
Figure BDA00036500366300001118
As shown in formula (7):
Figure BDA0003650036630000121
in the formula (I), the compound is shown in the specification,
Figure BDA0003650036630000122
respectively represent consumers
Figure BDA0003650036630000123
The price feedback value, the energy transaction quantity feedback value and the income feedback value;
Figure BDA0003650036630000124
the preference coefficient is represented.
And finally, grading the user feedback, wherein the grading of the user feedback is divided into four levels, namely very satisfactory, generally satisfactory and unsatisfactory grades. A lower user feedback value indicates a higher degree of user satisfaction with the current round of transaction.
And according to the construction of the P2P energy transaction model in the step S1, the energy transaction model is programmed into a block chain intelligent contract, so that the automatic clearing of the transaction and the feedback value measurement of the user are realized. Then the energy trading framework diagram of P2P based on smart contracts is shown in fig. 2.
The P2P energy trading model based on the intelligent contract is mainly divided into the following five core functions, namely creating, trading, feedback, inquiry and clearing functions.
Registering: the registration function refers to registering the microgrid, the producer and consumer, and the consumer. The registration of the microgrid can only be completed by a contract creator, and the address of a microgrid operator is designated; the registration of the producer and consumer is called user registration, the user registration must be completed by the contract creator, and the user type (producer or consumer), the number of the affiliated microgrid and the user address are specified when the user is registered. And (3) checking whether the microgrid exists or not while registering the microgrid, if so, returning a microgrid existing mark, and if not, initializing the microgrid. Similarly, the user is registered, and whether the subordinate microgrid and the user exist or not is checked, if the subordinate microgrid does not exist or the user exists, a 'microgrid does not exist' or 'user exists' mark is returned; and if the micro-grid exists and the user does not exist, initializing the user.
Trading: the transaction function refers to the mutual transaction between the participating main bodies, which mainly comprises the transaction between the producer and the consumer, the transaction between the producer and the consumer and the transaction between the consumer and the consumer. Inside the microgrid, the producers and consumers release the quantity and price of the self-sold and purchased energy, and trade orders are matched according to the PC-DA principle. Under the condition that the supply of the P2P energy trading market is excessive or the demand is insufficient, both the producer and the consumer can trade the energy with the microgrid operator, and the trading price is set according to the microgrid operator.
And (3) feedback: the feedback function refers to the satisfaction degree generated by the producer or consumer who completes the round of P2P energy transaction according to the matching order in the transaction process inside the microgrid. The satisfaction degree is measured by adopting a feedback value and is fed back to the microgrid operator after the transaction is finished, and the microgrid operator can check the feedback values of all users.
And (3) inquiring: the inquiry function refers to that all participating parties can inquire about the content related to the energy trading, including the selling price and the purchasing price of the microgrid operator, the user feedback value, the quantity and the price of the energy purchased and sold by the participating parties, the matching trading order and the like.
Clearing: the clearing function is that after the internal transaction of the micro-grid or the external transaction of the micro-grid is completed, the amount is calculated according to a specified clearing mechanism, and the money is automatically cleared after the money is converted into the token. The invention relates to an energy clearing method, which comprises the steps of paying after using energy, automatically checking whether the balance of a participating main body is enough to pay according to the purchased energy quantity by an intelligent contract before the participating main body auctions energy, forbidding the participating of energy transaction if the balance is not enough, allowing the participating of energy transaction if the balance is enough, and simultaneously freezing a corresponding token. The payment process of the energy transaction is automatically completed by the intelligent contract, so that the phenomenon that the participating main body does not pay for the energy or the balance of the energy is insufficient is avoided.
The intelligent contract based on the intelligent contract P2P energy transaction method provided by the invention takes the intelligent contract of the block chain as an important component part of the P2P energy transaction, plays an important role in the transaction between a producer and a consumer, and brings a series of advantages to the P2P energy transaction:
1) the traditional trading mode of the power grid needs a completely trusted third party intermediary as a trading center, and the invention adopts a block chain and intelligent contract mode to ensure that nodes added into the block chain can unconditionally trust each other, thereby achieving the aim of decentralization;
2) the P2P energy transaction between the producer and consumer can not only locally consume renewable energy and reduce the loss in the transmission process, but also has larger profit for the producer and consumer in the P2P energy transaction compared with the traditional energy transaction mode;
3) the P2P energy trading model is deployed on the intelligent contract, users with demand trading can register and join in energy trading and issue own demands, and the users only need to wait for the intelligent contract to match the contract without human intervention, so that a large amount of manpower, material resources and financial resources are saved;
4) the automatic clearing function saves a great deal of time, and two transaction parties do not need to worry about the condition that energy is not used or the condition that energy cannot be used after payment;
5) user feedback values are set in the intelligent contract to measure the satisfaction degree of the user to the transaction, so that a microgrid operator can well master the energy transaction condition of the user;
6) the trade orders are finally stored on the blockchain, the property of the blockchain enables the trade information not to be falsified, and all users can conveniently and timely trace back the trade orders.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.

Claims (6)

1.一种基于智能合约的P2P能源交易方法,其特征在于,包括以下步骤:1. A P2P energy trading method based on smart contract, is characterized in that, comprises the following steps: S1,针对微电网内部交易,调用智能合约函数注册编号为id的微电网,并在该微电网下注册用户,即产消者和消费者,同时初始化微电网与用户,构建基于智能合约的产消者与消费者之间P2P能源交易模型;S1, for the internal transaction of the microgrid, call the smart contract function to register the microgrid with the id number, and register the users under the microgrid, that is, the producers and consumers, and initialize the microgrid and users at the same time, and build a smart contract-based product P2P energy trading model between consumers and consumers; S2,产消者与消费者之间P2P能源交易模型采用PC-DA进行产消者与消费者之间的P2P能源交易,生成交易订单;S2, the P2P energy transaction model between prosumers and consumers uses PC-DA to conduct P2P energy transactions between prosumers and consumers to generate transaction orders; S3,在智能合约下对生成的交易订单进行自动清算;S3, automatically liquidate the generated transaction orders under the smart contract; S4,交易订单匹配完成后,计算所有参与本轮交易的产消者与消费者的反馈值,进行用户反馈分析;S4, after the transaction order matching is completed, calculate the feedback values of all prosumers and consumers participating in this round of transactions, and conduct user feedback analysis; S5,在达到规定时间后,负责打包的节点将生成的交易订单打包成区块,随后区块在网络中进行传播,等待共识节点达成共识后,将该区块进行上链处理,至此,本轮交易完成。S5, after the specified time is reached, the node responsible for packaging will package the generated transaction order into a block, and then the block will be propagated in the network. After waiting for the consensus node to reach a consensus, the block will be processed on the chain. Round transaction completed. 2.根据权利要求1所述的基于智能合约的P2P能源交易方法,其特征在于,所述步骤S1,针对微电网内部交易,调用智能合约函数注册编号为id的微电网,并在该微电网下注册用户,即产消者和消费者,同时初始化微电网与用户,构建基于智能合约的产消者与消费者之间P2P能源交易模型,具体包括:2. The P2P energy trading method based on smart contract according to claim 1, is characterized in that, described step S1, for microgrid internal transaction, calling the microgrid whose smart contract function registration number is id, and in this microgrid. Register users, namely prosumers and consumers, initialize the microgrid and users at the same time, and build a P2P energy trading model between prosumers and consumers based on smart contracts, including: 设编号为id的微电网能源出售价格和购买价格分别为SPid、BPid;并设微电网id由mid个产消者、nid个消费者组成,产消者用集合
Figure FDA0003650036620000011
Figure FDA0003650036620000012
消费者用集合
Figure FDA0003650036620000013
Figure FDA0003650036620000014
分别表示产消者
Figure FDA0003650036620000015
的出售价格与出售能源数量,其中i=1,2,...,m;
Figure FDA0003650036620000016
分别表示消费者
Figure FDA0003650036620000017
的购买价格与购买能源数量,其中j=1,2,...,n。
Let the sale price and purchase price of the microgrid energy numbered as id be SP id and BP id respectively; and let the microgrid id be composed of m id prosumers and n id consumers, and the prosumers use the set
Figure FDA0003650036620000011
Figure FDA0003650036620000012
collection for consumers
Figure FDA0003650036620000013
Figure FDA0003650036620000014
prosumer
Figure FDA0003650036620000015
The selling price and the quantity of energy sold, where i=1, 2, ..., m;
Figure FDA0003650036620000016
the consumer
Figure FDA0003650036620000017
The purchase price and the quantity of energy purchased, where j = 1, 2, ..., n.
3.根据权利要求2所述的基于智能合约的P2P能源交易方法,其特征在于,所述步骤S2中,产消者与消费者之间P2P能源交易模型采用PC-DA进行产消者与消费者之间的P2P能源交易,生成交易订单,具体包括:3. The smart contract-based P2P energy transaction method according to claim 2, wherein in the step S2, the P2P energy transaction model between prosumers and consumers adopts PC-DA to carry out prosumers and consumers. P2P energy transactions between parties, generating transaction orders, including: 产消者
Figure FDA0003650036620000018
调用智能合约函数发布
Figure FDA0003650036620000019
Figure FDA00036500366200000110
随后自动触发排序规则,按照
Figure FDA00036500366200000111
从低到高排序加入出售数组;
prosumer
Figure FDA0003650036620000018
Call the smart contract function to publish
Figure FDA0003650036620000019
and
Figure FDA00036500366200000110
Then the sorting rules are automatically triggered, according to
Figure FDA00036500366200000111
Sort from low to high and add to the sell array;
同时,消费者
Figure FDA00036500366200000112
调用智能合约函数发布
Figure FDA00036500366200000113
Figure FDA00036500366200000114
并判断消费者
Figure FDA00036500366200000115
是否有足够代币购买数量为
Figure FDA0003650036620000021
的能源,若有足够代币,则自动触发排序规则,按照
Figure FDA0003650036620000022
从高到低排序加入购买数组,否则拒绝消费者
Figure FDA0003650036620000023
参与本轮能源交易;
At the same time, consumers
Figure FDA00036500366200000112
Call the smart contract function to publish
Figure FDA00036500366200000113
and
Figure FDA00036500366200000114
and judge consumers
Figure FDA00036500366200000115
Are there enough tokens to purchase for
Figure FDA0003650036620000021
energy, if there are enough tokens, the sorting rules will be triggered automatically, according to
Figure FDA0003650036620000022
Sort from high to low to join the purchase array, otherwise reject the consumer
Figure FDA0003650036620000023
Participate in this round of energy trading;
根据出售数组与购买数组一对一匹配,满足条件则生成交易订单。According to the one-to-one match between the sell array and the buy array, a transaction order will be generated if the conditions are met.
4.根据权利要求3所述的基于智能合约的P2P能源交易方法,其特征在于,所述根据出售数组与购买数组一对一匹配,满足条件则生成交易订单,具体包括:4. The smart-contract-based P2P energy trading method according to claim 3, characterized in that, according to the one-to-one matching between the sale array and the purchase array, a transaction order is generated when a condition is met, specifically comprising: 判断出售数组第一个元素的出售价格以及出售能源数量与购买数组第一个元素的购买价格以及购买能源数量是否满足要求,即是否同时满足
Figure FDA0003650036620000024
Figure FDA0003650036620000025
Figure FDA0003650036620000026
Determine whether the selling price of the first element of the selling array and the quantity of energy sold and the buying price of the first element of the buying array and the quantity of purchased energy meet the requirements, that is, whether they meet the requirements at the same time
Figure FDA0003650036620000024
Figure FDA0003650036620000025
and
Figure FDA0003650036620000026
满足要求的交易双方形成匹配交易订单,然后依次进行迭代,直至不满足条件,剩余未进行匹配的用户与微电网运营商进行交易。The two parties to the transaction that meet the requirements form a matching transaction order, and then iterate in turn until the conditions are not met, and the remaining unmatched users conduct transactions with the microgrid operator.
5.根据权利要求2所述的基于智能合约的P2P能源交易方法,其特征在于,所述步骤S3,在智能合约下对生成的交易订单进行自动清算,具体包括:5. The smart contract-based P2P energy trading method according to claim 2, wherein the step S3 is to automatically clear the generated transaction order under the smart contract, specifically comprising: S301,以智能合约标准ERC20为基本协议,将代币与能源价格采用汇率来进行换算,平均价格和混合价格均指的是现实世界货币,结算前需先兑换成代币,兑换机制如式(1)所示:S301, using the smart contract standard ERC20 as the basic protocol, converts the token and energy prices using exchange rates. Both the average price and the mixed price refer to real-world currencies, which must be converted into tokens before settlement. The exchange mechanism is as follows ( 1) shown: token=token_rate*price (1)token=token_rate*price (1) 式中,token表示代币,token_rate表示汇率,price表示货币;In the formula, token represents the token, token_rate represents the exchange rate, and price represents the currency; S302,设置平均价格清算机制时间为1小时,该方式下P2P能源交易结束采用平均价格清算;当产消者出价与消费者出价相同时,则平均价格等于产消者出价等于消费者出价;当产消者出价大于消费者出价时,则无法形成匹配订单;当产消者出价小于消费者出价时,则根据两者的平均价格清算;其中,平均价格
Figure FDA0003650036620000027
是指产消者
Figure FDA0003650036620000028
Figure FDA0003650036620000029
与消费者
Figure FDA00036500366200000210
Figure FDA00036500366200000211
两者平均值,如式(2)所示:
S302, the average price clearing mechanism time is set to 1 hour. In this method, the P2P energy transaction ends with the average price clearing; when the prosumer's bid is the same as the consumer's bid, the average price is equal to the prosumer's bid and the consumer's bid is equal; When the prosumer bid is greater than the consumer bid, a matching order cannot be formed; when the prosumer bid is less than the consumer bid, the settlement is based on the average price of the two; among them, the average price
Figure FDA0003650036620000027
refers to prosumers
Figure FDA0003650036620000028
of
Figure FDA0003650036620000029
with consumers
Figure FDA00036500366200000210
of
Figure FDA00036500366200000211
The average value of the two is shown in formula (2):
Figure FDA00036500366200000212
Figure FDA00036500366200000212
S303,设置混合价格清算机制时间为1小时,该方式下P2P能源交易结束采用混合价格清算,产消者
Figure FDA00036500366200000213
与消费者
Figure FDA00036500366200000214
交易的混合价格
Figure FDA00036500366200000215
如式(3)所示:
S303, the time of the mixed price clearing mechanism is set to 1 hour. In this way, the P2P energy transaction ends with mixed price clearing.
Figure FDA00036500366200000213
with consumers
Figure FDA00036500366200000214
The mixed price of the transaction
Figure FDA00036500366200000215
As shown in formula (3):
Figure FDA0003650036620000031
Figure FDA0003650036620000031
6.根据权利要求2所述的基于智能合约的P2P能源交易方法,其特征在于,所述步骤S4,交易订单匹配完成后,计算所有参与本轮交易的产消者与消费者的反馈值,进行用户反馈分析,具体包括:6. The smart contract-based P2P energy trading method according to claim 2, wherein in the step S4, after the transaction order matching is completed, the feedback values of all prosumers and consumers participating in this round of transactions are calculated, Conduct user feedback analysis, including: S401,产消者收益计算:产消者
Figure FDA0003650036620000032
作为生产者的收益
Figure FDA0003650036620000033
如式(4)所示:
S401, Prosumer Benefit Calculation: Prosumer
Figure FDA0003650036620000032
Profits as a producer
Figure FDA0003650036620000033
As shown in formula (4):
Figure FDA0003650036620000034
Figure FDA0003650036620000034
式中,
Figure FDA0003650036620000035
分别表示微电网id下产消者
Figure FDA0003650036620000036
与消费者
Figure FDA0003650036620000037
交易、微电网运营商交易的能源数量;pij表示产消者
Figure FDA0003650036620000038
与消费者
Figure FDA0003650036620000039
的成交价格;采用ln函数描述产出能源与设备支出之间的关系;
In the formula,
Figure FDA0003650036620000035
Respectively represent the prosumers under the microgrid id
Figure FDA0003650036620000036
with consumers
Figure FDA0003650036620000037
Quantity of energy traded, microgrid operators traded; p ij denotes prosumers
Figure FDA0003650036620000038
with consumers
Figure FDA0003650036620000039
The transaction price of ; uses ln function to describe the relationship between output energy and equipment expenditure;
S402,消费者收益计算:消费者
Figure FDA00036500366200000310
的收益
Figure FDA00036500366200000311
如式(5)所示:
S402, Consumer Benefit Calculation: Consumer
Figure FDA00036500366200000310
income
Figure FDA00036500366200000311
As shown in formula (5):
Figure FDA00036500366200000312
Figure FDA00036500366200000312
式中,
Figure FDA00036500366200000313
表示消费者
Figure FDA00036500366200000314
购买能源所得效益;
Figure FDA00036500366200000315
分别表示消费者
Figure FDA00036500366200000316
的效益系数;
Figure FDA00036500366200000317
分别表示微电网id下消费者
Figure FDA00036500366200000318
与产消者
Figure FDA00036500366200000319
交易、微电网运营商交易的能源数量;采用二次函数描述消费者购买能源与所得效益之间的关系,并使用
Figure FDA00036500366200000320
表示消费者
Figure FDA00036500366200000321
的效益因子;
In the formula,
Figure FDA00036500366200000313
means consumer
Figure FDA00036500366200000314
Benefits from purchasing energy;
Figure FDA00036500366200000315
the consumer
Figure FDA00036500366200000316
the benefit coefficient;
Figure FDA00036500366200000317
Respectively represent consumers under the microgrid id
Figure FDA00036500366200000318
with prosumers
Figure FDA00036500366200000319
Transactions, the amount of energy traded by microgrid operators; a quadratic function is used to describe the relationship between energy purchases by consumers and the benefits they receive, and uses
Figure FDA00036500366200000320
means consumer
Figure FDA00036500366200000321
the benefit factor;
S403,产消者反馈值计算:产消者
Figure FDA00036500366200000322
的反馈值
Figure FDA00036500366200000323
如式(6)所示:
S403, calculation of prosumer feedback value: prosumer
Figure FDA00036500366200000322
feedback value of
Figure FDA00036500366200000323
As shown in formula (6):
Figure FDA0003650036620000041
Figure FDA0003650036620000041
式中,
Figure FDA0003650036620000042
分别表示产消者
Figure FDA0003650036620000043
的价格反馈值、能源交易数量反馈值、收益反馈值;
Figure FDA0003650036620000044
表示偏好系数;
In the formula,
Figure FDA0003650036620000042
prosumer
Figure FDA0003650036620000043
price feedback value, energy transaction quantity feedback value, and income feedback value;
Figure FDA0003650036620000044
represents the preference coefficient;
S404,消费者反馈值计算:消费者
Figure FDA0003650036620000045
的反馈值
Figure FDA0003650036620000046
如式(7)所示:
S404, consumer feedback value calculation: consumer
Figure FDA0003650036620000045
feedback value of
Figure FDA0003650036620000046
As shown in formula (7):
Figure FDA0003650036620000047
Figure FDA0003650036620000047
式中,
Figure FDA0003650036620000048
分别表示消费者
Figure FDA0003650036620000049
的价格反馈值、能源交易数量反馈值、收益反馈值;
Figure FDA00036500366200000410
表示偏好系数。
In the formula,
Figure FDA0003650036620000048
the consumer
Figure FDA0003650036620000049
price feedback value, energy transaction quantity feedback value, and income feedback value;
Figure FDA00036500366200000410
represents the preference coefficient.
CN202210548195.8A 2022-05-18 2022-05-18 P2P energy trading method based on intelligent contract Pending CN114841813A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210548195.8A CN114841813A (en) 2022-05-18 2022-05-18 P2P energy trading method based on intelligent contract

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210548195.8A CN114841813A (en) 2022-05-18 2022-05-18 P2P energy trading method based on intelligent contract

Publications (1)

Publication Number Publication Date
CN114841813A true CN114841813A (en) 2022-08-02

Family

ID=82570927

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210548195.8A Pending CN114841813A (en) 2022-05-18 2022-05-18 P2P energy trading method based on intelligent contract

Country Status (1)

Country Link
CN (1) CN114841813A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116416027A (en) * 2023-03-10 2023-07-11 苏州科技大学 Microgrid energy trading method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116416027A (en) * 2023-03-10 2023-07-11 苏州科技大学 Microgrid energy trading method and system
CN116416027B (en) * 2023-03-10 2023-11-10 苏州科技大学 Micro-grid energy trading method and system

Similar Documents

Publication Publication Date Title
Du et al. The impact of land policy on the relation between housing and land prices: Evidence from China
Ye Indicative bidding and a theory of two-stage auctions
Hansen Auctions of companies
CN110276671A (en) A method of electricity trading based on block chain technology
US20030041002A1 (en) Method and system for conducting an auction for electricity markets
CN111127137A (en) Distributed energy P2P trading method based on centralized matching
Fang et al. A double auction model for competitive generators and large consumers considering power transmission cost
CN114444864B (en) Block chain-based hierarchical power transaction matching method under distributed power market
CN118172123B (en) Collaborative optimization method and system for operation and transaction of multiple micro-grids in virtual power plant
CN102254284A (en) Grid resource scheduling method based on simultaneous upward-offering auction mechanism
CN109523075A (en) Charging station charging power Optimizing Configuration System based on block chain intelligence contract
CN112785429A (en) Local area multi-microgrid power transaction pairing method based on block chain technology
Oprea et al. A motivational local trading framework with 2-round auctioning and settlement rules embedded in smart contracts for a small citizen energy community
CN113240474A (en) Block chain-based distributed energy transaction method and system
Okwuibe et al. Survey and analysis of local energy markets based on distributed ledger technologies
CN114841813A (en) P2P energy trading method based on intelligent contract
CN114519640A (en) Alliance chain-based transnational power transaction method
CN115375481A (en) Block chain technology-based hierarchical power transaction optimization method
CN114782133A (en) A multi-stage electricity transaction method based on energy blockchain
Bashir A class of multi-attribute auction transformed into single-attribute auction on Margin Bid
TWI498841B (en) Efficient method of network labeling
CN117035919A (en) A blockchain-based distributed power transaction pairing settlement method
CN117541382A (en) A two-stage transaction method for microgrid distributed power based on blockchain
CN116051211A (en) Blockchain-based energy supply and demand transaction method, device, terminal and storage medium
CN116703458A (en) A method, system, device and medium for automatically generating electricity retail packages

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination