Intelligent energy trading system and method based on block chain technology
Technical Field
The invention relates to the technical field of block chains, in particular to an intelligent energy trading system based on a block chain technology. Meanwhile, the invention also relates to an intelligent energy trading method based on the block chain technology.
Background
In a traditional power system, power is mainly generated by thermal power, hydropower and the like, and new energy becomes an important energy strategy all over the world under the background of increased environmental protection pressure. Photovoltaic, wind power, renewable energy and other new energy technologies are becoming mature, and with the ever-increasing market scale, users with scattered individual capacity increase, and new energy market trading has become market demand. The development of the energy Internet further promotes the rapid application of distributed energy, energy storage, electric vehicles and the like, the energy production is changed into a centralized production mode and a distributed production mode which exist harmoniously, and the traditional power grid structure is changed. The rapid rise of distributed new energy, energy storage, electric vehicles, carbon transaction and the like has more diverse participants, so that the energy source flow, the information flow and the fund flow in the energy internet are more complex. Due to the fact that all main bodies are dispersed and a network trust mechanism is lost, the problems that metering, interaction, control and decision making of all participating main bodies of a power system are difficult are effectively solved, and no relevant research exists at present. Traditional settlement systems have failed to meet or hinder the development of intelligent energy.
The 'Internet plus' intelligent energy tries to establish a new energy industry development form with deep integration of the Internet and energy production, transmission, storage, consumption and energy market, and realizes 'equipment intelligence, multi-energy cooperation, information symmetry, supply and demand dispersion, system flatness and open transaction'. The block chain technology is used for innovating the traditional internet pattern and mode, promoting efficient operation in various aspects such as transaction, authentication and the like by taking guarantee trust as a core, and providing an important technical means for solving the problem of transaction settlement in a distributed micro-grid system and the like based on the technical characteristics of the block chain.
At present, a transaction management method based on a block chain technology exists, but the problems of high node cost and high resource consumption occur in practical use. Moreover, in the existing power supply system, the user side only has an intelligent electric meter or similar metering equipment, and the requirement of a consensus layer in a data model cannot be met.
Disclosure of Invention
In view of the above, the present invention provides an intelligent energy transaction system based on a block chain technology, so as to overcome the problems of high node cost and high resource consumption in the prior art.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a smart energy transaction system based on a block chain technology comprises unit equipment arranged at a main body end, wherein the unit equipment comprises a smart electric meter with a metering function and light terminals, all the light terminals form a block chain P2P network, and each light terminal is used as an independent node in the block chain P2P network and is communicated with the smart electric meter in real time to obtain measurement data and participate in various consensus algorithms to complete transactions; the data model of the block chain in the light terminal comprises a data layer, a network layer, a consensus layer, a contract layer and an application layer; wherein, the consensus layer adopts a DPOS consensus method.
Furthermore, the light terminal completes the functions of a transaction node, a billing node, an agent node and a common node in the unit in a DPOS algorithm system.
Furthermore, the light terminal switches roles among the common node, the transaction node, the accounting node and the proxy node according to the network operation condition.
Furthermore, the light terminal is internally provided with a transaction module, a billing module, an agent module and a storage module.
Further, the transaction module is configured to implement functions of a transaction node, including generating a transaction request including executing an intelligent contract, and broadcasting the transaction request into a blockchain network.
Furthermore, the accounting module is used for realizing the functions of the accounting node. The method comprises the steps of executing intelligent contracts according to transaction requests after the transaction requests are received, storing generated contract execution results and the transaction requests in newly generated blocks, and broadcasting the blocks to a block chain network.
Further, the agent module is used for realizing the functions of the agent node, and comprises executing the intelligent contract according to the transaction request after receiving the block, and verifying the contract execution result.
Further, the storage module is configured to enable storing the block information on the block chain.
Further, the intelligent contract comprises a power consumption time period or power consumption and a protocol price.
Meanwhile, the invention provides an intelligent energy trading method based on the block chain technology.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a smart energy trading method based on block chain technology includes the following steps
The method comprises the following steps that firstly, the light terminal issues the type of a unit outwards, and acquires the types of the units issued by other light terminals, wherein the types of the units are divided into an energy supply unit and an energy consumption unit;
step two, the energy consumption unit makes a self demand plan according to the information of the energy supply unit, and generates a trade reservation through the light terminal to send the trade reservation to the energy supply unit;
step three, after receiving the transaction reservation, the energy supply unit negotiates transaction contents with the energy consumption unit, generates a transaction record and stores the reserved transaction contents in a block network;
step four, the light terminal of the energy consumption unit is used as a transaction node, and the transaction record is generated into block information;
step five, after the negotiation between the two parties is completed, the energy supply unit broadcasts the reserved content to the outside, and the energy consumption unit receives the content and provides a basis for the reservation;
step six, the energy supply unit completes power supply according to the reserved transaction content, generates a completion record after the reserved transaction is completed, and stores the completed content in the block network;
and step seven, after the energy consumption unit finishes the transaction content, finishing payment according to the intelligent contract, and storing the information content after finishing payment in the block network.
Compared with the prior art, the invention has the following advantages:
1. the invention provides a block chain consensus method and nodes based on DPOS (distributed power system) based on power unit equipment, and adopts the DPOS consensus method, so that the complexity of node equipment is reduced, a light terminal can play any role in an algorithm system, the problems of high node cost and high resource consumption in the prior art are solved, and further, an intelligent energy trading system based on the block chain technology applying the block chain DPOS consensus method is realized, so that autonomous point-to-point trading of different participating main bodies of distributed energy, energy storage, charging piles, a power grid and power utilization units is met, an energy Internet trading system and a commercial operation platform with open sharing of intelligent energy and high safety and efficiency are realized, and the development of intelligent energy under new potentials is adapted.
2. The invention adds the light terminal on the basis of the intelligent electric meter, the intelligent electric meter keeps the original function basically unchanged, the existing equipment and resources are fully utilized to complete the system function, the upgrading is simple on the basis of the existing system, the function is clear, the interface is simple, and the light terminal completes the transaction based on the block chain technology.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts. In the drawings:
fig. 1 is a schematic diagram illustrating a block chain technology based unit partition of a smart energy transaction system according to embodiment 1 of the present invention;
fig. 2 is a schematic diagram illustrating a block chain technology-based smart energy transaction system according to embodiment 1 of the present invention;
fig. 3 is a schematic diagram of a smart meter in a smart energy transaction system based on a blockchain technology according to embodiment 1 of the present invention;
fig. 4 is a schematic diagram illustrating communication between a smart meter and a light terminal in the smart energy trading system based on the blockchain technology according to embodiment 1 of the present invention;
fig. 5 is a schematic diagram illustrating a data model of a light terminal in a smart energy transaction system based on a block chain technology according to embodiment 1 of the present invention;
fig. 6 is a schematic flowchart illustrating a DPOS-based blockchain consensus method in the intelligent energy trading method based on blockchain technology according to embodiment 1 of the present invention;
fig. 7 is a schematic diagram illustrating block information generation in a smart energy transaction method based on a blockchain technique according to embodiment 2 of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely a few embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
In the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", and the like indicate orientations or positional relationships based on those shown in the drawings, and are used merely for convenience of description and for simplicity of description, and do not indicate or imply that the device or element so referred to must have a particular orientation, be constructed in a particular orientation, and be operated, and thus should not be considered as limiting the present invention.
In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; the connection may be direct or indirect via an intermediate medium, and may be a communication between the two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
Example 1
The embodiment relates to a smart energy trading system based on a block chain technology, which comprises an energy supply unit for providing power resources and an energy consumption unit for using the power resources. The main design comprises: the intelligent energy source comprises unit classification design, communication modes among units, settlement modes among units and equipment configuration on the units. In particular, the amount of the solvent to be used,
firstly, unit classification design of intelligent energy is carried out. The wisdom energy includes multiple main parts such as distributed energy, energy storage, fills electric pile, electric wire netting, power consumption unit, and above-mentioned multi-main-part classification can be power plant, photovoltaic power generation user, wind energy power generation user, national grid limited company, energy storage company, power supply network, power consumption unit. Photovoltaic power generation users and wind power generation users are distributed micro-grid systems and can be classified into one category. The above participating subjects are divided into units.
Therefore, the present embodiment divides the unit into an energy supply unit and an energy consumption unit according to the functions of the above-described main body. Among them, power plants, photovoltaic power generation users, wind power generation users, national grid limited companies, and energy storage companies provide power resources as energy supply units, and power consumption units use power resources as energy consumption units (as shown in fig. 1). The units are connected through power supply lines, and energy supply and energy consumption are realized through the power supply lines.
Preferably, the energy consumption unit establishes transactions with a plurality of the energy supply units at the same time. Notably, the power supply line is not within both the supply and demand parties, which is a third party that provides service. In particular, an energy storage company as an energy supply unit that can store energy during a power consumption valley period and pay a fee to a power generation side (the above-mentioned energy supply unit); the national grid limited is supplied with electricity during peak hours and charged a fee.
And secondly, designing a communication mode between the units. And all units are communicated through the Internet of things. Networking is carried out through a communication line, and information is transmitted.
And designing a settlement mode between the units again. The settlement mode between units is a decentralized point-to-point settlement mode. The points can directly reserve and purchase the electricity consumption, and after the electricity consumption is completed, both trading parties can directly settle accounts without a center, thereby simplifying the settlement process. Transaction content is recorded using blockchain techniques. Generating a block every time when reservation is started, and recording information of both transaction parties; and updating the block information after the transaction is completed.
And finally, designing the equipment configuration on the unit. Each unit is connected to a power supply circuit through access equipment, and is provided with a light terminal. Specifically, the devices on the unit include a smart meter and a light terminal that cooperates with the smart meter (one exemplary configuration is shown in FIG. 2). The intelligent electric meter finishes a metering function, and the light terminal acquires metering data, stores electricity consumption information data, interacts with the blockchain network, and finishes functions of transaction, geographic positioning and mobile phone interaction in the blockchain network. The light terminal completes the interaction, negotiation and transaction among the units, and the signed negotiation and transaction information is submitted to the block chain network by the light terminal for verification. The block chain information is stored on the light terminal to form distributed storage, so that verification and query are facilitated. The smart electric meter and the light terminal are in communication connection through a communication mode presented by the smart electric meter, and preferably, the smart electric meter and the light terminal are connected through a 485 port (as shown in fig. 4). And all the light terminals form a block chain P2P network, and each light terminal is used as an independent node in the block chain P2P network, is communicated with the intelligent electric meter in real time, acquires measurement data, participates in each consensus algorithm and completes the transaction.
The present invention uses a conventional smart meter (as shown in fig. 3). The device comprises a sampling module, an I/O module, a metering module, a central processing module and a communication module. Specifically, the sampling module samples the current and the voltage, respectively. The I/O module connects the display device and the input device, such as a liquid crystal display and a keyboard. The communication module can be externally connected with a 485 module, a Bluetooth module, a GPRS module and an infrared module to realize the connection with participating equipment such as a mobile phone. The metering module is used for metering the electricity consumption. The central processing module is used for finishing man-machine interaction, external communication and calculation.
A data model associated with the blockchain in the light terminal is shown in fig. 5. As can be seen in fig. 5, the data model includes a data layer, a network layer, a consensus layer, a contract layer, and an application layer.
And (3) a data layer: the chain structure of the bottom layer data block is packaged, and related technologies such as asymmetric public and private key data encryption technology and time stamp are used, and the chain structure is the bottom layer data structure in the whole block chain technology. These techniques are the basis for building settlement systems, and their use for decades has proven its reliability to be very secure. And the block chain formally and skillfully combines the technologies together. A block federation chain is utilized to ensure that the block chain is not fully disclosed. The data is computed at least once using an irreversible encryption algorithm to generate a unique blockchain ID, i.e., a Hash value.
Network layer: including P2P networking mechanisms, data propagation mechanisms, data verification mechanisms, and the like. The early application of P2P networking technology in P2P downloaded software such as BT means that the blockchain has an automatic networking function. The units are equal in status and communicated with each other, and have the characteristics of distribution, autonomy, openness, free access and the like. Each unit in the block chain network can participate in the checking and accounting process of the block data, and the block chain can be recorded only after the block data passes the verification of most units in the whole network. The decentralized design of the block chain ensures that the file data cannot be tampered and forged.
A consensus layer: and various consensus mechanism algorithms of the network unit are encapsulated. The consensus mechanism algorithm is the core technology of the blockchain, because the decision is made on who to perform the accounting, and the accounting decision mode influences the safety and reliability of the whole system. More than ten consensus mechanism algorithms have appeared, among which the most well-known ones are the workload Proof mechanism (PoW), the equity Proof mechanism (PoS), the equity Proof mechanism (DPoS), and the released Proof mechanism (post). The data layer, the network layer and the consensus layer are essential elements for constructing the blockchain technology, and the lack of any layer cannot be called the blockchain technology in the true sense.
And (3) contract layer: and various scripts, algorithms and intelligent contracts are packaged, and are the basis of the programmable characteristic of the block chain. The bitcoin has the writing function of a simple script, and the Ethengfang greatly strengthens a programming language protocol and can write application for realizing any function theoretically. If the bitcoin is regarded as a global account book, the ether house can be regarded as a 'global computer', any person can upload and execute any application program, and the effective execution of the program can be guaranteed. In the invention, the contract layer is packaged with a contract code for electric power settlement, when the condition in the contract code is triggered, the corresponding transaction is automatically executed, and meanwhile, the corresponding electric power transaction price, settlement rule and the like can be specified through the contract content.
An application layer: various application scenes and cases of the block chain are packaged, for example, various block chain applications built on an Ethermen are deployed on an application layer, and future programmable finance and programmable society are built on the application layer. In the invention, the application layer applies the block chain technology to the light terminal, such as user management, bill management, data management and the like.
Some data models are also provided with an incentive layer, and economic factors are integrated into a block chain technology system, including an economic incentive issuing mechanism, an economic incentive distributing mechanism and the like, which mainly appear in a public chain. Units that are subject to rules of compliance must be incentivized in the public chain to participate in billing, and units that are not subject to rules are penalized for the overall system to evolve toward virtuous circle. In the private chain, the incentive is not necessarily needed, because the units participating in the accounting are often gambled out of the chain, requiring participation in accounting by force or voluntary. In this embodiment, the excitation layer is not provided.
At the consensus layer, more than ten consensus mechanism algorithms have appeared, among which the most known are the workload Proof mechanism (PoW), the equity Proof mechanism (PoS), the authorized Proof mechanism (DPoS), etc. The consensus mechanism of the blockchain is very important, and the consensus mechanism is used for ensuring the safety and reliability of the whole blockchain network. Common consensus algorithms are mainly POW, POS, DPOS, PBFT, etc. In this embodiment, a flow chart of the block chain consensus method based on DPOS is shown in fig. 6.
As can be seen from fig. 6, the transaction node generates a transaction request containing an execution intelligence contract and broadcasts the transaction request into the blockchain network. The transaction node may be any one of the nodes in the blockchain network. The transaction nodes with transaction requirements generate transaction requests and broadcast the transaction requests in the whole blockchain network, and other nodes receive the transaction requests. The intelligent contracts are contracts in the form of executable computer code, which enable the transaction process, and each contract has a trigger condition. When the trigger condition is met, the method is automatically executed in the block chain network without human intervention. The number and the types of the intelligent contracts stored on all the agent nodes are the same, and each intelligent contract has a unique identification ID.
After receiving the transaction request, the accounting node takes out the identification ID and transaction parameters of the intelligent contract in the transaction request, executes the corresponding intelligent contract, then stores the original transaction request and the contract execution result into a newly generated block together, then broadcasts the block data in the whole network, and other nodes receive the block data. In the DPOS block chain network, a stock holder selects the proxy nodes through voting, and other non-proxy nodes are common nodes. Any one of the agent nodes may be used as an accounting node for transaction confirmation and block data generation. At the same time, there is only one accounting node in the blockchain network. The specific accounting node is determined based on the preset confirmation logic and mechanism of the accounting node.
And after receiving the block, the agent node takes out the transaction request and the contract execution result, executes the intelligent contract according to the transaction request, compares the generated result with the contract execution result in the block, verifies the correctness of the contract execution result, accepts the block if the result is correct, and discards the block if the result is not correct. In this embodiment, the agent node executes the intelligent contract, verifies the correctness of the result of the intelligent contract executed by the accounting module, and selects a chain consensus mechanism according to the branch length based on the DPOS block chain network, so as to ensure that the common node recognizes the acknowledged result and the erroneous result is discarded. The method only needs the agent node to execute the intelligent contract verification contract execution result, and does not need the common node to verify the contract execution result, thereby greatly liberating the computing capability of the whole network. Meanwhile, compared with the existing DPOS block chain consensus method, the consensus method provided by the embodiment adopts an intelligent contract mode, so that a user can submit a code written by the user to a block chain system, and the trading requirement of intelligent energy sources participated by multiple main bodies can be met.
Preferably, the light terminal in this embodiment can complete the functions of all types of nodes, and it can switch between different node roles as needed.
Example 2
The embodiment relates to an intelligent energy trading method based on a block chain technology, which comprises the following steps:
step one, the light terminal issues the type of the unit outwards, and acquires the unit types issued by other light terminals, wherein the unit types are divided into an energy supply unit and an energy consumption unit. Here, the information issued by the energy supply unit is particularly important.
And step two, the energy consumption unit formulates an energy demand plan according to the own demand. The plan may be generated automatically or manually. The light terminal in the energy consumption unit generates a transaction reservation according to an external instruction (a manual instruction or an automatically generated instruction) and transmits the transaction reservation to a specific unit.
And step three, after receiving the transaction reservation, the opposite side unit negotiates transaction content with the sending reservation side, generates transaction records and stores the reserved transaction content in the block network.
And step four, the light terminal of the transaction initiator (generally an energy consumption unit) is used as a transaction node, and the information is generated into block information, wherein the intelligent contract comprises a power utilization time period or power consumption, a protocol price, a payment means and the like.
And step five, after the negotiation between the two parties is completed, the energy supply unit broadcasts the reserved content to the outside, the energy consumption unit receives the content to provide a basis for the reservation, and the reserved time period of the reserved energy supply unit is avoided during the reservation, so that the efficiency is improved.
And step six, the energy supply unit finishes power supply (calculated according to the power supply time or the total power supply amount) according to the reserved transaction content, generates a finish record after finishing the reserved transaction, and stores the finish content in the block network.
And step seven, after the energy consumption unit finishes the transaction content, finishing payment according to the intelligent contract, and storing the information content after finishing payment in the block network.
In this embodiment, three pieces of block information are generated for one power transaction (as shown in fig. 7):
block information 1: the reservation of the supply and demand parties is completed, and the reservation is generated, including reservation content and payment conditions.
Block information 2: the power supply unit generates the reservation request in the block information 1.
Block information 3: the energy consumption unit is generated when the energy supply unit completes payment after completing the reservation request in the block information 1.
The block information 1 is the basis and contract of the transaction, the block information 2 and 3 are certificates for completing the contract of the energy supply unit and the energy consumption unit, and the whole process of the energy transaction is completely recorded in the 3 block information, and mutual authentication is realized.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.